![]() ![]() If no schema is in use, the node will be untyped, and the type of the resulting atomic value will be untypedAtomic. If the input document has been validated against a schema, then the node will typically have a type annotation, and this determines the type of the resulting atomic value (in this example, the price attribute might have the type decimal). ![]() If an operand returns a node (for example, * 1.2), then the node is automatically atomized to extract the atomic value. ![]() Operations such as arithmetic and boolean comparison require atomic values as their operands. The type system of XPath 2.0 is noteworthy for the fact that it mixes strong typing and weak typing within a single language. They may also belong to a type derived from one of these primitive types: either a built-in derived type such as integer or Name, or a user-defined derived type defined in a user-written schema. ![]() If an element or attribute is successfully validated against a particular complex type or simple type defined in a schema, the name of that type is attached as an annotation to the node, and determines the outcome of operations applied to that node: for example, when sorting, nodes that are annotated as integers will be sorted as integers.Ītomic values may belong to any of the 19 primitive types defined in the XML Schema specification (for example, string, boolean, double, float, decimal, dateTime, QName, and so on). A node acquires a type as a result of validation against an XML Schema. (The document node replaces the root node of XPath 1.0, because the XPath 2.0 model allows trees to be rooted at other kinds of node, notably elements.) Nodes are of seven kinds, corresponding to different constructs in the syntax of XML: elements, attributes, text nodes, comments, processing instructions, namespace nodes, and document nodes. An individual node or atomic value is considered to be a sequence of length one. Main article: XQuery and XPath Data ModelĮvery value in XPath 2.0 is a sequence of items. All three languages share the same data model (the XDM), type system, and function library, and were developed together and published on the same day. XPath 2.0 is used as a sublanguage of XSLT 2.0, and it is also a subset of XQuery 1.0. The two language versions are therefore described in separate articles. The language is significantly larger than its predecessor, XPath 1.0, and some of the basic concepts such as the data model and type system have changed. XPath allows nodes to be selected by means of a hierarchic navigation path through the document tree. For this purpose the XML document is modelled as a tree of nodes. XPath is used primarily for selecting parts of an XML document. As a W3C Recommendation it was superseded by XPath 3.0 on 10 April 2014. It became a recommendation on 23 January 2007. XPath 2.0 is a version of the XPath language defined by the World Wide Web Consortium, W3C. JSTOR ( August 2010) ( Learn how and when to remove this template message).Unsourced material may be challenged and removed. Please help improve this article by adding citations to reliable sources. This article needs additional citations for verification. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |