You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2003/02/03 15:33:41 UTC

DO NOT REPLY [Bug 16706] New: - Invalid XPath Expression s

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16706>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16706

Invalid XPath Expression s

           Summary: Invalid XPath Expression s
           Product: Xerces2-J
           Version: 2.2.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: XML Schema datatypes
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: nmehrega@ca.ibm.com
                CC: nddelima@ca.ibm.com


The parser accepts invalid XPath expressions for the 'selector' and 'field'
elements.

Consider the following schema code:

<xsd:keyref name="PartNumber" refer="r:pNumKey">
   <xsd:selector id="bad01" xpath="r:zip/r:part/@number"/>
   <xsd:field xpath="@number"/>
</xsd:keyref>

The @ symbol can't appear in the 'xpath' attribute of 'selector'.

The @ symbol also can't appear twice in the 'field' element as indicated in the
schema code below:

<xsd:keyref name="PartNumber" refer="r:NumKey1">
   <xsd:selector xpath="r:zip/r:part"/>
   <xsd:field id="bad01" xpath="@number/@quantity"/>
</xsd:keyref>

The following invalid XPath expressions for the 'selector' element are also go
undetected by the parser:

<xsd:unique name="ZipCode">
   <xsd:selector id="bad02" xpath="r:regions///r:zip"/>
   <xsd:field xpath="@code"/>
</xsd:unique>

<xsd:key name="pNumKey">
   <xsd:selector id="bad03" xpath="r:parts/..."/>
   <xsd:field xpath="@number"/>
</xsd:key>

<xsd:keyref name="PartNumber" refer="r:pNumKey">
   <xsd:selector id="bad01" xpath="r:zip/child::**"/>
   <xsd:field xpath="@number"/>
</xsd:keyref>

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org