Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

[jdom-interest] & in namespace

Deshpande, Aniruddha

2006-05-02

Replies:

Hello,

 

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 which gets converted to http://abc.com?a=b&c=d. This results in invalid WSDL document as “&” is a preserved entity.

 

With Regards,

Aniruddha Deshpande

 

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.