mbenolie / xpath-as3

Automatically exported from code.google.com/p/xpath-as3
0 stars 0 forks source link

Built-in XML namespace is not respected #18

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In XML, the namespace prefix "xml" should be automatically mapped to
"http://www.w3.org/XML/1998/namespace", but this mapping does not happen.

Steps:

1.
var xml:XML = <foo><a xml:id="1">a1</a><a xml:id="2">a2</a></foo>;
var path:XPathQuery = new XPathQuery("//a[@xml:id='1']/text()");
trace(path.exec(xml));

What is the expected output?
a1

 What do you see instead?
Error: There is no namespace mapped to the prefix 'xml'.

Original issue reported on code.google.com by peterj...@gmail.com on 10 Apr 2009 at 5:36

GoogleCodeExporter commented 8 years ago
NameTest was checking the custom namespaces array directly, rather than calling
XPathContext.getNamespaceURI(), so it missed the default namespaces. 

This will be in the next build.

Original comment by peterj...@gmail.com on 10 Apr 2009 at 5:39