Skip to content

Commit

Permalink
Merge pull request #1635 from bryan-m-hughes/timob-7946
Browse files Browse the repository at this point in the history
Timob 7946 Updated XML implementation.
  • Loading branch information
cb1kenobi committed Mar 12, 2012
2 parents e679d51 + 98224e6 commit 7362d8b
Show file tree
Hide file tree
Showing 21 changed files with 113 additions and 187 deletions.
9 changes: 6 additions & 3 deletions apidoc/Titanium/XML/Attr.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
---
name: Titanium.XML.Attr
extends: Titanium.XML.Node
summary: Proxy representing an attribute of an [Element](Titanium.XML.Element), as defined
in the [DOM Level 2 specification](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-637646024).
summary: Represents an attribute of an [Element](Titanium.XML.Element).
description: |
Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-637646024) on
Android and iOS. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-637646024) implementation on Mobile Web.
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
properties:
- name: name
type: String
Expand Down
10 changes: 5 additions & 5 deletions apidoc/Titanium/XML/CDATASection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ summary: |
Used to include blocks of literal text containing characters that would otherwise need
to be escaped.
description: |
The text contained in the CDATA section is stored in the [data](Titanium.XML.CDATASection.data) property.
This conforms to the [DOM Level 2](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-667469212)
defintion of a `CDATASection`.
Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-667469212) on
Android and iOS with some non-standard extensions. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-667469212) implementation on Mobile Web. On Mobile
Web, there is no Titanium.XML.CDATASection object. A string object containing the data is used directly instead.
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
12 changes: 7 additions & 5 deletions apidoc/Titanium/XML/CharacterData.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
name: Titanium.XML.CharacterData
extends: Titanium.XML.Node
summary: An interface extending <Titanium.XML.Node> with a set of
attributes and methods for accessing character data in the DOM. This
conforms to the [DOM Level 2](http://www.w3.org/TR/DOM-Level-2-Core/core.html)
defintion of a DOM CharacterData. Unlike the DOM, for reasons of compatibility
with the javascript engine, text is represented by UTF-8 instead of UTF-16.
attributes and methods for accessing character data in the DOM.

Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-FF21A306) on
Android and iOS. For reasons of compatibility with the javascript engine, text is represented by
UTF-8 instead of UTF-16 on Android and iOS. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-FF21A306) implementation on Mobile Web.
since: "0.9"
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
methods:
- name: appendData
summary: Append the string to the end of the character data of the node.
Expand Down
10 changes: 4 additions & 6 deletions apidoc/Titanium/XML/Comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ extends: Titanium.XML.CharacterData
summary: |
Represents the contents of an XML comment.
description: |
The text contained in the comment is stored in the [data](Titanium.XML.Comment.data) property.
This conforms to the [DOM Level
2](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1728279322)
defintion of a `Comment`.
Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1728279322) on
Android and iOS with some non-standard extensions. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1728279322) implementation on Mobile Web.
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
7 changes: 4 additions & 3 deletions apidoc/Titanium/XML/DOMImplementation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ name: Titanium.XML.DOMImplementation
extends: Titanium.Proxy
summary: The <Titanium.XML.DOMImplementation> interface provides a number of methods for
performing operations that are independent of any particular instance of the document object
model. This conforms to the [DOM Level 2](http://www.w3.org/TR/DOM-Level-2-Core/core.html)
defintion of a DOM DOMImplementation.
model.Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490)
on Android and iOS. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490) implementation on Mobile Web.
since: "1.8"
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
methods:
- name: createDocument
summary: Creates an <Titanium.XML.Document> object of the specified type with its document
Expand Down
7 changes: 5 additions & 2 deletions apidoc/Titanium/XML/Document.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
---
name: Titanium.XML.Document
summary: The DOM Document returned from <Titanium.XML.parseString>.
Implements the [DOM Level 2 API](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#i-Document).
description: |
Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#i-Document) on
Android and iOS. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#i-Document) implementation on Mobile Web.
As of version 3.1, Android still does not truly support DTDs. A document with a DTD can be
parsed, however it is not validated, none of its default attributes will automatically be put
into the tree, etc. [Google is aware of the issue](http://code.google.com/p/android/issues/detail?id=7395).
extends: Titanium.XML.Node
createable: false
since: "0.9"
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
properties:
- name: doctype
type: Titanium.XML.DocumentType
Expand Down
8 changes: 4 additions & 4 deletions apidoc/Titanium/XML/DocumentFragment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ description: |
When a `DocumentFragment` is inserted into a DOM tree, children of the `DocumentFragment` are
added, not the `DocumentFragment` itself.
This conforms to the [DOM Level
2](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-B63ED1A3)
defintion of a `DocumentFragment`.
Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-B63ED1A3) on
Android and iOS with some non-standard extensions. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-B63ED1A3) implementation on Mobile Web.
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
9 changes: 4 additions & 5 deletions apidoc/Titanium/XML/DocumentType.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ summary: Each <Titanium.XML.Document> has a `doctype` attribute whose value
is either 'null' or a <Titanium.XML.DocumentType> object.

