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
XPointer
(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!
== Positional element addressing == The <code>element()</code> scheme<ref name="xpointer-element-scheme">{{Cite web|url=https://www.w3.org/TR/xptr-element/|title=XPointer element() Scheme|publication-date=2003-03-23|access-date=2021-04-08|collaboration=W3C XML Linking Working Group|website=W3C|publisher=W3C|editor-first1=Paul|editor-last1=Grosso|editor-first2=Eve|editor-last2=Maler|editor-first3=Jonathan|editor-last3=Marsh|editor-first4=Norman|editor-last4=Walsh}}</ref> introduces positional addressing of child elements. This is similar to a simple XPath address, but subsequent steps can only be numbers representing the position of a descendant relative to its branch on the tree. For instance, given the following fragment: <syntaxhighlight lang="xml"> <foobar id="foo"> <bar/> <baz> <bom a="1"/> </baz> <bom a="2"/> </foobar> </syntaxhighlight> results as the following examples: xpointer(id("foo")) => foobar xpointer(/foobar/1) => bar xpointer(//bom) => bom (a=1), bom (a=2) element(/1/2/1) => bom (a=1) (/1 descend into first element (foobar), /2 descend into second child element (baz), /1 select first child element (bom))
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)