XMLDocument print (no indent)

Hallo,
I need to print out the content of an XMLDocument in a String in a "flat" mode (without spaces or CRLF between tags).
The method print() in XMLDocument seems the simplest way to print out... but it produces a formatted output (with spaces or CRLF that indents it).
My need is to have a compact representation.
Is there a way in Java XDK to produce that kind of output, without let me write any code to scan the whole string and filter it programmatically ?
Thanks.
G.Grimoldi
[email protected]

edhenninger wrote:
but I believe most clients wouldn't want to take the time to set that up...and they use way more than one style for headlines.
You wouldn't have to have the condition be a headline style, it could simply be paragraphs after paragraphs with a designated number of characters, words or lines. The version below would set the paragraph after any paragraph with one line to the no indent style. You would obviously use this early in the styling process and run it before you start applying styles to the document:
set searchParas to {}
tell application "Adobe InDesign CS3"
activate
set myDoc to active document
set myNoIndent to paragraph style "Text No Indent" of myDoc
tell myDoc
set searchParas to object reference of every paragraph of every story
repeat with thePara in searchParas
if (count of lines of thePara) is less than 2 then
try
set applied paragraph style of paragraph after thePara to myNoIndent
end try
end if
end repeat
end tell
end tell

Similar Messages

  • Output non-indented XML with XMLDocument.print()

    Hi,
    Using Oracle XML Parser 2 i am dynamically contructing a XMLDocument via calls to createElement() and createTextNode().
    See the code below for an example.
    When Xml_doc.print(System.out) is called an indented XML document is printed out to the console.
    Is there anyway to get a version which is not indented or beautified i.e there is not whitespace between elements.
    I thought that XMLOutputStream.setOutputStyle(COMPACT) might work - but am not sure how to use it.
    Thanks in advance
    Kevin
    OUTPUT (indented!):
    ~~~~~~~
    <?xml version = '1.0'?>
    <main>
    <sub1>sub1text</sub1>
    <sub2>sub2text</sub2>
    </main>
    // CODE
    ~~~~~~~~
    import org.w3c.dom.*;
    import org.w3c.dom.Node;
    import oracle.xml.parser.v2.*;
    public class DOMTest
    static public void main(String[] argv)
    try
    XMLDocument Xml_doc = new XMLDocument();
    Xml_doc.setVersion("1.0");
    // document Element node
    Element Xml_dad = Xml_doc.createElement("main");
    Xml_doc.appendChild(Xml_dad);
    // Add child nodes
    addNode(Xml_doc, Xml_dad , "sub1", "sub1text");
    addNode(Xml_doc, Xml_dad , "sub2", "sub2text");
    Xml_doc.print(System.out);
    //XMLOutputStream xos = new XMLOutputStream(System.out);
    //Xml_doc.print(xos);
    catch (Exception e)
    System.out.println(e.toString());
    public static void addNode(XMLDocument doc, Element parent, String tag, String value)
    Element child = doc.createElement(tag);
    parent.appendChild(child);
    Text txtChild = null;
    if (value!=null)
    txtChild = doc.createTextNode(value);
    else
    txtChild = doc.createTextNode("");
    child.appendChild(txtChild);
    null

    Currently there is no direct way of removing the indentations. Enhancement request is made to support this.
    null

  • UTF-8 Chacters Extracting from Java XMLDocument - Revised so example works

    I'm working on a string XML document that has utf-8 charcters within the
    text nodes, e.g. &;lsquo; &;rsquo; In the original string these are ok, and when represented through to a web page appear correctly as a &lsquo; &rsquo;
    quotes.
    <p>Example XML Document :- </p>
    <p><?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?><br>
    <!DOCTYPE art [<br>
    <!ELEMENT art (#PCDATA | b)*><br>
    <!ELEMENT b (#PCDATA)><br>
    <!ENTITY lsquo &quot;&;#x2018;&quot;><br>
    <!ENTITY rsquo &quot;&;#x2019;&quot;><br>
    ]><br>
    <art><br>
    This ZZZ&;lsquo;La Sapienza&;rsquo; di Roma <b>some
    Text</b><br>
    ZZZZ&;lsquo;La Sapienza&;rsquo; 00185 ZZZZ<br>
    </art></p>
    <p>However if i use the oracle.xml.parser.v2.DOMParser to create a
    oracle.xml.parser.v2.XMLDocument from the String, I cannot get the text from the
    nodes correctly, using oracle.xml.parser.v2.XMLDocument.print(System.out) or
    through the org.w3c.dom.Node.getNodeValue().</p>
    <p>I need to Extract the <art> tags data,  the resulting text must be
    :-</p>
    <p>    <i>This ZZZ&;lsquo;La Sapienza&;rsquo; di Roma <b>some Text</b>ZZZZ&;lsquo;La Sapienza&;rsquo; 00185
    ZZZZ</i></p>
    <p>AND NOT :-</p>
    <p>      This ZZZbLa Sapienzab
    di Roma <b>some Text</b>ZZZZbLa
    Sapienzab 00185 ZZZZ</p>
    <p>AND NOT :-</p>
    <p>      <i>This ZZZ&lsquo;La Sapienza&rsquo; di Roma <b>some Text</b>ZZZZ&lsquo;La Sapienza&rsquo; 00185
    ZZZZ</i></p>
    <p>Example Program,  Just copy &; Paste into Jdeveloper</p>
    <p>Project Libraries Required  :- Oracle XML Parser 2.0 ( D:\jdev323\lib\xmlparserv2.jar
    )</p>
    <p>COPY FROM HERE >></p>
    <p> import java.io.IOException;<br>
    import org.w3c.dom.Node;<br>
    import org.xml.sax.SAXException;<br>
    import oracle.xml.parser.v2.XMLDocument;<br>
    import oracle.xml.parser.v2.DOMParser;<br>
    import oracle.xml.parser.v2.XSLException;<br>
    import org.xml.sax.InputSource;<br>
    import java.io.StringReader;<br>
    <br>
    public class Class3 extends Object {<br>
    <br>
    public Class3 () throws IOException , SAXException, XSLException{<br>
    String docText =<br>
    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +"\n"+<br>
    "<!DOCTYPE art [" + "\n"+<br>
    "<!ELEMENT art (#PCDATA | b)*>" +"\n"+<br>
    "<!ELEMENT b (#PCDATA)>" +"\n"+<br>
    "<!ENTITY lsquo \"&;#x2018;\">" +"\n"+<br>
    "<!ENTITY rsquo \"&;#x2019;\">" +"\n"+<br>
    "]>" +"\n"+<br>
    "<art>" +"\n"+<br>
    " This ZZZ&;lsquo;La Sapienza&;rsquo; di Roma <b>some Text</b>"+"\n"+<br>
    " ZZZZ&;lsquo;La Sapienza&;rsquo; 00185 ZZZZ" +"\n"+<br>
    "</art>" + "\n";<br>
    System.out.println("----------------------------------------");<br>
    System.out.println("Original String Value ");<br>
    System.out.println("----------------------------------------");<br>
    System.out.println(docText);<br>
    System.out.println("----------------------------------------");<br>
    System.out.println("Value from XMLDocument.Print(Systen.out)");<br>
    System.out.println("----------------------------------------");<br>
    InputSource input = new InputSource(new StringReader(docText));<br>
    DOMParser xp = new DOMParser();<br>
    xp.setValidationMode(false);<br>
    xp.setPreserveWhitespace(false);<br>
    xp.parse (input);<br>
    XMLDocument xMLDocument = (XMLDocument)xp.getDocument();<br>
    xMLDocument.print(System.out );<br>
    <br>
    System.out.println("----------------------------------------");<br>
    System.out.println("Value from Node Walk");<br>
    System.out.println("----------------------------------------");<br>
    Node theNode = xMLDocument.getFirstChild();<br>
    this.walkNode(theNode);<br>
    }<br>
    <br>
    public void showNode (Node inNode) {<br>
    System.out.println(inNode.getNodeName() + " <--> "<br>
    + inNode.getNodeType() + " <--> "<br>
    + inNode.getNodeValue() + " <--> ");<br>
    <br>
    Node kid=inNode.getFirstChild();<br>
    if(kid==null) {<br>
    } else {<br>
    walkNode(kid);<br>
    }<br>
    }<br>
    <br>
    public void walkNode (Node theFirst) {<br>
    while(null!=theFirst){<br>
    showNode(theFirst);<br>
    theFirst=theFirst.getNextSibling();<br>
    }<br>
    }<br>
    <br>
    public static void main(String[] args) throws Exception {<br>
    Class3 class3 = new Class3();<br>
    <br>
    }<br>
    }<br>
    <<  END HERE</p>
    null

    import java.io.IOException;
    import org.w3c.dom.Node;
    import org.xml.sax.SAXException;
    import oracle.xml.parser.v2.XMLDocument;
    import oracle.xml.parser.v2.DOMParser;
    import oracle.xml.parser.v2.XSLException;
    import org.xml.sax.InputSource;
    import java.io.StringReader;
    public class Class3 extends Object {
    public Class3 () throws IOException , SAXException, XSLException{
    String docText =
    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +"\n"+
    "<!DOCTYPE art [" + "\n"+
    "<!ELEMENT art (#PCDATA | b)*>" +"\n"+
    "<!ELEMENT b (#PCDATA)>" +"\n"+
    "<!ENTITY lsquo \"&#x2018;\">" +"\n"+
    "<!ENTITY rsquo \"&#x2019;\">" +"\n"+
    "]>" +"\n"+
    "<art>" +"\n"+
    " This ZZZ&lsquo;La Sapienza&rsquo; di Roma <b>some Text</b>"+"\n"+
    " ZZZZ&lsquo;La Sapienza&rsquo; 00185 ZZZZ" +"\n"+
    "</art>" + "\n";
    System.out.println("----------------------------------------");
    System.out.println("Original String Value ");
    System.out.println("----------------------------------------");
    System.out.println(docText);
    System.out.println("----------------------------------------");
    System.out.println("Value from XMLDocument.Print(Systen.out)");
    System.out.println("----------------------------------------");
    InputSource input = new InputSource(new StringReader(docText));
    DOMParser xp = new DOMParser();
    xp.setValidationMode(false);
    xp.setPreserveWhitespace(false);
    xp.parse (input);
    XMLDocument xMLDocument = (XMLDocument)xp.getDocument();
    xMLDocument.print(System.out);
    System.out.println("----------------------------------------");
    System.out.println("Value from Node Walk");
    System.out.println("----------------------------------------");
    Node theNode = xMLDocument.getFirstChild();
    this.walkNode(theNode);
    public void showNode (Node inNode) {
    System.out.println(inNode.getNodeName() + " <--> "
    + inNode.getNodeType() + " <--> "
    + inNode.getNodeValue() + " <--> ");
    Node kid=inNode.getFirstChild();
    if(kid==null) {
    } else {
    walkNode(kid);
    public void walkNode (Node theFirst) {
    while(null!=theFirst){
    showNode(theFirst);
    theFirst=theFirst.getNextSibling();
    public static void main(String[] args) throws Exception {
    Class3 class3 = new Class3();
    }

  • UTF-8 Chacters Extracting from XMLDocument

    I'm working on translating a string document that has utf-8 charcters within the text nodes, e.g. &lsquo &rsquo. In the original string these are 100% ok, and when represented through to a web page appear correctly as a left single and righ single quote.
    However if i use the oracle.xml.parser.v2.DOMParser to create a oracle.xml.parser.v2.XMLDocument from the String, I cannot get the text from the nodes correctly, using oracle.xml.parser.v2.XMLDocument.print(System.out)
    String xdoc =
    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "\n" +
    "<!DOCTYPE art SYSTEM \"simple.dtd\">" + "\n" +
    "<art>ThisZZZ&lsquo;La Sapienza&rsquo; di Roma <b>stuff</b> ZZZZ&lsquo;La Sapienza&rsquo; di Roma. P.le Al 00185 ZZZZ" +
    "</art>" + "\n";
    XMLDocument xMLDocument = XMLHelper.parse(xdoc,masterBaseStyleUrl);
    xMLDocument.print(System.out);
    Results in
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <!DOCTYPE art SYSTEM "simple.dtd">
    <art>ThisZZZbLa Sapienzab di Roma <b>stuff</b> ZZZZbLa Sapienzab di Roma. P.le Al 00185 </art>
    i've tried, org.w3c.dom.Node.getNodeValue() and others but they all corrupt the output.
    Any help on accessing the original document values through the xmldocument would be great, i.e. the &lsquo; and &rsquo.
    null

    I'm working on translating a string document that has utf-8 charcters within the text nodes, e.g. &lsquo &rsquo. In the original string these are 100% ok, and when represented through to a web page appear correctly as a left single and righ single quote.
    However if i use the oracle.xml.parser.v2.DOMParser to create a oracle.xml.parser.v2.XMLDocument from the String, I cannot get the text from the nodes correctly, using oracle.xml.parser.v2.XMLDocument.print(System.out)
    String xdoc =
    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "\n" +
    "<!DOCTYPE art SYSTEM \"simple.dtd\">" + "\n" +
    "<art>ThisZZZ&lsquo;La Sapienza&rsquo; di Roma <b>stuff</b> ZZZZ&lsquo;La Sapienza&rsquo; di Roma. P.le Al 00185 ZZZZ" +
    "</art>" + "\n";
    XMLDocument xMLDocument = XMLHelper.parse(xdoc,masterBaseStyleUrl);
    xMLDocument.print(System.out);
    Results in
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <!DOCTYPE art SYSTEM "simple.dtd">
    <art>ThisZZZbLa Sapienzab di Roma <b>stuff</b> ZZZZbLa Sapienzab di Roma. P.le Al 00185 </art>
    i've tried, org.w3c.dom.Node.getNodeValue() and others but they all corrupt the output.
    Any help on accessing the original document values through the xmldocument would be great, i.e. the &lsquo; and &rsquo.
    null

  • Paragraph indents disappear

    Indentation of paragraphs was set, document printed properly. Next time I opened it no indents, only blue horizontal line in left margin.  Document now doesn't print with indents, and in inspector tabs are greyed out  Ruler shows only tab marks.  Why?  How do I correct this?

    Blue horizontal lines to the left means you have set the document in Outline mode. To change it go View > Hide Document Outline and you should see the document in normal mode

  • Java.lang.NullPointerException in Parser

    Hi,
    I appreciate any idea that can help me.
    I'm processing a sql sentence that can retrive 10.000 rows with XSU.
    I generate xml files with 1000 rows from the resultset and then I transform this xmls into xml files based of Onix Standard.
    I've nullpointer exception in random way, but I supose that there is a problem when the xml files are transformed.
    There are any limitation for user parser and tranformer. I supose that there is a memory problem with this because the class consume a lot of CPU memory.
    Thank in advance.

    Thank every body.
    I increase -mx stack to 200 but the NullPointerexception followed showed in my screen.
    In that moment I'm running the java program with jdk1.2.2, because Jdeveloper look like very hard.
    Some of random exception are here:
    Java.lang.NullPointerException
    void java.io.OutputStreamWriter.write(char[], int, int)
    void oracle.xml.parser.v2.XMLOutputStream.flush()
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLDocument.print(oracle.xml.parser.v2.PrintDriver)
    void oracle.xml.parser.v2.XMLDocument.print(java.io.OutputStream)
    void onix.IsbnXmlProcessor.main(java.lang.String[])
    Exception in thread main
    Se genero la excepcion al instanciar un Stylesheet
    java.lang.NullPointerException
    java.lang.String java.lang.String.intern()
    java.lang.String oracle.xml.parser.v2.XSLParseString.getQname()
    int oracle.xml.parser.v2.XSLParseString.nextToken()
    oracle.xml.parser.v2.XSLExprBase oracle.xml.parser.v2.XSLNodeSetExpr.parse(oracle.xml.parser.v2.XSLParseString, boolean, boolean)
    oracle.xml.parser.v2.XSLPatternInt oracle.xml.parser.v2.XSLExprBase.createPattern(java.lang.String, oracle.xml.parser.v2.NSResolver)
    void oracle.xml.parser.v2.XSLTemplate.<init>(oracle.xml.parser.v2.XMLElement, oracle.xml.parser.v2.XSLStylesheet, int, int)
    void oracle.xml.parser.v2.XSLStylesheet.updateStylesheet(oracle.xml.parser.v2.XMLDocument, int)
    void oracle.xml.parser.v2.XSLStylesheet.initStylesheet(oracle.xml.parser.v2.XMLDocument, java.net.URL)
    void oracle.xml.parser.v2.XSLStylesheet.<init>(oracle.xml.parser.v2.XMLDocument, java.net.URL)
    void onix.XMLToFile.transform(oracle.xml.parser.v2.XMLDocument, java.lang.String, java.lang.String)
    void onix.IsbnXmlGenerator.main(java.lang.String[])
    Se genero la excepcion al procesarse el xsl
    java.lang.NullPointerException
    void oracle.xml.parser.v2.XSLProcessor.processXSL(oracle.xml.parser.v2.XSLStylesheet, oracle.xml.parser.v2.XMLDocument, java.io.OutputStream)
    void onix.XMLToFile.transform(oracle.xml.parser.v2.XMLDocument, java.lang.String, java.lang.String)
    void onix.IsbnXmlGenerator.main(java.lang.String[])
    Se genero onix_2000.xml
    java.lang.NullPointerException
    void java.lang.Runtime.gc()
    void java.lang.System.gc()
    void onix.IsbnXmlGenerator.main(java.lang.String[])
    Exception in thread main
    java.lang.NullPointerException
    java.lang.String java.lang.StringBuffer.toString()
    void oracle.xml.parser.v2.XMLPrintDriver.printEndTag(oracle.xml.parser.v2.XMLElement, boolean)
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLDocument.print(oracle.xml.parser.v2.PrintDriver)
    void oracle.xml.parser.v2.XMLDocument.print(java.io.OutputStream)
    void onix.IsbnXmlGenerator.setGenerator(java.lang.String)
    void onix.IsbnXmlGenerator.<init>(java.lang.String)
    void onix.IsbnXmlProcessor.main(java.lang.String[])
    java.lang.NullPointerException
    void oracle.xml.parser.v2.XMLPrintDriver.printEndTag(oracle.xml.parser.v2.XMLElement, boolean)
    void oracle.xml.parser.v2.XMLPrintDriver.printEl ement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLPrintDriver.printElement(oracle.xml.parser.v2.XMLElement)
    void oracle.xml.parser.v2.XMLPrintDriver.printChildNodes(oracle.xml.parser.v2.XMLNode)
    void oracle.xml.parser.v2.XMLDocument.print(oracle.xml.parser.v2.PrintDriver)
    void oracle.xml.parser.v2.XMLDocument.print(java.io.OutputStream)
    void onix.IsbnXmlGenerator.setGenerator(java.lang.String)
    void onix.IsbnXmlGenerator.<init>(java.lang.String)
    void onix.IsbnXmlProcessor.main(java.lang.String[])
    Somebody Know how can I use OracleXMLQuery getSAX method....I appreciate an examples.
    null

  • XmlSaveDom unresolved symbol, and special characters in output...

    I have a couple of issues with XmlSaveDom() that I'm hoping someone can help with...
    Firstly, under windows I'm having difficulty locating the library that it lives in. I'm linking to:
    oraxml10.lib (from the 10.1.0.2 XDK, the latest version I can find) and oci.lib (from the 10.2 client)...but getting an unresolved symbol on XMLSaveDom().
    I'm using the XDK because under windows I only have a client install which does not appear to have any of the XML headers or libraries in it. I'm using
    10.1.0.2 because it's the latest version I can find to download from technet.
    Secondly, under Solaris I'm just linking to libclntsh.so from 10.1.0.2 server home, and this resolves XMLSaveDom() ok. However when I use XMLSaveDom() I find unusual special characters in the output periodically:
    ÿ¾Ý <SOME_TAG>some_value</SOME_TAG>
    The strange character sequence is always the same.
    Any help with either of these would be greatly appreciated.

    The DOM is not required to escape the characters, so it is correct that you get the literal ampersand characters when you ask the DOM for a getNodeValue().
    When an XML document is serialized -- using, for example, the XMLDocument.print() method -- it is when this external form of the document is produced that escaping occurs.
    You can always call XMLNode.print() to serialize the value of a node and it's children into a PrintWriter that wraps a StringWriter to get the string equivalent of the properly escaped values.

  • Preserving XML "special" characters in output

    I've got a valid XML document that may contain special characters, such as ampersands. These characters are properly escaped in the document (i.e., + is represented as amp; ). When I parse this document (using either the Java V2 parser or the PL/SQL parser) and then retrieve the values from a DOM using getNodeValue, I get the un-escaped version () and I need the escaped version (+amp;) so that I can store it in a database and load it back into a DOM at a later date.
    What am I missing here? Is there a property on the parser/DOM that I can set so that the characters are not translated on output.
    Thanks
    mark
    Note: I've used + in the above example instead of the ampersand character because of the vagaries of my browser, but the character in the XML document is a proper ampersand!

    The DOM is not required to escape the characters, so it is correct that you get the literal ampersand characters when you ask the DOM for a getNodeValue().
    When an XML document is serialized -- using, for example, the XMLDocument.print() method -- it is when this external form of the document is produced that escaping occurs.
    You can always call XMLNode.print() to serialize the value of a node and it's children into a PrintWriter that wraps a StringWriter to get the string equivalent of the properly escaped values.

  • Attempting to use HTML parser - getAttribute() not preforming as expected.

    How am I mis-using getAttribute()?
    I am expecting (String)a.getAttribute((String)"name") to give me a value other than null in the below example. What am I doing wrong?
    The HTML test source (missing headers/body so yes its not proper)
    <input name="unit_1" size=5 maxsize=5 value="hr">
    <input name="qty_1" size=5 value=4>
    <input name="unit_1" size=5 maxsize=5 value="hr">
    <input name="partnumber_1" size=10 value="Java Work">
    <input name="description_1" size=50 value="Slip shod work at outragous prices">
    <input name="sellprice_1" size=9 value=185.00>
    <input name="discount_1" size=3 value=>
    What I'd like to see is this:
    About to parse test
    Parsing error: invalid.tagattmaxsizeinput? at 39
    Tag start(<html>, 1 attrs)
    Tag start(<head>, 1 attrs)
    Tag end(</head>)
    Tag start(<body>, 1 attrs)
    Tag(<input>, 4 attrs)
    found input
    unit_1
    hr
    Tag(<input>, 3 attrs)
    found input
    qty_1
    4
    Rather than this:
    About to parse test
    Parsing error: invalid.tagattmaxsizeinput? at 39
    Tag start(<html>, 1 attrs)
    Tag start(<head>, 1 attrs)
    Tag end(</head>)
    Tag start(<body>, 1 attrs)
    Tag(<input>, 4 attrs)
    found input
    null
    null
    Tag(<input>, 3 attrs)
    found input
    null
    null
    The code that reads the HTML and give the output looks like this:
    import java.io.*;
    import java.net.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    import javax.swing.text.html.parser.*;
    * This small demo program shows how to use the
    * HTMLEditorKit.Parser and its implementing class
    * ParserDelegator in the Swing system.
    class DataSaved {
    String InputName;
    String InputValue;
    boolean IsHidden;
    public class HtmlParseDemo {
    public static void main(String [] args) {
    DataSaved DataSet[];
    Reader r;
    if (args.length == 0) {
    System.err.println("Usage: java HTMLParseDemo [url | file]");
    System.exit(0);
    String spec = args[0];
    try {
    if (spec.indexOf("://") > 0) {
    URL u = new URL(spec);
    Object content = u.getContent();
    if (content instanceof InputStream) {
    r = new InputStreamReader((InputStream)content);
    else if (content instanceof Reader) {
    r = (Reader)content;
    else {
    throw new Exception("Bad URL content type.");
    else {
    r = new FileReader(spec);
    HTMLEditorKit.Parser parser;
    System.out.println("About to parse " + spec);
    parser = new ParserDelegator();
    parser.parse(r, new HTMLParseLister(), true);
    r.close();
    catch (Exception e) {
    System.err.println("Error: " + e);
    e.printStackTrace(System.err);
    * HTML parsing proceeds by calling a callback for
    * each and every piece of the HTML document. This
    * simple callback class simply prints an indented
    * structural listing of the HTML data.
    class HTMLParseLister extends HTMLEditorKit.ParserCallback
    int indentSize = 0;
    protected void indent() {
    indentSize += 3;
    protected void unIndent() {
    indentSize -= 3; if (indentSize < 0) indentSize = 0;
    protected void pIndent() {
    for(int i = 0; i < indentSize; i++) System.out.print(" ");
    public void handleText(char[] data, int pos) {
    pIndent();
    System.out.println("Text(" + data.length + " chars)");
    public void handleComment(char[] data, int pos) {
    pIndent();
    System.out.println("Comment(" + data.length + " chars)");
    public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos) {
    pIndent();
    System.out.println("Tag start(<" + t.toString() + ">, " +
    a.getAttributeCount() + " attrs)");
    indent();
    public void handleEndTag(HTML.Tag t, int pos) {
    unIndent();
    pIndent();
    System.out.println("Tag end(</" + t.toString() + ">)");
    public void handleSimpleTag(HTML.Tag t, MutableAttributeSet a, int pos) {
    String name;
    String value;
    boolean hidden;
    pIndent();
    System.out.println("Tag(<" + t.toString() + ">, " +
    a.getAttributeCount() + " attrs)");
    if( t==HTML.Tag.INPUT) {
    System.out.println("found input");
    name = (String)a.getAttribute((String)"name");
    value = (String)a.getAttribute((String)"value");
    System.out.println(name);
    System.out.println(value);
    public void handleError(String errorMsg, int pos){
    System.out.println("Parsing error: " + errorMsg + " at " + pos);

    System.out.println( a.getAttribute(HTML.Attribute.NAME) );

  • Validate org.w3c.dom.Element against xsd

    I need to validate a org.w3c.dom.Element against an xsd.
    DOMParser dp = new DOMParser();
    URL xmlurl = new URL("file:\\test.xml");
    XSDBuilder builder = new XSDBuilder();
    URL xsdurl = new URL("file:\\test.xsd");
    XMLSchema schemadoc = (XMLSchema)builder.build(xsdurl);
    dp.setXMLSchema(schemadoc);
    dp.setValidationMode(XMLParser.SCHEMA_LAX_VALIDATION);
    dp.setPreserveWhitespace(true);
    dp.setErrorStream (System.out);
    System.out.println("Parsing "+xmlurl);
    dp.parse(xmlurl);
    This works when my input is an xml file. I cannot get it work against an element. If I convert the element as a string or inputsource it gives the error
    "XML-20220: (Fatal Error) Invalid InputSource.
    java.net.MalformedURLException: no protocol:"
    Any idea how it can be done? I am using jdeveloper 10.1.2
    Thanks
    MM

    Thanks for the reply. I get the following error.
    Exception in thread main
    oracle.xml.parser.v2.XMLDOMException: cannot add a node belonging to a different document
    at oracle.xml.parser.v2.XMLNSNode.checkNodePermissions(XMLNSNode.java:854)
    at oracle.xml.parser.v2.XMLNSNode.appendChild(XMLNSNode.java:257)
    at oracle.xml.parser.v2.XMLDocument.appendChild(XMLDocument.java:1010)
    at test.parser.ParseTest.parse1(ParseTest.java:136)
    at test.parser.ParseTest.main(ParseTest.java:63)
    Process exited with exit code 1.
    This is my code
    public void parse1(Element elem) {
    try{
    //Element docElement;
    //Node elemNode=(Node)docElement;
    DOMParser dp1 = new DOMParser();
    XMLDocument xmlDocument=new XMLDocument();
    xmlDocument.appendChild(elem);
    ByteArrayOutputStream docOutputStream = new ByteArrayOutputStream();
    xmlDocument.print(docOutputStream);
    ByteArrayInputStream docInputStream = new ByteArrayInputStream(docOutputStream.toByteArray());
    InputSource inputSource = new InputSource(docInputStream);
    dp1.parse(inputSource);
    catch (IOException e){e.printStackTrace();}
    catch (XMLParseException e){e.printStackTrace();}
    catch (SAXException e){e.printStackTrace();}
    Thanks
    MM

  • Mapviewer:GetCapabilities VERSION=1.1.1   Error 500--Internal Server Error

    Hi:
    i have configured the WMS secition in the mapviewer configuration file.(mapviewer:mapviewer1112,Oracle WebLogic Server 11g Rel 1 (10.3.3) )
    It is correct to GetCapabilities works for:
    "http://172.17.1.128:8888/mapviewer/wms?REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.3.0"
    but ,I got an error when works for:
    "http://172.17.1.128:8888/mapviewer/wms?REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1"
    Error text like this:
    Error 500--Internal Server Error
    java.lang.NoClassDefFoundError: oracle/i18n/util/LocaleMapper
         at oracle.xml.parser.v2.XMLOutputStream.setEncoding(XMLOutputStream.java:371)
         at oracle.xml.parser.v2.XMLPrintDriver.setEncoding(XMLPrintDriver.java:166)
         at oracle.xml.parser.v2.XMLDocument.print(XMLDocument.java:1619)
         at oracle.xml.parser.v2.XMLDocument.print(XMLDocument.java:1591)
         at oracle.xml.classgen.CGDocument.print(CGDocument.java:134)
         at oracle.lbs.webmapserver.dtdelements.WMT_MS_Capabilities.print(WMT_MS_Capabilities.java:218)
         at oracle.lbs.webmapserver.WMSCapabilities.GetCapabilities(WMSCapabilities.java:958)
         at oracle.lbs.mapserver.oms.wmsGetCapabilities(oms.java:2967)
         at oracle.lbs.mapserver.oms.doPost(oms.java:734)
         at oracle.lbs.mapserver.oms.doGet(oms.java:414)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.lbs.webmapserver.WMSServletFilter.doFilter(WMSServletFilter.java:254)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    I will be appreciated for any help!

    Please post the WMS section that you have configured. Thanks.

  • Deployment error in Jdeveloper - Unable to fix it. Need help.

    Dear Experts,
    I have been working in Jdeveloper for past 8 months, first time am seeing this deployment error. I am not able to fix that till now. Even not able to find a solution from the net. Please suggest me.
    Error1:
    Target platform is Oracle Application Server 10g 10.1.3 (AppServerConn).
    Wrote WAR file to F:\jdevstudio\jdev\mywork\TDProcess\TDInvoke\BpelInvoke\deploy\WebApp1.war
    Wrote EAR file to F:\jdevstudio\jdev\mywork\TDProcess\TDInvoke\BpelInvoke\deploy\WebApp1.ear
    java.lang.IllegalArgumentException: No Application Id
         at oracle.oc4j.admin.deploy.shared.util.DeploymentUtils.parseDeploymentPlan(DeploymentUtils.java:232)
         at oracle.oc4j.admin.deploy.shared.util.DeploymentUtils.parseDeploymentPlan(DeploymentUtils.java:110)
         at oracle.oc4j.admin.deploy.spi.ConnectedDeploymentManagerBase.internalDeploy(ConnectedDeploymentManagerBase.java:1665)
         at oracle.oc4j.admin.deploy.spi.ConnectedDeploymentManagerBase.distribute(ConnectedDeploymentManagerBase.java:457)
         at oracle.jdevimpl.deploy.Jsr88RemoteDeployer.deployApp(Jsr88RemoteDeployer.java:376)
         at oracle.jdevimpl.deploy.Jsr88RemoteDeployer.deploy(Jsr88RemoteDeployer.java:125)
         at oracle.jdevimpl.deploy.DynamicDeployer.deploy(DynamicDeployer.java:84)
         at oracle.jdevimpl.deploy.BatchDeployer.deploy(BatchDeployer.java:46)
         at oracle.jdevimpl.deploy.DynamicDeployer.deploy(DynamicDeployer.java:84)
         at oracle.jdevimpl.deploy.J2eeProfileDt$CleanupTransientProfilesDeployer.deploy(J2eeProfileDt.java:71)
         at oracle.jdevimpl.deploy.FinalDeployer.deploy(FinalDeployer.java:48)
         at oracle.jdevimpl.deploy.AsyncDeployer$1.runImpl(AsyncDeployer.java:67)
         at oracle.jdevimpl.deploy.AsyncDeployer$1.run(AsyncDeployer.java:53)
    Elapsed time for deployment: 19 seconds
    #### Deployment incomplete. #### Sep 18, 2009 4:21:05 PM
    Error2:
    Target platform is Oracle Application Server 10g 10.1.3 (AppServerConn).
    Wrote WAR file to F:\jdevstudio\jdev\mywork\TDProcess\TDInvoke\BpelInvoke\deploy\WebApp1.war
    java.io.IOException: There is not enough space on the disk
         at java.io.FileOutputStream.writeBytes(Native Method)
         at java.io.FileOutputStream.write(FileOutputStream.java:260)
         at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
         at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
         at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(StreamEncoder.java:410)
         at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:152)
         at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213)
         at oracle.xml.parser.v2.XMLOutputStream.finalFlush(XMLOutputStream.java:733)
         at oracle.xml.parser.v2.XMLPrintDriver.flush(XMLPrintDriver.java:639)
         at oracle.xml.parser.v2.XMLDocument.print(XMLDocument.java:1407)
         at oracle.ide.xml.XMLUtil.writeXML(XMLUtil.java:180)
         at oracle.ide.xml.XMLUtil.writeXML(XMLUtil.java:159)
         at oracle.jdeveloper.xml.URLDomIO.save(URLDomIO.java:26)
         at oracle.jdeveloper.xml.BindingIO.save(BindingIO.java:80)
         at oracle.jdeveloper.xml.BindingIO.save(BindingIO.java:57)
         at oracle.jdevimpl.deploy.ApplicationAssembler$MergeOrGen.addDescriptor(ApplicationAssembler.java:488)
         at oracle.jdevimpl.deploy.Oc4jAssembler$3.mergeOrGen(Oc4jAssembler.java:153)
         at oracle.jdevimpl.deploy.Oc4jAssembler.addPlatformXmlFilesImpl(Oc4jAssembler.java:178)
         at oracle.jdevimpl.deploy.Oc4jAssembler.addPlatformXmlFiles(Oc4jAssembler.java:85)
         at oracle.jdevimpl.deploy.ApplicationAssembler.deploy(ApplicationAssembler.java:144)
         at oracle.jdevimpl.deploy.Oc4jAssembler.deploy(Oc4jAssembler.java:78)
         at oracle.jdevimpl.deploy.DynamicDeployer.deploy(DynamicDeployer.java:84)
         at oracle.jdevimpl.deploy.BatchDeployer.deploy(BatchDeployer.java:46)
         at oracle.jdevimpl.deploy.DynamicDeployer.deploy(DynamicDeployer.java:84)
         at oracle.jdevimpl.deploy.BatchDeployer.deploy(BatchDeployer.java:46)
         at oracle.jdevimpl.deploy.DynamicDeployer.deploy(DynamicDeployer.java:84)
         at oracle.jdevimpl.deploy.J2eeProfileDt$CleanupTransientProfilesDeployer.deploy(J2eeProfileDt.java:71)
         at oracle.jdevimpl.deploy.FinalDeployer.deploy(FinalDeployer.java:48)
         at oracle.jdevimpl.deploy.AsyncDeployer$1.runImpl(AsyncDeployer.java:67)
         at oracle.jdevimpl.deploy.AsyncDeployer$1.run(AsyncDeployer.java:53)
    Elapsed time for deployment: 5 seconds
    #### Deployment incomplete. #### Sep 18, 2009 4:25:02 PM

    Hi Rajesh,
    See bold text in the stack, it clearly suggests you ran out of disk space.
    Thanks-
    [email protected]
    Target platform is Oracle Application Server 10g 10.1.3 (AppServerConn).
    Wrote WAR file to F:\jdevstudio\jdev\mywork\TDProcess\TDInvoke\BpelInvoke\deploy\WebApp1.war
    java.io.IOException: There is not enough space on the disk
    at java.io.FileOutputStream.writeBytes(Native Method)
    at java.io.FileOutputStream.write(FileOutputStream.java:260)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
    at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(StreamEncoder.java:410)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:152)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213)
    at oracle.xml.parser.v2.XMLOutputStream.finalFlush(XMLOutputStream.java:733)
    at oracle.xml.parser.v2.XMLPrintDriver.flush(XMLPrintDriver.java:639)
    at oracle.xml.parser.v2.XMLDocument.print(XMLDocument.java:1407)
    at oracle.ide.xml.XMLUtil.writeXML(XMLUtil.java:180)
    at oracle.ide.xml.XMLUtil.writeXML(XMLUtil.java:159)
    at oracle.jdeveloper.xml.URLDomIO.save(URLDomIO.java:26)
    at oracle.jdeveloper.xml.BindingIO.save(BindingIO.java:80)
    at oracle.jdeveloper.xml.BindingIO.save(BindingIO.java:57)
    at oracle.jdevimpl.deploy.ApplicationAssembler$MergeOrGen.addDescriptor(ApplicationAssembler.java:488)
    at oracle.jdevimpl.deploy.Oc4jAssembler$3.mergeOrGen(Oc4jAssembler.java:153)
    at oracle.jdevimpl.deploy.Oc4jAssembler.addPlatformXmlFilesImpl(Oc4jAssembler.java:178)
    at oracle.jdevimpl.deploy.Oc4jAssembler.addPlatformXmlFiles(Oc4jAssembler.java:85)
    at oracle.jdevimpl.deploy.ApplicationAssembler.deploy(ApplicationAssembler.java:144)
    at oracle.jdevimpl.deploy.Oc4jAssembler.deploy(Oc4jAssembler.java:78)
    at oracle.jdevimpl.deploy.DynamicDeployer.deploy(DynamicDeployer.java:84)
    at oracle.jdevimpl.deploy.BatchDeployer.deploy(BatchDeployer.java:46)
    at oracle.jdevimpl.deploy.DynamicDeployer.deploy(DynamicDeployer.java:84)
    at oracle.jdevimpl.deploy.BatchDeployer.deploy(BatchDeployer.java:46)
    at oracle.jdevimpl.deploy.DynamicDeployer.deploy(DynamicDeployer.java:84)
    at oracle.jdevimpl.deploy.J2eeProfileDt$CleanupTransientProfilesDeployer.deploy(J2eeProfileDt.java:71)
    at oracle.jdevimpl.deploy.FinalDeployer.deploy(FinalDeployer.java:48)
    at oracle.jdevimpl.deploy.AsyncDeployer$1.runImpl(AsyncDeployer.java:67)
    at oracle.jdevimpl.deploy.AsyncDeployer$1.run(AsyncDeployer.java:53)
    Elapsed time for deployment: 5 seconds
    #### Deployment incomplete. #### Sep 18, 2009 4:25:02 PM

  • Problems With XMLParser V2 Validation?

    I'm trying out the validation aspects of the XML Parser Version
    2. The code below takes an XML file and a DTD file and does a
    validating parse. When a try this on the sample family.xml and
    family.dtd files it gives me an exception saying that the "dad"
    attribute is not allowed (which it should be according to the
    DTD).
    Also, why does the dump out of the DTD not include all of the
    declarations?
    The output is ====>
    Parsing [family.dtd]
    DTD ==>
    <!ELEMENT member ANY>
    <!ATTLIST member memberid ID >
    Switching validation on
    Parsing [family.xml]
    Exception [Illegal attribute name dad]
    The code is ====>
    import java.io.*;
    import java.util.*;
    import oracle.xml.parser.v2.*;
    import org.w3c.dom.*;
    public class XMLParserClient
    public static void main(String args[])
    try
    String xmlFileName = args[0];
    String dtdFileName = null;
    if(args.length > 1) dtdFileName = args[1];
    DOMParser domParser = new DOMParser();
    if(dtdFileName != null)
    // Parse the DTD from the file
    FileReader dtdReader = new FileReader(dtdFileName);
    System.out.println("Parsing [" + dtdFileName +
    domParser.parseDTD( dtdReader, null);
    DTD dtd = domParser.getDoctype();
    // Dump out the DTD
    StringWriter dtdStringWriter = new StringWriter();
    PrintWriter dtdPrintWriter = new PrintWriter
    (dtdStringWriter);
    dtd.printExternalDTD(dtdPrintWriter);
    String dtdString = dtdStringWriter.toString();
    System.out.println("DTD ==>");
    System.out.println(dtdString);
    // Switch on validation
    System.out.println("Switching validation on");
    domParser.setDoctype(dtd);
    domParser.setValidationMode(true);
    // Parse the XML from the file
    FileReader xmlReader = new FileReader(xmlFileName);
    System.out.println("Parsing [" + xmlFileName + "]");
    domParser.parse(xmlReader);
    System.out.println("Parsed OK");
    // Dump out the XML
    System.out.println("Generating XML");
    XMLDocument xmlDocument = domParser.getDocument();
    StringWriter stringWriter = new StringWriter();
    PrintWriter printWriter = new PrintWriter
    (stringWriter);
    xmlDocument.print(printWriter);
    String xmlString = stringWriter.toString();
    System.out.println("XML ==>");
    System.out.println(xmlString);
    catch(Exception exception)
    System.out.println("Exception [" + exception + "]");
    null

    Dave Barton (guest) wrote:
    : I'm trying out the validation aspects of the XML Parser Version
    : 2. The code below takes an XML file and a DTD file and does a
    : validating parse. When a try this on the sample family.xml and
    : family.dtd files it gives me an exception saying that the "dad"
    : attribute is not allowed (which it should be according to the
    : DTD).
    : Also, why does the dump out of the DTD not include all of the
    : declarations?
    : The output is ====>
    : Parsing [family.dtd]
    : DTD ==>
    : <!ELEMENT member ANY>
    : <!ATTLIST member memberid ID >
    : Switching validation on
    : Parsing [family.xml]
    : Exception [Illegal attribute name dad]
    : The code is ====>
    : import java.io.*;
    : import java.util.*;
    : import oracle.xml.parser.v2.*;
    : import org.w3c.dom.*;
    : public class XMLParserClient
    : public static void main(String args[])
    : try
    : String xmlFileName = args[0];
    : String dtdFileName = null;
    : if(args.length > 1) dtdFileName = args[1];
    : DOMParser domParser = new DOMParser();
    : if(dtdFileName != null)
    : // Parse the DTD from the file
    : FileReader dtdReader = new
    FileReader(dtdFileName);
    : System.out.println("Parsing [" + dtdFileName +
    : domParser.parseDTD( dtdReader, null);
    : DTD dtd = domParser.getDoctype();
    : // Dump out the DTD
    : StringWriter dtdStringWriter = new
    StringWriter();
    : PrintWriter dtdPrintWriter = new PrintWriter
    : (dtdStringWriter);
    : dtd.printExternalDTD(dtdPrintWriter);
    : String dtdString = dtdStringWriter.toString();
    : System.out.println("DTD ==>");
    : System.out.println(dtdString);
    : // Switch on validation
    : System.out.println("Switching validation on");
    : domParser.setDoctype(dtd);
    : domParser.setValidationMode(true);
    : // Parse the XML from the file
    : FileReader xmlReader = new FileReader(xmlFileName);
    : System.out.println("Parsing [" + xmlFileName + "]");
    : domParser.parse(xmlReader);
    : System.out.println("Parsed OK");
    : // Dump out the XML
    : System.out.println("Generating XML");
    : XMLDocument xmlDocument = domParser.getDocument();
    : StringWriter stringWriter = new StringWriter();
    : PrintWriter printWriter = new PrintWriter
    : (stringWriter);
    : xmlDocument.print(printWriter);
    : String xmlString = stringWriter.toString();
    : System.out.println("XML ==>");
    : System.out.println(xmlString);
    : catch(Exception exception)
    : System.out.println("Exception [" + exception + "]");
    A simple bug in our parser to fix in our upcoming release --
    thanks. The sequence is:
    1) Parse DTD file using DOMParser.parseDTD()
    2) set validation to true
    3) set DTD in the parser using setDocType()
    4) Parse XML file using DOMParser.parse()
    The DOMParser works in non-validating mode by default, and so
    parseDTD() ignores most of the declarations; this is a bug,
    however, since parseDTD() should always operate in validating
    mode.
    A workaround exists -- set validation to true explicitly before
    calling parseDTD(), i.e., domParser.setValidationMode(true),
    before calling parseDTD().
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

  • Location of XML files

    I am looking into using the XML SQL utility to generate XML documents. Is it possible for the XML documents to be output to any location?

    Using the oracle.xml.parser.v2.XMLDocument.print() method is a good place to start. From here you can output the file to any file on your network (with permissions set correctly):
    doc.print(new java.io.FileOutputStream(new File("H:/testing.xml")));

  • Chaning the document formatting

    Am I correct when saying that to override XMLOutputStream's default output style of PRETTY I need to subclass XMLPrintDriver and change its constructor so that it calls out.setOutputStyle(XMLOutputStream.DEFAULT) after super()? Is there any simpler way to change the output style for XMLDocument.print(OutputStream)? After poking around for a while, I figured that there's no XMLDocument.print(XMLOutputStream), so I can't create the output stream set up as I want it, and that XMLPrintDriver.out is protected member, so I have to subclass XMLPrintDriver to get access to it and change the style. Anyone knows a shorter path that doesn't require subclassing?

    Currently, there is no other way. We have the enhancement request:
    - Enhancement request: 1889054
    Please escalate if needed.

Maybe you are looking for

  • Condition type is missing in Pricing Procedure determination

    Hi experts, We have a problem with Pricing Condition type in CRM. We have created a Transction in CRM as a follow up for the Transaction which is replicated from ECC to CRM the pricing procedure has been determined. But the net value is "0". when I c

  • Editing a pdf file in orace 6i

    Hi , My code is: declare v_file_path VARCHAR2(2100); adobehandle ole2.obj_type; BEGIN v_file_path := 'C:\X.pdf'; adobehandle := ole2.create_obj('Shell.Explorer.2'); adobehandle := forms_ole.get_interface_pointer('BLOCK3.ITEM5'); Shell_IWebBrowser2.NA

  • ABAP dump while running the tcode MIGO

    Hi All, I am getting the abap dump while running the tcode MIGO when I searched I got two relevant sap notes but our functional team said that its not applicable in our case. Please find the details of ST22 analysis-: Runtime Errors         MESSAGE_T

  • How to make first page to be on the left?

    Hey, Is there any way to make a 2-page document with the two pages displayed side-by-side? I tried setting various options, but I could only get either the two pages under each other; or one page on the right, one on the left, but the one on the left

  • DHCP & DNS Server 2008

    Hello, I'm not sure how the following is working.  asa5525 anyconnect version 3.1 windows server 2008R2 When you come in via VPN I send clients to the windows server for DHCP/DNS info and records get created in the FLZ and RLZ. When folks disconnect