- From: Frank Yung-Fong Tang <franktang@gmail.com>
- Date: Mon, 14 Mar 2005 16:25:27 -0500
- To: public-qt-comments@w3.org, www-xml-schema-comments@w3.org
Any one aware of any activity that request the XML Schema working
group, or some other working group to define a *standard* 'type' for
element to hold a XPath?
If more and more XML based language use XPath (such as XML Schema
itself, XSLT and eveutlaly the XQueryX) in the future then there are a
common need for a element of type xpath. It will be nice to add xpath
as a primitive type into the next version of XML Schema Part II
datatype so poeple can use it similar to the way they can use
hexBinary, anyURI, etc to define XML element (or attribute) to contain
XPath
Currenlty, several W3C use ad hoc way to define xpath type in their
XML based language
in XML Schema itself
(see reference http://www.w3.org/2001/XMLSchema.xsd )
<xs:attribute name="xpath" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:pattern
value="(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*">
</xs:pattern>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
in XSLT - http://www.w3.org/TR/xslt
<!ENTITY % pattern "CDATA">
in XSLT2 WD- http://www.w3.org/TR/xslt20/#stylesheets-and-schemas
<xs:simpleType name="expression">
<xs:annotation>
<xs:documentation>
An XPath 2.0 expression.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:pattern value=".+"/>
</xs:restriction>
</xs:simpleType>
In http://www.w3.org/TR/xqueryx/
The XPath is repersented by a tree of structure instead of a CDATA.
--
Frank Yung-Fong Tang
譚永鋒
Šýšţém Årçĥîţéçţ
Received on Monday, 14 March 2005 21:25:58 UTC