description: |
This provides an
interface to the list of entities that are defined for the document. This
conforms to the [DOM Level 2](http://www.w3.org/TR/DOM-Level-2-Core/core.html)
defintion of a DOM DocumentType.
This provides an interface to the list of entities that are defined for the document. Implements the
[DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-412266927) on Android and iOS. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-412266927) implementation on Mobile Web.
As of version 3.1, Android still does not truly support DTDs. A document with a DTD can be
parsed, however it is not validated, none of its default attributes will automatically be put
into the tree, etc. [Google is aware of the issue](http://code.google.com/p/android/issues/detail?id=7395).
since: "0.9"
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
properties:
- name: entities
summary: >
Expand Down
15 changes: 11 additions & 4 deletions apidoc/Titanium/XML/Element.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ summary: >
Represents an element in a DOM document, a <Titanium.XML.Node>
defined by a start-tag and end-tag (or an empty tag). Elements may have
[attributes](Titanium.XML.Attr) associated with them.
This conforms to the
[DOM Level 2](http://www.w3.org/TR/DOM-Level-2-Core/core.html)
definition of a DOM Element.
Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614)
on Android and iOS with some non-standard extensions. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-745549614) implementation on Mobile Web.
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
methods:
- name: getAttribute
summary: Retrieves an attribute value by name, returning it as a string.
Expand Down Expand Up @@ -217,6 +218,12 @@ properties:
type: String
permission: read-only
- name: text
summary: <em>Non-standard</em>. Retrieves all child text nodes as one String
type: String
permission: read-only
platforms: [android, iphone, ipad]
- name: textContent
summary: Retrieves all child text nodes as one String
type: String
permission: read-only
platforms: [mobileweb]
10 changes: 6 additions & 4 deletions apidoc/Titanium/XML/Entity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ extends: Titanium.XML.Node
summary: This interface represents an entity, either parsed or unparsed, in
an XML document. Note that this models the entity itself not the entity
declaration. The nodeName attribute that is inherited from Node contains the
name of the entity. An Entity node does not have any parent. This conforms to
the [DOM Level 2](http://www.w3.org/TR/DOM-Level-2-Core/core.html)
defintion of a DOM Entity.
name of the entity. An Entity node does not have any parent.

Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-527DCFF2)
on Android and iOS. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-527DCFF2) implementation on Mobile Web.
since: "0.9"
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
properties:
- name: notationName
summary: For unparsed entities, the name of the notation for the entity.
Expand Down
8 changes: 4 additions & 4 deletions apidoc/Titanium/XML/EntityReference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ extends: Titanium.XML.Node
summary: |
Represents an XML entity reference.
description: |
This conforms to the [DOM Level
2](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-11C98490)
defintion of an `EntityReference`.
Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-11C98490)
on Android and iOS. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-11C98490) implementation on Mobile Web.
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
10 changes: 6 additions & 4 deletions apidoc/Titanium/XML/NamedNodeMap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ name: Titanium.XML.NamedNodeMap
extends: Titanium.Proxy
summary: >
A key-value paired map that maps String objects to
<Titanium.XML.Node> objects. This conforms to the
[DOM Level 2](http://www.w3.org/TR/DOM-Level-2-Core/core.html)
defintion of a DOM NamedNodeMap.
<Titanium.XML.Node> objects.
Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1780488922)
on Android and iOS. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1780488922) implementation on Mobile Web.
since: "0.9"
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
methods:
- name: getNamedItem
summary: Retrieves a node specified by name.
Expand Down
8 changes: 5 additions & 3 deletions apidoc/Titanium/XML/Node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ name: Titanium.XML.Node
extends: Titanium.Proxy
summary: A single node in the [Document|Titanium.XML.Document] tree.
description: |
For full property and method description,
see the [DOM Level 2 API](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247).
Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247)
on Android and iOS. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1950641247) implementation on Mobile Web.
For full property and method description, see the W3C specifications.
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
properties:
- name: ELEMENT_NODE
type: Number
Expand Down
9 changes: 5 additions & 4 deletions apidoc/Titanium/XML/NodeList.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
name: Titanium.XML.NodeList
extends: Titanium.Proxy
summary: A list of <Titanium.XML.Node> objects. This conforms to the
[DOM Level 2](http://www.w3.org/TR/DOM-Level-2-Core/core.html)
definition of a DOM NodeList.
summary: A list of <Titanium.XML.Node> objects. Implements the
[DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-536297177)
on Android and iOS. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-536297177) implementation on Mobile Web.
since: "0.9"
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
methods:
- name: item
summary: Returns the <Titanium.XML.Node> object at the specified index.
Expand Down
8 changes: 5 additions & 3 deletions apidoc/Titanium/XML/Notation.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
name: Titanium.XML.Notation
extends: Titanium.Proxy
summary: >
represents a notation declared in the DTD. See [DOM Level 2 Spec](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-5431D1B9)
summary: Represents a notation declared in the DTD. Implements the
[DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-5431D1B9)
on Android and iOS. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-5431D1B9) implementation on Mobile Web.
since: "0.9"
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
properties:
- name: publicId
summary: The public identifier of this notation. If the public identifier was not specified, this is `null`.
Expand Down
8 changes: 5 additions & 3 deletions apidoc/Titanium/XML/ProcessingInstruction.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
name: Titanium.XML.ProcessingInstruction
extends: Titanium.Proxy
summary: >
a way to keep processor-specific information in the text of the document. See [DOM Level 2 Spec](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1004215813)
summary: A way to keep processor-specific information in the text of the document. Implements the
[DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1004215813)
on Android and iOS. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1004215813) implementation on Mobile Web.
since: "0.9"
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
properties:
- name: data
summary: >
Expand Down
9 changes: 5 additions & 4 deletions apidoc/Titanium/XML/Text.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
name: Titanium.XML.Text
extends: Titanium.XML.CharacterData
summary: Represents the textual content of an <Titanium.XML.Element> or <Titanium.XML.Attr>
This conforms to the [DOM Level 2](http://www.w3.org/TR/DOM-Level-2-Core/core.html)
defintion of a DOM Text.
summary: Represents the textual content of an <Titanium.XML.Element> or <Titanium.XML.Attr> Implements the
[DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1312295772)
on Android and iOS. Exposes the
[DOM Level 3 API](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1312295772) implementation on Mobile Web.
createable: false
platforms: [android, iphone, ipad]
platforms: [android, iphone, ipad, mobileweb]
methods:
- name: splitText
summary: Breaks this node into two nodes at the specified by offset,
Expand Down
12 changes: 11 additions & 1 deletion apidoc/Titanium/XML/XML.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
---
name: Titanium.XML
summary: The top level XML module. The XML module is used parsing and processing XML-based content.
summary: The top level XML module. The XML module is used for parsing and processing XML-based content.
description: |
The API for this module is based on the W3C DOM specification.
Android and iOS implement the [DOM Level 2](http://www.w3.org/TR/DOM-Level-2-Core/core.html) specification
with some non-standard extensions, which are documented in the appropriate places.
Mobile Web directly exposes the [DOM Level 3](http://www.w3.org/TR/DOM-Level-3-Core/core.html) implementation
in the browser. New features introduced in DOM Level 3 are not documented here for brevity. For information on
these features, please use the W3C documentation. Getters and setters for properties are not supported on
Mobile Web.
extends: Titanium.Module
since: "0.9"
methods:
Expand Down
4 changes: 2 additions & 2 deletions mobileweb/titanium/Ti/Geolocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ define(["Ti/_/Evented", "Ti/_/lang", "Ti/Network"], function(Evented, lang, Netw
}
function createLocationArguments() {
return {
enableHighAccuracy: api.accuracy === api.ACCURACY_BEST,
enableHighAccuracy: api.accuracy === api.ACCURACY_HIGH,
timeout: api.MobileWeb.locationTimeout,
maximumAge: api.MobileWeb.maximumLocationAge
}
Expand Down Expand Up @@ -180,7 +180,7 @@ define(["Ti/_/Evented", "Ti/_/lang", "Ti/Network"], function(Evented, lang, Netw

constants: {

ACCURACY_BEST: 1,
ACCURACY_HIGH: 1,

ACCURACY_LOW: 2,

Expand Down

0 comments on commit 7362d8b

Please sign in to comment.