Paul Lalonde wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I will read the source in the future. Point taken :-)
I'm just using it as a simple container right now, so this should be ok
for now, but I know it doesn't solve my problem in the general case.
I have a bunch of XML documents that I have to extract relatively simple
tables of data from using XPath queries. My initial implementation used
a XalanDocumentPrefixResolver, but this fails in the presence of the
default namespace present in each of my documents. To make it work my
XPath query has to explicitly name that default namespace, something
like "/c:COLLADA" instead of "/COLLADA". I used the
XalanSimplePrefixResolver and made it work. But this will fail when the
document refers to other namespaces.
I'm guessing my longer term answer will be to build a new improved
XalanDocumentPrefixResolver that also allows me to register new
namespaces a la XalanNamespacesStack.
Or does this functionality already exist? I can't seem to find it.
No, it doesn't exist by default. Several years ago, I posted an
implementation of a PrefixResolver that used a XalanMap internally. That
would probably be the easiest thing to use, but it really depends on how
you discover namespace bindings to begin with.
XalanNamespaceStack is probably too heavyweight for your needs, since it
doesn't seem like you need a stack of namespaces at all.
Dave