Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[XML Schema 1.1] The XPath in cannot "look up" the XML tree, right?

From: "Costello, Roger L." <costello@-----.--->
To: "'xmlschema-dev@--.---'" <-------------@--.--->
Date: 4/29/2009 5:36:00 AM
Hi Folks,

I wish to confirm that I correctly understand the specification. I believe =
it says the XPath in an <assert> cannot "look up" the XML tree. That is, it=
 can't reference a parent, grandparent, etc. Is that correct?

Consider this instance document:

<Document classification="secret">
    <Para classification="unclassified">
          ...
    </Para>
    <Para classification="secret">
          ...
    </Para>
    <Para classification="unclassified">
          ...
    </Para>
    <Para classification="secret">
          ...
    </Para>
</Document>


Here I place an <assert> on the Para element which attempts to reference th=
e (parent) Document element:

<xs:element name="Para">
    <xs:complexType>
        <xs:simpleContent>
            <xs:extension base="paraType">
                <xs:attribute name="classification" type="classificatio=
nLevels" use="required"/>
                <xs:assert test="if (@classification eq 'top-secret') the=
n ../Document/@classification eq 'top-secret') ... />
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>
</xs:element>

This is not allowed, correct?

/Roger


From mike@s... Wed Apr 29 14:03:36 2009
Received: from maggie.w3.org ([193.51.208


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent