Transform of a DOM document to a file results in abstractmethoderror

               PrintWriter printWriter = new PrintWriter(fileWriter);
               TransformerFactory transformerFactory = TransformerFactory
                         .newInstance();
               Transformer transformer = transformerFactory.newTransformer();
               DOMSource source = new DOMSource(document);
               Result result = new StreamResult(printWriter);
               transformer.transform(source, result);
               printWriter.close();This results in:
Exception in thread "main" java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.getXmlStandalone()Z
     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.setDocumentInfo(Unknown Source)
     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
     at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(Unknown Source)
     at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
     at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
     at be.dolmen.CostApplication.service.impl.XMLReport.writeXMLForMonth(XMLReport.java:165)
     at be.dolmen.CostApplication.service.impl.XMLDataImpl.checkPreviousXML(XMLDataImpl.java:116)
     at be.dolmen.CostApplication.service.impl.XMLDataImpl.<init>(XMLDataImpl.java:75)
     at be.dolmen.CostApplication.main.MainServer.xmlOutput(MainServer.java:177)
     at be.dolmen.CostApplication.main.MainServer.main(MainServer.java:123)The strange thing is that this:
               TransformerFactory tranFact = TransformerFactory.newInstance();
               Transformer transfor = tranFact.newTransformer(xslSource);
               // HTML file
               FileWriter fileWriterHtml = new FileWriter(homePathHtml
                         + File.separator + year + month + File.separator
                         + employee.getEmpid() + ".html");
               PrintWriter printWriterHtml = new PrintWriter(fileWriterHtml);
               Result dest = new StreamResult(printWriterHtml);
               // TRANSFORM
               transfor.transform(source, dest);works! So I give an XSLSource in the TransFormer and I'm using THE SAME document. What am I doing wrong? I just want to print out the DOM XML file ... :-(

Hi Karan,
JAXP is designed with a pluggability layer, which means that users are free to choose or move to any implementation they prefer. The mechanism JAXP uses to find a particular implementation looks like this, using DocumentBuilderFactory as an example:
1. The value of a system property javax.xml.parsers.DocumentBuilderFactory
2. The contents of the file $JAVA_HOME/lib/jaxp.properties
3. The Jar Service Provider discovery mechanism specified in the Jar File Specification. A jar file can have a resource such as META-INF/services/javax.xml.parsers.DocumentBuilderFactory containing the name of the concrete class to instantiate.
4. The fallback platform default implementation.
The JDK comes with a Sun implementation (check out jaxp.dev.java.net for details), that is, jaxp 1.3 in JDK5 and jaxp 1.4 in JDK6. So if not specified, JAXP falls back to these default implementation.
In your case, because you have the Xerces 2.0.2 jar file on the classpath, the factory will find the Xerces 2.0.2 implementation and use it. The result is that the document was created using Xerces 2.0.2 which, as you noticed, is not compatible with the default XSLT implementation in the JDK. So to answer your question, the transformer was using the java 1.6 implementation. It's the document that was created using the Xerces 2.0.2 (in my case) implementation.
To solve the problem, you may remove Xerces 2.0.2 from the classpath if there's no other dependencies. Or force the document to be created using JDK default in this part of the code.

