[jdom-interest] & in namespace

Deshpande, Aniruddha Aniruddha.Deshpande at softwareag.com
Mon May 1 22:45:32 PDT 2006



I use SAXBuilder to parse and add an extra element to an existing WSDL
file. I am facing problem for WSDLs which have & in their namespace
declaration. When I use XMLOutputter to write back the changed WSDL
"&" gets replaced with "&".


This happens only with extra namespaces. That is "&" in
targetNameSpace and in rest of the WSDL document remain same, however
"&" in other namespace declarations change.


Here is a simple code snippet that I use:

SAXBuilder builder = new SAX...;

Document doc = Builder.build(InputStream);


// Add some elements to doc


XMLOutputter out = new XMLOut...

Out.output(doc, OutputStream);


"tns" namespce in <wsdl:definitions> has value
<http://abc.com/?a=b&amp;c=d> http://abc.com?a=b&amp;c=d which gets
converted to  <http://abc.com/?a=b&c=d> http://abc.com?a=b&c=d. This
results in invalid WSDL document as "&" is a preserved entity.


With Regards,

Aniruddha Deshpande


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20060502/5e258b06/attachment.htm

More information about the jdom-interest mailing list