Hi,

I have problem with getting xerces to output namespace declarations,

I have tried using 2 diffrent methods and both fails.

First I create the document.

       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
       dbf.setNamespaceAware(true);
       Document doc = dbf.newDocumentBuilder().newDocument();

Then I try with thease two methods but non of them output namespace declarations. The code in try 1 worked with a older xerces (The one included in jboss 2.3.2)

Try 1:
       OutputFormat format = new OutputFormat();
       format.setLineSeparator(LineSeparator.Unix);
       format.setIndenting(true);
       format.setLineWidth(0);
       format.setPreserveSpace(true);
       XMLSerializer serializer = new XMLSerializer(sw, format);
       serializer.asDOMSerializer();
       serializer.serialize(doc);

Try 2:
       TransformerFactory xformFactory = TransformerFactory.newInstance();
       Transformer idTransform = xformFactory.newTransformer();
       Source input = new DOMSource(doc);
       Result output = new StreamResult(sw);
       idTransform.transform(input, output);

I'm greatful for any help or hints

/Tommy


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to