Similar Messages

  • From org.w3c.dom.Document to XML file

    Good morning to all! (morning here, in Barcelona).
    I have a problem and I don't know how to look for a solution (which google query to do, which class to study in the java api...).
    I parse a XML file into a Document with DOM, then make some modifications in its nodes... but how do I transform this modified information into a new XML file? is there any "toString" method for all the XML tree represented by the Document?
    thanks a lot!

    Output the DOM document with a Transformer
    TransformerFactory tFactory =
               TransformerFactory.newInstance();
                Transformer transformer = tFactory.newTransformer();
                DOMSource source = new DOMSource(document);
                StreamResult result = new StreamResult(new File("C:/output/output.xml"));
                transformer.transform(source, result);

  • Org.w3c.dom.Document as XPath evaluation result

    Hi all!
    I'm trying to filter a XML file... someting like getting
    <ROOT>
    <A></A>
    </ROOT>
    from...
    <ROOT>
    <A></A>
    <B></B>
    <C></C>
    </ROOT>
    so, I create a Document from a parsed XML file and evaluate it using a XPath expression like "//A".
    My problem is that the given result is a NodeList, and I'd like to keep the Document Object instead. Is there anyway of doing this?
    Can I build a new Document from the nodeList or something like this?
    Thanks in advance!

    The results will be a list of nodes from the document - you don't lose the document any more than foo.getClass() loses whatever object foo was. If you want a different document with copies of the nodes in under a 'ROOT" element, copy the nodes procedurally, or use XSLT. If you don't want to keep the original document, you could also remove any elements not in the nodelist (or having descendents in the nodelist) from it, but that would be far more compilicated.
    Pete

  • How i can store a DOM Tree to XML file

    I want to insert a xml documet into another another xml document and then store it.
    for this i have parsed a xml document using com.sun.xml.parser and got its domtree in document doc1 by builder.getDocument(). After that i parsed another xml document and got it's domtree in document doc2 by builder.getDocument().
    now i created a Document type doc . I create dom tree in doc that contains all the nodes of doc1 and insert the doc2 at a position . If i m printing this doc i got the required document. Now i want to store this doc into a xml file. so i paas thid doc and filename in which i want to store it into a function
    public static void writeXmlToFile(String filename, Document document)
    try
                   // Prepare the DOM document for writing
         Source source = new DOMSource(document);
         // Prepare the output file
         File file = new File(filename);
         Result result = new StreamResult(file);
    // Write the DOM document to the file
         // Get Transformer
         Transformer xformer = TransformerFactory.newInstance().newTransformer();
              // Write to a file
         xformer.transform(source, result);
    catch (TransformerConfigurationException e)
         System.out.println("TransformerConfigurationException: " + e);
    catch (TransformerException e)
         System.out.println("TransformerException: " + e);
    but i m getting following error
    Exception in thread "main" java.lang.AbstractMethodError: com.sun.xml.tree.ElementNode.getNamespacesURI()Ljava/lang/String;
    at com.sun.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
    at com.sun.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
    at com.sun.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
    at com.sun.apache.xalan.internal.xsltc.trax.TranformerImpl.transformIdentity(Unknown Source)
    at com.sun.apache.xalan.internal.xsltc.trax.TranformerImpl.transformIdentity(Unknown Source)
    at com.sun.apache.xalan.internal.xsltc.trax.TranformerImpl.transformIdentity(Unknown Source)

    thanks for the reply
    i m able to do my job using
    import javax.xml.parsers.*;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder1 = factory.newDocumentBuilder();
         doc = builder1.parse(uri);
    when i want to covert this doc into an xml file by passing this doc in the function below then it is ok..
    public static void writeXmlToFile(String filename, Document document)
    try
    // Prepare the DOM document for writing
    Source source = new DOMSource(document);
    // Prepare the output file
    File file = new File(filename);
    Result result = new StreamResult(file);
    // Write the DOM document to the file
    // Get Transformer
    Transformer xformer = TransformerFactory.newInstance().newTransformer();
    // Write to a file
    xformer.transform(source, result);
    catch (TransformerConfigurationException e)
    System.out.println("TransformerConfigurationException: " + e);
    catch (TransformerException e)
    System.out.println("TransformerException: " + e);
    but i want to use com.sun.xml.parser like
    import com.sun.xml.parser.*;
    import com.sun.xml.tree.XmlDocumentBuilder;
    XmlDocumentBuilder builder = new XmlDocumentBuilder();
    Parser parser = new com.sun.xml.parser.Parser();
    parser.setDocumentHandler(builder);
    builder.setParser(parser);
    builder.setDisableNamespaces(false);
    parser.parse(uri);
    doc = builder.getDocument();
    when i m trying to store this doc into an xml file by passing this doc into funtion writeXmlToFile( filename, doc) then the errors occur (that i hav told in the first post)
    plz help..

  • Modifying a DOM document.

    i have a 100 MB file...where I am suppose to change a node value to null..
    i am using simple dom parser to achieve this task and it is working fine...
    but i need to pass
    -server -Xms 1G -Xmg 1G option to the java compiler and height is...it is taking 5 hours to complete updating the file.
    there are around 20000 records in my xml file.
    here is the code
    import java.io.File;
    import java.io.IOException;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Element;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    public class ChangeNodevalue {
         public static void main(String [] args) {
              Document document = null;
             DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
             factory.setValidating(false);
             factory.setNamespaceAware(false);
             try {
                  DocumentBuilder builder = factory.newDocumentBuilder();
                    document = builder.parse( new File("d:/samples/myprogs/valuechange.xml"));
                  replace(document, "PostalAddress", "CityNm");
                  DOMSource source = new DOMSource(document);
                // Prepare the output file
                 File file = new File("D:/samples/myprogs/valuechange1.xml");
                 StreamResult result = new StreamResult(file);
                 // Write the DOM document to the file
                 Transformer xformer = TransformerFactory.newInstance().newTransformer();
                 System.out.println("Wrote to new file");
                 xformer.transform(source, result);
             catch (SAXParseException spe) {
               spe.printStackTrace();
             catch (SAXException sxe) {
               sxe.printStackTrace();
             catch (ParserConfigurationException pce) {
               pce.printStackTrace();
             catch (IOException ioe) {
               ioe.printStackTrace();
            catch(TransformerConfigurationException tce) {
                 tce.printStackTrace();
            catch(TransformerException te) {
                 te.printStackTrace();
    public static void replace(Document doc, String tag, String sub_tag){ 
                Element child = null;
                NodeList matches = doc.getElementsByTagName(tag);
                for (int cd = 0; cd < matches.getLength(); cd++) {
                          Element tag1 = (Element)matches.item(cd);
                          NodeList children = tag1.getChildNodes();
                          for (int i = 0; i < children.getLength(); i++) {
                                 if ((children.item(i)).getNodeName().equals(sub_tag)) {
                                 System.out.println((children.item(i)).getNodeName());
                                 child = (Element)children.item(i);
                                 if (child != null) {
                                          System.out.println(child.getFirstChild().getNodeValue());
                                     child.getFirstChild().setNodeValue("");
    }will use of JAXP / some other parser will do any good....any inputs???
    thank you..
    chintan.

    I don't believe the Xerces parser can be configured to leave entity references as is if the entity reference is located in an attribute value. I think you might have more luck if the entity reference is inside an element.

  • Dom , where goes this file created??

    class NewClass1
    public static void main(String[] args)
    try{
    //Create instance of DocumentBuilderFactory
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    //Get the DocumentBuilder
    DocumentBuilder docBuilder = factory.newDocumentBuilder();
    //Create blank DOM Document
    //where this documents goes ??? can't find it
    Document doc = docBuilder.newDocument();
    //create the root element
    Element root = doc.createElement("root");
    //all it to the xml tree
    doc.appendChild(root);
    //create a comment
    Comment comment = doc.createComment("This is comment");
    //add in the root element
    root.appendChild(comment);

    I forgot....
    If you want to write the document to file explicitly do it - for example:
    import java.io.File;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Result;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Comment;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    public class WriteXMLFile
         public static void main(String args []){
              try{
                   //Create instance of DocumentBuilderFactory
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   //Get the DocumentBuilder
                   DocumentBuilder docBuilder = factory.newDocumentBuilder();
                   //Create blank DOM Document
                   //where this documents goes ??? can't find it
                   Document doc = docBuilder.newDocument();
                   //create the root element
                   Element root = doc.createElement("root");
                   //all it to the xml tree
                   doc.appendChild(root);
                   //create a comment
                   Comment comment = doc.createComment("This is comment");
                   //add in the root element
                   root.appendChild(comment);
                  try {
                     // Prepare the DOM document for writing
                     Source src = new DOMSource(doc);
                     // Prepare the output file
                     File file = new File("myDocument.xml");
                     Result result = new StreamResult(file);
                     // Write the DOM document to the file
                     Transformer xformer = TransformerFactory.newInstance().newTransformer();
                     xformer.transform(src, result);
                 } catch (TransformerConfigurationException e) {
                 } catch (TransformerException e) {
              catch (Exception e) {
                   // TODO: handle exception
    }     

  • String to org.w3c.dom.Document conversion problem

    Hi all
    I am using JDK 5 and am having scenario to convert String to w3c.Document object , by the way of finding solution i got a code snippet in sun forum
    final String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><DATA>sample</DATA>"; // xml to convert
    final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    final DocumentBuilder builder = factory.newDocumentBuilder();
    final Document document = builder.parse(new InputSource(new StringReader(xml)));
    System.out.println(document);
    But when i try to execute this code , am gettng output as null. , i dont know why this code behaving like that , can you please help me to solve the problem?
    Thanks
    Prabu.P

    imprabu wrote:
    I am using JDK 5 and am having scenario to convert String to w3c.Document object, by the way of finding solution i got a code snippet in sun forum
    System.out.println(document);
    Hi Prabu,
    This is not the way you can print a DOM Document. You can do it using Transformer:
    String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><DATA>sample</DATA>"; // xml to convert
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(new InputSource(new StringReader(xml)));
    //Wong Way of printing a DOM Document. this equal to Object.toString(), Which is of no use for you.
    System.out.println(document); // It will just print: [#document: null]
    // Using Transformer to print DOM Document
    Transformer transformer = TransformerFactory.newInstance().newTransformer();
    Source source = new DOMSource(document);
    Result output = new StreamResult(System.out);
    transformer.transform(source, output); // This will print: <?xml version="1.0" encoding="UTF-8"?><DATA>sample</DATA>*Cheers,
    typurohit* (Tejas Purohit)

  • Save org.w3c.dom.Document to File

    Hi all,
    I can save org.jdom.Document to a file but I don't know how do it with org.w3c.dom.Document.
    My code Java can convert org.w3c.dom.Document to org.jdom.Document but I want to save org.w3c.dom.Document direct.
    thanks a lot
    best regards
    dsea

    As an xml file?
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPXSLT4.html

  • FAST transform mechanism from .dbxml.XmlDocument to .w3c.dom.Document

    Hi,
    I'm looking for a FAST transform mechanism, converting com.sleepycat.dbxml.XmlDocument (retrieved from container) to org.w3c.dom.Document. Right now, i do that like this:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder;
    try {
    builder = factory.newDocumentBuilder();
    } catch (ParserConfigurationException e1) {
    return null;
    //xc = XmlContainer
    org.w3c.dom.Document doc = builder.parse(xc.getDocument("theDoc.xml").getContentAsInputStream());
    This works just fine. But the code seems to be slow... After only 1200 requests/s on this code, the container crashes. Is there any faster mechanism retrieving and converting whole documents?
    Thanks.
    P.S.
    EnvironmentConfig has set the following options:
    setInitializeLocking(true);
    setInitializeCache(true);
    setAllowCreate(true);

    no one at all?

  • How to convert DOM Tree in XML File

    Hi there,
    I am successful to build a DOM tree in memory where i am adding elements. Now after all this i want to make a XML file of that DOM representation. Now, i am confused with my code that how to transfer DOM structure to xml file ? A small code is attached herewith ?
    doc = db.newDocument();
                   doc.normalizeDocument();
                   doc.setXmlVersion("1.0");
                   doc.createComment("Created By: Sachin Kulkarni");
                   Element rn = doc.createElement("RootNode");
                   Element n1 = doc.createElement("A1");
                   ((Node)n1).setNodeValue("Element A1");
                   Element n11 = doc.createElement("A11");
                   ((Node)n11).setNodeValue("Element A11");
                   Element n12 = doc.createElement("A12");
                   ((Node)n12).setNodeValue("Element A12");
                   ((Node)n1).appendChild( ((Node)n11) );
                   ((Node)n1).appendChild( ((Node)n12) );
                   Element n2 = doc.createElement("A2");
                   ((Node)n2).setNodeValue("Element A2");
                   Element n3 = doc.createElement("A3");
                   ((Node)n3).setNodeValue("Element A3");
                   ((Node)rn).appendChild( ((Node)n1) );
                   ((Node)rn).appendChild( ((Node)n2) );
                   ((Node)rn).appendChild( ((Node)n3) );
    //creating the xml file
                   Source source = new DOMSource((Element) doc.getElementsByTagName("RootNode").item(0));
                   StringWriter out = new StringWriter();
                   StreamResult result = new StreamResult(out);
                   Transformer transformer = TransformerFactory.newInstance().newTransformer();
                   transformer.setOutputProperty("encoding", "iso-8859-1");
                   transformer.setOutputProperty("indent", "yes");
                   //transformer.setOutputProperty("test.xml","1");
                   //transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
                   transformer.transform(source,result);
                   result.getWriter().toString();
    ==================
    Is it any problem with the implementation ? How to use fileoutputstream with this ?

    I have done like this:
    DocumentBuilderFactory docBuildFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = docBuildFactory.newDocumentBuilder();
    Document doc = builder.newDocument();
    Element root = (Element)doc.createElement("Root");
    doc.appendChild(root);
    Element address = (Element)doc.createElement("Address");
    address.appendChild((Element)doc.createElement("Street"));
    address.appendChild((Element)doc.createElement("PostCode"));
    address.appendChild((Element)doc.createElement("Town"));
    Element country = (Element)doc.createElement("Country");
    country.setAttribute("type","EU");
    Text cname = doc.createTextNode("Spain");
    country.appendChild(cname);
    address.appendChild(country);
    root.appendChild(address);
    TransformerFactory tranFactory = TransformerFactory.newInstance();
    Transformer aTransformer = tranFactory.newTransformer();
    aTransformer.setOutputProperty(OutputKeys.INDENT, "yes");
    Source src = new DOMSource(doc);
    Result dest = new StreamResult(new FileOutputStream(new File("test.xml")));
    aTransformer.transform(src, dest);

  • How to SAVE a updated XML DOM Data to the file?

    Hi
    I am able to load an XML file into a XML DOM object using JAVA (xerces). I have update the required data in the DOM.
    But I am NOT able to save back the data to the physical file.
    Will appreciate if you can help me ASAP.

    Hi Krishar,
    Check out the jaxp new release on java.sun.com. This api has classes and methods to help you do the same.
    sample code:
         try
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              java.net.URL url = this.getClass().getResource(XML_FILE);
              java.io.File thsFile = new java.io.File(url.getFile());
              DocumentBuilder builder = factory.newDocumentBuilder();
              TransformerFactory tFactory = TransformerFactory.newInstance();
              Transformer transformer = tFactory.newTransformer();
              document = builder.parse(thsFile);
    //You can do any modification to the document here
              DOMSource source = new DOMSource(document);
              StreamResult result = new StreamResult(thsFile);
              transformer.transform(source, result);
         catch (TransformerConfigurationException tce)
              System.out.println("\n** Transformer Factory error");
              System.out.println(" " + tce.getMessage());
              Throwable x = tce;
              if (tce.getException() != null)
                   x = tce.getException();
              x.printStackTrace();
         catch (TransformerException te)
              System.out.println("\n** Transformation error in add:");
              System.out.println(" " + te.getMessage());
              Throwable x = te;
              if (te.getException() != null)
                   x = te.getException();
              x.printStackTrace();
         catch (SAXException sxe)
              System.out.println("sax exp" + sxe.getMessage());
         catch (Exception ex)
              System.out.println("exc exp" + ex);
              ex.printStackTrace();
    Hope this will help you XML_FILE is constant representing the path of the file. It should be in classpath. The program essentially parsing a xml file and creating dom document and then writing it back to the same file. you can do any modifications/write to other file etc...
    Think this will suffice your requirement
    bye
    take care
    Hi
    I am able to load an XML file into a XML DOM object
    using JAVA (xerces). I have update the required data
    in the DOM.
    But I am NOT able to save back the data to the
    physical file.
    Will appreciate if you can help me ASAP.

  • Org.w3c.dom.Document -- text

    Hello.
    I have parsed org.w3c.dom.Document.
    Is here a library that can print it to a xml file?
    Secondly I wish print it as .html, so output should a bit differ from standard .xml output.

    Yes. In both cases you use a Transformer. (That's in package javax.xml.transform.) You get it via one of the TransformerFactory.newTransformer() methods. To do a straight copy you use the method with no parameters, which does an "identity transformation". To transform to HTML, you use the method with an XSLT for its parameter.

  • Save org.w3c.dom.Document to XMLFile (cont.): NoSuchMethodError

    Hi all,
    I have just download the newest package JavaTM API for Java API for XML Processing 1.2 (URL: http://jsecom16d.sun.com/ECom/EComTicketServlet/BEGINjsecom16d.sun.com-65eb%3A3e840f19%3A4aa0f3743cc56218/76867611/195076095/1/209642/209642/76867611-195076095/xmzZndezB81HYlfGYdXI/westCoastFSEND/ESD2/commsrc/JAXP/1.2/jaxp-1_2_0-scsl.zip) and builded it with Apache Ant 1.4.1 => I have 6 jars: - dom.jar - sax.jar - jaxp-api.jar - xercesImpl.jar - xalan.jar - xsltc.jar
    But when I follows the guide in tutorial Writing Out a DOM as an XML File (URL http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPXSLT4.html:)
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer();
    DOMSource source = new DOMSource(m_Document);
    StreamResult result = new StreamResult(new File(fileName));
    transformer.transform(source, result);
    I hit an error:
    java.lang.NoSuchMethodError: org.w3c.dom.Node: method getNamespaceURI()Ljava/lang/String; not found at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:478)
         at vn.vnteam.letter.XMLWriter.save(XMLWriter.java:166)
         at vn.vnteam.letter.Templet.main(Templet.java:254)
    Exception in thread "main"
    I see in file org.w3c.dom.Node.class there is function String getNamespaceURI();
    but there is no such function in org.apache.xalan.transformer.TransformerIdentityImpl.
    now what I have to do, please?
    Thanks a lot
    best regards
    Hai

    That method is supported in Document Object Model (DOM) Level 2 only.

  • Howto transform a Sales Order (idoc) into xml file and download it?

    I need to tranform a Sales order into an xml file such that I could download the file onto my disk. I try to transform an IDOC.
    I do the following from an example and I get an xml document on screen but I do get get any file downloaded:
    DATA: document TYPE REF TO if_ixml_document.
      document = g_ixml->create_document( ).
      DATA: ostream TYPE REF TO if_ixml_ostream.
    ostream = g_stream_factory->create_ostream_uri(
      system_id = 'file://C:\test.xml' ).
      DATA: renderer TYPE REF TO if_ixml_renderer, rc TYPE i.
    renderer = g_ixml->create_renderer( ostream  = ostream
                                          document = document ).
      rc = renderer->render( ).
      document->render( ostream = ostream  recursive = ' ').
    Is there something else I should do? Is there another approach for transforming a sales order to an xml file.
    The R/3 4.6 system is used.
    Thank you
    -eglese-

    Hi Eglese,
    Another option could be to use XML port configured for the IDOC and use the XML files generated be extracted from Web Dynpro using a file download UI element.
    Thanks and Regards,
    Sam Mathew

  • How do I convert a DOM document to a CLOB?

    I have a JDOM document that I convert to a DOM document. I have java code (that works) to take an XML file from harddrive and stream into temporary CLOB and convert to XMLType. Now I need to take the DOM document and convert to a CLOB to get it into the database as an XMLType. Just missing the middle piece: DOM -> CLOB. I do not need to parse it - I just want the simpliest way to do the conversion. The JDOM to DOM was one statement. Could it be just as simple to go from DOM to CLOB? Please enlighten me... :-)

    Hello,
    Yes, serializing the data is a good way. But you'll get a very long line in order to having a tabbed document.

Maybe you are looking for

  • Fieldpoint output to Word Template

    All: Need some help. I currently have a VI where 3 4-20 mA signals are being read from CFP 110 AI card into a CFP 180 via fieldpoint express and then converted using a slope equation into a number. THis number gets a graphical output, a waveform outp

  • Issue containing a rogue AP

    My WLC has detected (via 15 detecting radios) a rogue AP with a client connected to it. The infrastructure has not determined that the AP is plugged into the local network. I'm trying to contain the AP - I classify it as "Malicious", update its statu

  • Installing xmldb

    Hi, After upgrading from 901 to 9201 i noted that the catqm script is commented out in catproc. However you need this script to create the dbms_xmlschema package. I just executed the script manually. Is this ok or are there still other things to run

  • How to delete locked files on Preview app?

    when i right click on the preview app on my dock, a list of files i have previewed appears. how do i delete the list so there is nothing there?

  • "Media offline" - when it's not, and presets missing!

    I'm working on a project in PP CS5 (Mac) which has footage from a Canon DSLR and a AVCHD camera. I opened it and all of the AVCHD footage is shown as "media offline" even though the .MTS files are all in the same place as they were when I was previou