Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XPointer

Reply
Thread Tools

XPointer

 
 
Giacomino
Guest
Posts: n/a
 
      02-17-2007
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.

 
Reply With Quote
 
 
 
 
Bjoern Hoehrmann
Guest
Posts: n/a
 
      02-17-2007
* 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 · (E-Mail Removed) · 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/
 
Reply With Quote
 
 
 
 
Giacomino
Guest
Posts: n/a
 
      02-18-2007
On 17 Feb, 12:59, Bjoern Hoehrmann <(E-Mail Removed)> wrote:
> * 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 · (E-Mail Removed) ·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?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using xpointer in html tintagel HTML 3 04-03-2006 02:34 AM
using xlink and xpointer with jaxb shay Java 0 11-29-2005 01:18 PM
XPointer support shaun XML 0 11-18-2005 03:31 PM
Xpointer? ShakyMobo XML 0 02-24-2005 11:19 AM
Difference between XPath, XLink, XPointer and DOM? DV XML 1 04-19-2004 10:51 AM



Advertisments