Can anyone tell me what is wrong. I'm using Xerces to make an Document-object in this way:
doc= new DocumentImpl(); Element root = doc.createElement("dices:nshans"); root.setAttribute("xmlns:dices", "http://www.hans.com");
Element item = doc.createElement("dices:result"); item.appendChild(doc.createTextNode("value")); root.appendChild(item);
doc.appendChild( root );
Next I want to do is transform the output with Xalan to Html in this way:
TransformerFactory tFactory = TransformerFactory.newInstance(); StreamSource mysource = new StreamSource(new File("F:\\foo.xsl")); Transformer transformer = tFactory.newTransformer(mysource);
DOMSource source = new DOMSource(); source.setNode(objdoc);
StreamResult result = new StreamResult(); result.setWriter(out);
transformer.transform(source, result);
The problem is that this outputs nothing.
When I parse a xml-file or a string with Xerces, this code works well with the above used Xsl-stylesheet, but when I want to pass the by Xerces made DOM Document nothing happens.
Is this a problem with the Document that Xerces makes or am I doing something wrong with the Xalan parse (DOMSource())?
Any help will be appreciated, Hans _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]