473,327 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

XPointer

Let's suppose I want a document like this:

<tree>
<node>
<nodeChildren>
<node... </node>
...
<nodeSelection selected="..."/>
</node>
....
</tree>

"selected" attribute is an xpointer that point to a child node in
nodeChildren sequence.
I have to write the schema for that document. My question is
how can I specify the "selected" attribute in the schema to be an
xpointer?
Thanks.

Feb 17 '07 #1
2 1866
* Giacomino wrote in comp.text.xml:
>Let's suppose I want a document like this:

<tree>
<node>
<nodeChildren>
<node... </node>
...
<nodeSelection selected="..."/>
</node>
...
</tree>

"selected" attribute is an xpointer that point to a child node in
nodeChildren sequence.
I have to write the schema for that document. My question is
how can I specify the "selected" attribute in the schema to be an
xpointer?
Just like you would specify any other data type for the attribute. The
main problem here is that common implementations do not have pre-defined
data types that would help you here, you would have to define and if you
also want to actually validate documents implement one yourself. Another
problem is that XPointer is extensible, you would have to decide how you
handle XPointer schemes your implementation does not know about. In the
general case XPointer is a context-free language, so to implement it you
would need to write a corresponding parser for it. You could also try to
approximate the grammar using a regular expression.
--
Björn Höhrmann · mailto:bj****@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Feb 17 '07 #2
On 17 Feb, 12:59, Bjoern Hoehrmann <bjo...@hoehrmann.dewrote:
* Giacomino wrote in comp.text.xml:
Let's suppose I want a document like this:
<tree>
<node>
<nodeChildren>
<node... </node>
...
<nodeSelection selected="..."/>
</node>
...
</tree>
"selected" attribute is an xpointer that point to a child node in
nodeChildren sequence.
I have to write the schema for that document. My question is
how can I specify the "selected" attribute in the schema to be an
xpointer?

Just like you would specify any other data type for the attribute. The
main problem here is that common implementations do not have pre-defined
data types that would help you here, you would have to define and if you
also want to actually validate documents implement one yourself. Another
problem is that XPointer is extensible, you would have to decide how you
handle XPointer schemes your implementation does not know about. In the
general case XPointer is a context-free language, so to implement it you
would need to write a corresponding parser for it. You could also try to
approximate the grammar using a regular expression.
--
Björn Höhrmann · mailto:bjo...@hoehrmann.de ·http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 ·http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 ·http://www.websitedev.de/
And if I declare "select" attribute as xs:AnyURI? Is "#xpointer(here()/
ancestor::node[1]/child::nodeChildren/child::node[2])" a valid value
for it?

Feb 18 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: DV | last post by:
Hello, can anyone tell me or point me to somewhere what the exact differences (in terms of when would I use what) between XPath, XLink, XPointer and DOM are? Does it require special software...
2
by: Pascal Schmitt | last post by:
Hello! Is there an Implementation of XPointer for .NET which supports range-to? (Or if not: how difficult is it to build it yourself?) -- Pascal Schmitt
0
by: shaun | last post by:
Can anyone clarify if these are true and perhaps add to the list of XPointer supported parsers/transformers: For parsers: * Xerces will allow elements to be accessed if they have an xml:id...
0
by: Henry S. Thompson | last post by:
W3C is pleased to announce the public launch of the XPointer Schemes Registry: http://www.w3.org/2005/04/xpointer-schemes/ The XPointer Recommendation reserved all simple (unprefixed) XPointer...
1
by: Daniel | last post by:
Microsoft support for XPointer and XLink what micrsoft technologies support XPointer and XLink?
3
by: tintagel | last post by:
Hi everyone, I'm currently updating my website. In a previous incarnation, I had some content with a navigation frame: the displayed page was e.g. "frames.htm", which loaded an html doc...
0
by: moonty | last post by:
Is it possible to have a xpointer attribute inside a xml file called from a xinclude attribute. eg: FileA.xml <xi:include href="FileB.xml" /> FileB.xml <xi:include href="FileC.xml"...
0
by: ab.angadbhat | last post by:
hi, I have an element in the xml file which has xlink:href ="xyz.xml" as an attribute. I am using xpointer to point to only 2nd <Uelement of the xyz.xml file and so i am doing:- xlink:href...
3
by: Robert Jones | last post by:
Is there a browser or even just a parser that fully supports and implements xlink and xpointer?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.