Hello,

my question is whether XPath does consider the namespace of attributes or
not ?

for example:

<?xml version="1.0" encoding="UTF-8"?>
<kern xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
      xmlns:ims="http://www.imsglobal.org/xsd/imsmd_v1p2";
      xsi:noNamespaceSchemaLocation="movii-kern.xsd"
      xsi:schemaLocation="http://www.imsglobal.org/xsd/imsmd_v1p2
imsmd_v1p2p2.xsd">
...
<metadata>
    <ims:title ims:lang="de">...</ims:title>
</metadata>
...
</kern>

If I start the following XPath query

rootElement.selectNodes("//ims:title[@ims:lang='de']")

on the XML document below, I get an empty List.
But if I remove the namespace for the 'lang' attribute in the document
(<ims:title lang="de">...</ims:title>) and in the XPath query
("//ims:title[@lang='de']") I get the expected list of elements.


Has somebody similar experiences or can tell me what XPath is doing?

--
Andreas



-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing 
real-time communications platform! Don't just IM. Build it in! 
http://www.jabber.com/osdn/xim
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to