* 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/