Hi Ali,
Someone else reported this problem as Bug 16612.[1]
After some discussion with (and much persuasion by) Elena Litani, who
is a developer on Xerces-J and also a member of the W3C DOM working group,
I concluded that the behaviour you describe was a bug in Xalan-J's
serialization. Brian Minchau fixed this in the new common Xalan-J
serializer he developed. The fix is available in Xalan-J 2.5.0.
If you are already using Xalan-J 2.5.0, and you are still
experiencing this problem, please let us know, or open a new bug report.
Thanks,
Henry
[1] http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16612
------------------------------------------------------------------
Henry Zongaro Xalan development
IBM SWS Toronto Lab Tie Line 969-6044; Phone (905) 413-6044
mailto:[EMAIL PROTECTED]
"ALI,HANEEF (HP-Cupertino,ex1)" <[EMAIL PROTECTED]>
2003-04-28 12:33 PM
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc:
Subject: What is wrong with this code ?
Hi,
Can some one let me know what is wrong in the code. Iam not getting
namespace uri ( xmlns:=.....)
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder =
factory.newDocumentBuilder();
Document document =
builder.newDocument();
Element el =
document.createElementNS("http://tempuri",
"ns1:test");
TransformerFactory tFactory =
TransformerFactory.newInstance();
Transformer transformer =
tFactory.newTransformer();
DOMSource source = new DOMSource(el);
ByteArrayOutputStream docStream = new
ByteArrayOutputStream();
StreamResult result = new
StreamResult(docStream);
transformer.transform(source, result);
System.out.println( doctream.toString();
Iam getting
<?xml version="1.0" encoding="UTF-8"?>
<ns1:test/>
I should get
<?xml version="1.0" encoding="UTF-8"?>
<ns1:test xmlns:ns1="http://tempuri"/>
_____
Haneef Ali
Web Services Management Operation
HP OpenView Division
408.447.1183
[EMAIL PROTECTED] < mailto:[EMAIL PROTECTED]>