View Single Post
 
Old March 30th, 2006, 02:17 PM
asap asap is offline
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                DocumentBuilder builder = factory.newDocumentBuilder();
                File temp=new File("as.xml");
                Document doc = builder.parse(temp);
                TransformerFactory tFactory =
                    TransformerFactory.newInstance();
                    Transformer transformer =
                    tFactory.newTransformer(
                    new StreamSource("check.xsl"));

                   transformer.setParameter("contents",doc);

                    transformer.transform(
                    new StreamSource("temp.xml"),
                    new StreamResult(new FileOutputStream(
                    "testasd.xml")));
i am using w3c dom object and xsl code is in the previous posting.
Gettting error as--
Invalid conversion from 'org.apache.xerces.dom.DeferredDocumentImpl' to 'node-set'.'

Please help me in finding the solution.My objective is to pass DOM as parameter to XSL.I am using jdk 1.4

Let me know if you need any other details.