-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi. I'm tring to use Xalan's XPath support to run queries on some
Collada documents I have. I've run into the issue that the documents
all declare themselves in an anonymous namespace:
<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema"
version="1.4.0">
<asset>
...
</asset>
</COLLADA>
So I want my XPath expressions to refer through that namespace. I
thought I'd try using the XalanSimplePrefixResolver doing something
like this:
XalanSimplePrefixResolver thePrefixResolver(
XalanDOMString("c"),
XalanDOMString("http://
www.collada.org/2005/11/COLLADASchema"),
XalanDOMString("http://
www.collada.org/2005/11/COLLADASchema")
);
XPathEvaluator theEvaluator;
// OK, let's find the COLLADA root node...
XalanNode* theContextNode = theEvaluator.selectSingleNode(
theDOMSupport,
theDocument,
XalanDOMString("/c:COLLADA"),.c_str(),
thePrefixResolver);
But all I get are exceptions:
XSL exception: The prefix 'c' is not declared.
Now, I'm clearly guessing on the declaration of the XalanSimplePrefix
resolver, as I don't know the difference between the URI and the
NamespaceURI parameters to the constructor.
What am I doing wrong? If I ditch the xmlns declaration out of my
xml file (and ignore the resolver...) all is fine.
Thanks,
Paul
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
iD8DBQFFAdtyr7+oA6AsvAkRAgWhAJ0VNdpBsv073Yp87rGGv73WBn8R7wCfSi0g
i59+/bwfr4fKA/zX4SHMvME=
=DgnI
-----END PGP SIGNATURE-----