Yeah, thanks, this is basically what I'd come up with as well, I was hoping there was a more elegant way though. In DB2 it looks like there is a way of setting the dictionary of namespaces to resolve in the database query which then gets passed though to the backend to use when resolving in Xalan. Presumably that's a feature that Derby will get in the future, allowing the myns:Name syntax to be used.
For reference, what I ended up with was (To get the text content of the Name
field):
statement.execute(
"SELECT ID, " +
"XMLSERIALIZE( " +
"XMLQUERY('//*[local-name()=\"Name\" and
namespace-uri()=\"http://www.myproject.ox.ac.uk/MyProject\"]/text()' PASSING
BY REF Definition EMPTY ON EMPTY) " +
"AS VARCHAR(10000)) " +
"FROM My_Schema.My_Table");
Thanks very much for your suggestions.
Douglas
--
Douglas PW Russell
Research Officer - GIMI/NeuroGrid
Oxford University Computing Laboratory
Tel: +44 (0)1865 283519
email: [EMAIL PROTECTED]
pgplewdErx8jx.pgp
Description: PGP signature
