Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » XPath pattern error
XPath pattern error [message #25941] Sun, 03 August 2003 16:43 Go to next message
Eclipse UserFriend
Originally posted by: guyos.attglobal.net

I applied a 'unique' constraint on an element an I get an pattern error
message (in the IDE) for the attribute 'xpath' of the 'selector' element
when the value is:
myNS:elem1 | myNS:elem2

When I use the same schema with all the feature of validation with the
xerces parser I don't get an error message and the parser does detect when
the constraint is broken.

The schema also passes validation with IBM's SQC
Re: XPath pattern error [message #25982 is a reply to message #25941] Sun, 03 August 2003 20:38 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

--------------58F52F675882AE5CE18516A1
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Guy,

The XSD model is strictly following the pattern definition as it appears in
the normative XMLSchema.xsd:

<xs:element name="selector" id="selector">
<xs:annotation>
<xs:documentation
source="http://www.w3.org/TR/xmlschema-1/#element-selector"/>
</xs:annotation>
<xs:complexType>
<xs:complexContent>
<xs:extension base="xs:annotated">
<xs:attribute name="xpath" use="required">
<xs:simpleType>
<xs:annotation>
<xs:documentation>A subset of XPath expressions for use
in selectors</xs:documentation>
<xs:documentation>A utility type, not for public
use</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:annotation>
<xs:documentation>The following pattern is intended to
allow XPath
expressions per the following EBNF:
Selector ::= Path ( '|' Path )*
Path ::= ('.//')? Step ( '/' Step )*
Step ::= '.' | NameTest
NameTest ::= QName | '*' | NCName ':' '*'
child:: is also allowed
</xs:documentation>
</xs:annotation>
<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>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>

I don't think this pattern allows a space character to appear within the
expression. Perhaps the other processors are more forgiving and simply ignore
spaces, but I think the XSD model's strictness is "more correct." Removing
the spaces from the expression does eliminate the error message. Okay?


Guy Sharon wrote:

> I applied a 'unique' constraint on an element an I get an pattern error
> message (in the IDE) for the attribute 'xpath' of the 'selector' element
> when the value is:
> myNS:elem1 | myNS:elem2
>
> When I use the same schema with all the feature of validation with the
> xerces parser I don't get an error message and the parser does detect when
> the constraint is broken.
>
> The schema also passes validation with IBM's SQC

--------------58F52F675882AE5CE18516A1
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Guy,
<p>The XSD model is strictly following the <font color="#3333FF">pattern
definition</font> as it appears in the normative XMLSchema.xsd:
<blockquote>&nbsp;&lt;xs:element name="selector" id="selector">
<br>&nbsp; &lt;xs:annotation>
<br>&nbsp;&nbsp; &lt;xs:documentation source="<A HREF="http://www.w3.org/TR/xmlschema-1/#element-selector"/">http://www.w3.org/TR/xmlschema-1/#element-selector"/</A>>
<br>&nbsp; &lt;/xs:annotation>
<br>&nbsp; &lt;xs:complexType>
<br>&nbsp; &lt;xs:complexContent>
<br>&nbsp;&nbsp; &lt;xs:extension base="xs:annotated">
<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;xs:attribute name="xpath" use="required">
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xs:simpleType>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xs:annotation>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;xs:documentation>A subset
of XPath expressions for use
<br>in selectors&lt;/xs:documentation>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;xs:documentation>A utility
type, not for public
<br>use&lt;/xs:documentation>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xs:annotation>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xs:restriction base="xs:token">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;xs:annotation>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;xs:documentation>The
following pattern is intended to allow XPath
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
expressions per the following EBNF:
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Selector&nbsp;&nbsp;&nbsp;
::=&nbsp;&nbsp;&nbsp; Path ( '|' Path )*
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Path&nbsp;&nbsp;&nbsp;
::=&nbsp;&nbsp;&nbsp; ('.//')? Step ( '/' Step )*
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Step&nbsp;&nbsp;&nbsp;
::=&nbsp;&nbsp;&nbsp; '.' | NameTest
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; NameTest&nbsp;&nbsp;&nbsp;
::=&nbsp;&nbsp;&nbsp; QName | '*' | NCName ':' '*'
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
child:: is also allowed
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;/xs:documentation>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;/xs:annotation>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;xs:pattern value="<font color="#3333FF"> (\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?( (\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?( \i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)* </font>">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;/xs:pattern>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xs:restriction>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xs:simpleType>
<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xs:attribute>
<br>&nbsp;&nbsp; &lt;/xs:extension>
<br>&nbsp; &lt;/xs:complexContent>
<br>&nbsp;&lt;/xs:complexType>
<br>&nbsp;&lt;/xs:element></blockquote>
I don't think this pattern allows a space character to appear within the
expression.&nbsp; Perhaps the other processors are more forgiving and simply
ignore spaces, but I think the XSD model's strictness is "more correct."&nbsp;
Removing the spaces from the expression does eliminate the error message.&nbsp;
Okay?
<br>&nbsp;
<p>Guy Sharon wrote:
<blockquote TYPE=CITE>I applied a 'unique' constraint on an element an
I get an pattern error
<br>message (in the IDE) for the attribute 'xpath' of the 'selector' element
<br>when the value is:
<br>myNS:elem1 | myNS:elem2
<p>When I use the same schema with all the feature of validation with the
<br>xerces parser I don't get an error message and the parser does detect
when
<br>the constraint is broken.
<p>The schema also passes validation with IBM's SQC</blockquote>
</html>

--------------58F52F675882AE5CE18516A1--
Re: XPath pattern error [message #575472 is a reply to message #25941] Sun, 03 August 2003 20:38 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
--------------58F52F675882AE5CE18516A1
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Guy,

The XSD model is strictly following the pattern definition as it appears in
the normative XMLSchema.xsd:

<xs:element name="selector" id="selector">
<xs:annotation>
<xs:documentation
source="http://www.w3.org/TR/xmlschema-1/#element-selector"/>
</xs:annotation>
<xs:complexType>
<xs:complexContent>
<xs:extension base="xs:annotated">
<xs:attribute name="xpath" use="required">
<xs:simpleType>
<xs:annotation>
<xs:documentation>A subset of XPath expressions for use
in selectors</xs:documentation>
<xs:documentation>A utility type, not for public
use</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:annotation>
<xs:documentation>The following pattern is intended to
allow XPath
expressions per the following EBNF:
Selector ::= Path ( '|' Path )*
Path ::= ('.//')? Step ( '/' Step )*
Step ::= '.' | NameTest
NameTest ::= QName | '*' | NCName ':' '*'
child:: is also allowed
</xs:documentation>
</xs:annotation>
<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>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>

I don't think this pattern allows a space character to appear within the
expression. Perhaps the other processors are more forgiving and simply ignore
spaces, but I think the XSD model's strictness is "more correct." Removing
the spaces from the expression does eliminate the error message. Okay?


Guy Sharon wrote:

> I applied a 'unique' constraint on an element an I get an pattern error
> message (in the IDE) for the attribute 'xpath' of the 'selector' element
> when the value is:
> myNS:elem1 | myNS:elem2
>
> When I use the same schema with all the feature of validation with the
> xerces parser I don't get an error message and the parser does detect when
> the constraint is broken.
>
> The schema also passes validation with IBM's SQC

--------------58F52F675882AE5CE18516A1
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Guy,
<p>The XSD model is strictly following the <font color="#3333FF">pattern
definition</font> as it appears in the normative XMLSchema.xsd:
<blockquote>&nbsp;&lt;xs:element name="selector" id="selector">
<br>&nbsp; &lt;xs:annotation>
<br>&nbsp;&nbsp; &lt;xs:documentation source="<A HREF="http://www.w3.org/TR/xmlschema-1/#element-selector"/">http://www.w3.org/TR/xmlschema-1/#element-selector"/</A>>
<br>&nbsp; &lt;/xs:annotation>
<br>&nbsp; &lt;xs:complexType>
<br>&nbsp; &lt;xs:complexContent>
<br>&nbsp;&nbsp; &lt;xs:extension base="xs:annotated">
<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;xs:attribute name="xpath" use="required">
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xs:simpleType>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xs:annotation>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;xs:documentation>A subset
of XPath expressions for use
<br>in selectors&lt;/xs:documentation>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;xs:documentation>A utility
type, not for public
<br>use&lt;/xs:documentation>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xs:annotation>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xs:restriction base="xs:token">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;xs:annotation>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;xs:documentation>The
following pattern is intended to allow XPath
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
expressions per the following EBNF:
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Selector&nbsp;&nbsp;&nbsp;
::=&nbsp;&nbsp;&nbsp; Path ( '|' Path )*
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Path&nbsp;&nbsp;&nbsp;
::=&nbsp;&nbsp;&nbsp; ('.//')? Step ( '/' Step )*
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Step&nbsp;&nbsp;&nbsp;
::=&nbsp;&nbsp;&nbsp; '.' | NameTest
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; NameTest&nbsp;&nbsp;&nbsp;
::=&nbsp;&nbsp;&nbsp; QName | '*' | NCName ':' '*'
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
child:: is also allowed
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;/xs:documentation>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;/xs:annotation>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;xs:pattern value="<font color="#3333FF"> (\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?( (\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?( \i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)* </font>">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;/xs:pattern>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xs:restriction>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xs:simpleType>
<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xs:attribute>
<br>&nbsp;&nbsp; &lt;/xs:extension>
<br>&nbsp; &lt;/xs:complexContent>
<br>&nbsp;&lt;/xs:complexType>
<br>&nbsp;&lt;/xs:element></blockquote>
I don't think this pattern allows a space character to appear within the
expression.&nbsp; Perhaps the other processors are more forgiving and simply
ignore spaces, but I think the XSD model's strictness is "more correct."&nbsp;
Removing the spaces from the expression does eliminate the error message.&nbsp;
Okay?
<br>&nbsp;
<p>Guy Sharon wrote:
<blockquote TYPE=CITE>I applied a 'unique' constraint on an element an
I get an pattern error
<br>message (in the IDE) for the attribute 'xpath' of the 'selector' element
<br>when the value is:
<br>myNS:elem1 | myNS:elem2
<p>When I use the same schema with all the feature of validation with the
<br>xerces parser I don't get an error message and the parser does detect
when
<br>the constraint is broken.
<p>The schema also passes validation with IBM's SQC</blockquote>
</html>

--------------58F52F675882AE5CE18516A1--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:XPath pattern error
Next Topic:Schema Validator
Goto Forum:
  


Current Time: Fri Apr 19 20:10:22 GMT 2024

Powered by FUDForum. Page generated in 0.02846 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top