[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XPath expression to find all items with an attribute

Subject: XPath expression to find all items with an attribute whose value is xs: hexBinary or xs:base64Binary?
From: "Costello, Roger L. costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 25 Feb 2016 15:03:34 -0000
 XPath expression to find all items with an attribute
Hi Folks,

I am trying to create an XPath expression to find any XSD items that have an
attribute with value xs:hexBinary or xs:base64Binary. Here's the XPath that I
tried:

//xs:*[some $i in @* satisfies
  namespace-uri-from-QName(resolve-QName($i, .)) eq
'http://www.w3.org/2001/XMLSchema'
  and
  local-name-from-QName(resolve-QName($i, .)) = ('base64Binary',
'hexBinary')]

When I apply that XPath expression to the below schema, I get this mysterious
error message:

	XPath failed due to: Invalid QName {15}

Huh? What does that mean?

What's the correct way to write the XPath?  /Roger

-----------------------------------------------------------------------------
----
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:element name="person">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="firstname">
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:maxLength value="15"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:element>
                <xs:element name="photo" type="xs:base64Binary"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.