Re: Replacing default namespace
Scott Sauyet wrote:
Thank you very much. That did exactly what I was looking for. And I think (or at least hope) I'm learning something from it. I haven't used XSLT all that much, and when I do, I think of it as transformations of elements. Other nodes have always just been modifications to those nodes. You code points out what should be obvious, but which I've always overlooked, that my templates can match attribute nodes just as easily. That makes all sorts of processing that I've previously struggled through much easier to accomplish.
The other thing I need to do is get Saxon into my regular routine. When I process this from Xalan (whatever version is the default when running Ant 1.7.0 against Java 1.6.0_01), I get a document which presumably has the same information, but which is cluttered up with additional redundant namespace declarations, one for each element in the original without an explicit namespace, and each one pointing to the WSDL namespace. It's an annoying issue that may have hidden from me that several earlier attempts were actually working correctly.
Something like this:
<ns2:message xmlns:ns2="http://schemas.xmlsoap.org/wsdl/" name="Sessions_OpenRequest"> <ns3:part xmlns:ns3="http://schemas.xmlsoap.org/wsdl/" name="UserName" type="xs:string"/> <ns4:part xmlns:ns4="http://schemas.xmlsoap.org/wsdl/" name="Password" type="xs:string"/> <ns5:part xmlns:ns5="http://schemas.xmlsoap.org/wsdl/" name="StationName" type="xs:string"/> </ns2:message>
<message name="Sessions_OpenRequest"> <part name="UserName" type="xs:string"/> <part name="Password" type="xs:string"/> <part name="StationName" type="xs:string"/> </message>
Clearly there's no real harm in Xalan's code, but damn, it's ugly!
In any case, thank you for your help.
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format