Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
XPath 2.0
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Type system == [[File:XQuery and XPath Data Model type hierarchy.png|thumb|The [[XQuery and XPath Data Model|XDM]] type hierarchy]] The type system of XPath 2.0 is noteworthy for the fact that it mixes [[strong typing]] and [[weak typing]] within a single language. Operations such as arithmetic and boolean comparison require atomic values as their operands. If an operand returns a node (for example, <code>@price * 1.2</code>), then the node is automatically ''atomized'' to extract the atomic value. 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 <code>price</code> attribute might have the type <code>decimal</code>). If no schema is in use, the node will be untyped, and the type of the resulting atomic value will be <code>untypedAtomic</code>. Typed atomic values are checked to ensure that they have an appropriate type for the context where they are used: for example, it is not possible to multiply a date by a number. Untyped atomic values, by contrast, follow a weak typing discipline: they are automatically converted to a type appropriate to the operation where they are used: for example with an arithmetic operation an untyped atomic value is converted to the type <code>double</code>.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)