Preserving Line and Tab Spaces in XML File

Hi all,
Question is in detail
I want to preserve spaces in my XML Document.
XML File is as follows
<?xml version="1.0" encoding="UTF-8"?>
<desc xml:space = "prserved">          AAA&#xD;
&#xD;
Customer Id: [ customer_id ]&#xD;
Customer Id: [ customer_id ]&#xD;
Customer Id: [ customer_id ]&#xD;
Customer Id: [ customer_id ]&#xD;
Customer Id: [ customer_id ]&#xD;
</desc>
Output of the XML File Should be like this
AAA
Customer Id: [ customer_id ]
Customer Id: [ customer_id ]
Customer Id: [ customer_id ]
Customer Id: [ customer_id ]
Customer Id: [ customer_id ]
i want same output that what you see above, when i am converting xml file to pdf file.
First, i am generating XML File dynamically
Second, i am writing XSL File(Predefined)
Third, Using FOP, i am converting XML to PDF(By Using XSL File)
Here is My XSL File
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:preserve-space elements="desc"/>
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
     <fo:layout-master-set>
          <fo:simple-page-master master-name="simple">
               <fo:region-body margin-left = "2cm" margin-right = "2cm" margin-top = "2cm" margin-bottom = "2cm"/>
          </fo:simple-page-master>
     </fo:layout-master-set>
     <fo:page-sequence master-name="simple">
          <fo:flow flow-name="xsl-region-body">
               <xsl:apply-templates select="desc"/>
          </fo:flow>
     </fo:page-sequence>s
</fo:root>
</xsl:template>
<xsl:template match="desc">
<fo:block font-weight="bold" color = "brown"><xsl:value-of select="."/></fo:block>
</xsl:template>
</xsl:stylesheet>
i used (space preserving) attributes in XML File and XSL File also. But i am getting below output.
AAACustomer Id: [ customer_id ]Customer Id: [ customer_id ]Customer Id: [ customer_id ] Customer Id: [ customer_id ]Customer Id: [ customer_id ]
Please help me.

Thanks for your Response
I want to preserve space when i convert xml file to pdf. So we need to use FO
attributes.
<fo:block wrap-option="no-wrap" white-space-collapse="false"><xsl:value-of
select="."/>
</fo:block>

Similar Messages

  • How open and edit the coherence.xml file?

    How can I open and edit the coherence.xml file?
    I cannot find the coherence.xml file in the coherence.jar package.
    Thank you,
    June

    If you are intent on changing the coherence.xml file, then you could use the JAR command (that comes with Java) to extract the coherence.xml file from coherence.jar and the later repackage the coherence.jar file using the udpated coherence.xml file, e.g.:
    C:\java\opt\coherence-331\lib>jar -xvf coherence.jar tangosol-coherence.xmlextracted: tangosol-coherence.xml>
    Instead of using JAR, on Windows you can associate the .JAR, .WAR and .EAR extensions with WinZip and use it to access / modify the contents of JAR files.
    However, the suggested approach is as follows, and does not include any changes to the tangosol.jar file:
    The tangosol-coherence-override-dev.xml file can be found in the coherence.jar file. After editing this file (in this case to define a unique value for the port system-property value for the multicast listener), save the file and add it to the server's classpath. When the server is executed, the values in the tangosol-coherence-override-dev.xml file will override any corresponding settings in the tangosol-coherence.xml file.Peace,
    Cameron Purdy | Oracle Coherence

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

  • How to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 using ftp

    how to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 device using ftp through Ethernet

    Hello
    For using FTP function in LabVIEW, I recommend you to check this document: FTP Basics
    Also, take a look at FTP Browser.vi, which is available at the Example Finder.
    To edit a XML file, try to use VIs in XML palette. Maybe Write to XML.vi helps you.
    Post your current VI if possible.
    Regards
    Mondoni

  • Generating XML from SQL queries and saving to an xml file?

    Hi there,
    I was wondering if somebody could help with regards to the following:
    Generating XML from SQL queries and saving to a xml file?
    We want to have a procedure(PL/SQL) that accepts an order number as an input parameter(the procedure
    is accessed by our software on the client machine).
    Using this order number we do a couple of SQL queries.
    My first question: What would be our best option to convert the result of the
    queries to xml?
    Second Question: Once the XML has been generated, how do we save that XML to a file?
    (The XML file is going to be saved on the file system of the server that
    the database is running on.)
    Now our procedure will also have a output parameter which returns the filename to us. eg. Order1001.xml
    Our software on the client machine will then ftp this XML file(based on the output parameter[filename]) to
    the client hard drive.
    Any information would be greatly appreciated.
    Thanking you,
    Francois

    If you are using 9iR2 you do not need to do any of this..
    You can create an XML as an XMLType using the new SQL/XML operators. You can insert this XML into the XML DB repository using DBMS_XDB.createResource. You can then access the document from the resource. You can also return the XMLType containing the XML directly from the PL/SQL Procedure.

  • Generating XML from SQL queries and saving to a xml file?

    Hi there,
    I was wondering if somebody could help with regards to the following:
    Generating XML from SQL queries and saving to a xml file?
    We want to have a stored procedure(PL/SQL) that accepts an order number as an input parameter(the procedure
    is accessed by our software on the client machine).
    Using this order number we do a couple of SQL queries.
    My first question: What would be our best option to convert the result of the
    queries to xml?
    Second Question: Once the XML has been generated, how do we save that XML to a file?
    (The XML file is going to be saved on the file system of the server that
    the database is running on.)
    Now our procedure will also have a output parameter which returns the filename to us. eg. Order1001.xml
    Our software on the client machine will then ftp this XML file(based on the output parameter[filename]) to
    the client hard drive.
    Any information would be greatly appreciated.
    Thanking you,
    Francois

    Hi
    Here is an example of some code that i am using on Oracle 817.
    The create_file procedure is the one that creates the file.
    The orher procedures are utility procedures that can be used with any XML file.
    PROCEDURE create_file_with_root(po_xmldoc OUT xmldom.DOMDocument,
    pi_root_tag IN VARCHAR2,
                                            po_root_element OUT xmldom.domelement,
                                            po_root_node OUT xmldom.domnode,
                                            pi_doctype_url IN VARCHAR2) IS
    xmldoc xmldom.DOMDocument;
    root xmldom.domnode;
    root_node xmldom.domnode;
    root_element xmldom.domelement;
    record_node xmldom.domnode;
    newelenode xmldom.DOMNode;
    BEGIN
    xmldoc := xmldom.newDOMDocument;
    xmldom.setVersion(xmldoc, '1.0');
    xmldom.setDoctype(xmldoc, pi_root_tag, pi_doctype_url,'');
    -- Create the root --
    root := xmldom.makeNode(xmldoc);
    -- Create the root element in the file --
    create_element_and_append(xmldoc, pi_root_tag, root, root_element, root_node);
    po_xmldoc := xmldoc;
    po_root_node := root_node;
    po_root_element := root_element;
    END create_file_with_root;
    PROCEDURE create_element_and_append(pi_xmldoc IN OUT xmldom.DOMDocument,
    pi_element_name IN VARCHAR2,
                                            pi_parent_node IN xmldom.domnode,
                                            po_new_element OUT xmldom.domelement,
                                            po_new_node OUT xmldom.domnode) IS
    element xmldom.domelement;
    child_node xmldom.domnode;
    newelenode xmldom.DOMNode;
    BEGIN
    element := xmldom.createElement(pi_xmldoc, pi_element_name);
    child_node := xmldom.makeNode(element);
    -- Append the new node to the parent --
    newelenode := xmldom.appendchild(pi_parent_node, child_node);
    po_new_node := child_node;
    po_new_element := element;
    END create_element_and_append;
    FUNCTION create_text_element(pio_xmldoc IN OUT xmldom.DOMDocument, pi_element_name IN VARCHAR2,
    pi_element_data IN VARCHAR2, pi_parent_node IN xmldom.domnode) RETURN xmldom.domnode IS
    parent_node xmldom.domnode;                                   
    child_node xmldom.domnode;
    child_element xmldom.domelement;
    newelenode xmldom.DOMNode;
    textele xmldom.DOMText;
    compnode xmldom.DOMNode;
    BEGIN
    create_element_and_append(pio_xmldoc, pi_element_name, pi_parent_node, child_element, child_node);
    parent_node := child_node;
    -- Create a text node --
    textele := xmldom.createTextNode(pio_xmldoc, pi_element_data);
    child_node := xmldom.makeNode(textele);
    -- Link the text node to the new node --
    compnode := xmldom.appendChild(parent_node, child_node);
    RETURN newelenode;
    END create_text_element;
    PROCEDURE create_file IS
    xmldoc xmldom.DOMDocument;
    root_node xmldom.domnode;
    xml_doctype xmldom.DOMDocumentType;
    root_element xmldom.domelement;
    record_element xmldom.domelement;
    record_node xmldom.domnode;
    parent_node xmldom.domnode;
    child_node xmldom.domnode;
    newelenode xmldom.DOMNode;
    textele xmldom.DOMText;
    compnode xmldom.DOMNode;
    BEGIN
    xmldoc := xmldom.newDOMDocument;
    xmldom.setVersion(xmldoc, '1.0');
    create_file_with_root(xmldoc, 'root', root_element, root_node, 'test.dtd');
    xmldom.setAttribute(root_element, 'interface_type', 'EXCHANGE_RATES');
    -- Create the record element in the file --
    create_element_and_append(xmldoc, 'record', root_node, record_element, record_node);
    parent_node := create_text_element(xmldoc, 'title', 'Mr', record_node);
    parent_node := create_text_element(xmldoc, 'name', 'Joe', record_node);
    parent_node := create_text_element(xmldoc,'surname', 'Blogs', record_node);
    -- Create the record element in the file --
    create_element_and_append(xmldoc, 'record', root_node, record_element, record_node);
    parent_node := create_text_element(xmldoc, 'title', 'Mrs', record_node);
    parent_node := create_text_element(xmldoc, 'name', 'A', record_node);
    parent_node := create_text_element(xmldoc, 'surname', 'B', record_node);
    -- write the newly created dom document into the buffer assuming it is less than 32K
    xmldom.writeTofile(xmldoc, 'c:\laiki\willow_data\test.xml');
    EXCEPTION
    WHEN xmldom.INDEX_SIZE_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Index Size error');
    WHEN xmldom.DOMSTRING_SIZE_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'String Size error');
    WHEN xmldom.HIERARCHY_REQUEST_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Hierarchy request error');
    WHEN xmldom.WRONG_DOCUMENT_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Wrong doc error');
    WHEN xmldom.INVALID_CHARACTER_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Invalid Char error');
    WHEN xmldom.NO_DATA_ALLOWED_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Nod data allowed error');
    WHEN xmldom.NO_MODIFICATION_ALLOWED_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'No mod allowed error');
    WHEN xmldom.NOT_FOUND_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Not found error');
    WHEN xmldom.NOT_SUPPORTED_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Not supported error');
    WHEN xmldom.INUSE_ATTRIBUTE_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'In use attr error');
    WHEN OTHERS THEN
    dbms_output.put_line('exception occured' || SQLCODE || SUBSTR(SQLERRM, 1, 100));
    END create_file;

  • Bpel-config.xml and soa-infra-config.xml file location in SOA 11g Pre-built

    Hi frnds,
    I have downloaded and started Oracle SOA 11g Pre-built from http://www.oracle.com/technetwork/middleware/soasuite/learnmore/vmsoa-172279.html and trying to configure it according to my requirements to upgrade from SOA 10g to 11g. But I can't find bpel-config.xml and soa-infra-config.xml files in BPEL domain home (i.e. /oracle/fmwhome/user_projects/domains/domain1).
    Can you please help me?
    BR, Lisan

    None of those roles are intended to be granted to application users. Those are instead to limit various operational / support responsibilities. For instance, if you have "operators" for your production environment who are responsible for starting & stopping servers vs "Administrators" who are performing configuration changes, etc.
    The SOA* versions can be used to separate even further - an "Operator" ( with rights in the WL console ) can be distinct from a "SOAOperator" ( with rights in the SOA /em ), etc.
    http://download.oracle.com/docs/cd/E14571_01/integration.1111/e10226/appx_roles_privs.htm#insertedID2
    also, here is a bit more on soa-infra roles:
    http://download.oracle.com/docs/cd/E14571_01/integration.1111/e10226/appx_users.htm#insertedID4

  • How can I fill structure from the line with contetnt of a XML file inside?

    How can I fill structure from the line with contetnt of a XML file inside?
    I have array of lines with XML documents inside. All XML's have the same structure.
    I need to fill array of structures (with the same structure like given XML's) from data of these XML's.
    How can I do this? I am trying Transformation with ora:parseEscapedXML, but receive error: "XPath expression failed to execute.
    Error while processing xpath expression, the expression is "ora:processXSLT("Transformation_1.xsl", bpws:getVariableData("ProcessedFiles"))", the reason is javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: Could not find function: parseEscapedXML.
    Please verify the xpath query."

    Ive posted the new code but now I'm getting a FileAlreadyExistException error. How do I handle this exception error correctly in my code?
    import java.io.IOException;
    import java.nio.file.FileAlreadyExistsException;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
    public class MyDomParser {
      public static void main(String[] args) {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      try {
      DocumentBuilder builder = factory.newDocumentBuilder();
      Document doc = builder.parse("ENtemplate.xml");
      doc.normalize();
      NodeList rootNodes = doc.getElementsByTagName("templates");
      Node rootNode = rootNodes.item(0);
      Element rootElement = (Element) rootNode;
      NodeList templateList = rootElement.getElementsByTagName("template");
      for(int i=0; i < templateList.getLength(); i++) {
      Node theTemplate = templateList.item(i);
      Element templateElement = (Element) theTemplate;
      System.out.println(templateElement.getAttribute("name")+ ".xml");
      for(int i=0; i < templateList.getLength(); i++) {
      Node theTemplate = templateList.item(i);
      Element templateElement = (Element) theTemplate;
      String fileName = templateElement.getAttribute("name") + ".xml";
      Files.createFile(Paths.get(fileName));
      System.out.println("File" + ":" + fileName + ".xml created");
      } catch (ParserConfigurationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (SAXException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();

  • There is no facility of bullet points and tabs space I have seen in the any versions of Adobe Muse

    There is no facility of bullet points and tabs space I have seen in the both versions of Adobe Muse while working with paragraph text layouts. Can anyone tell me the about it if there?
    Saleem Pasha
    Graphic Designer
    Toronto, Canada

    It's unlikely Muse will ever have tab stops (since HTML/CSS has no concept of tab stops).
    Lists and tables are both highly requested features. It's likely lists will be supported in Muse before tables, not due to prioritization, but due to the fact tables is vastly more complicated and thus more work to design, implement and test.

  • How do i create and write to an xml file?

    I know there are methods to create nodes and such but I am not at all familiar with xml. Isn't an easier way just to use the File class to create the file and use the write method to write to the xml file? Thank you.

    tsith wrote:
    <replies>
    <reply>
    <sentence>
    <pronoun>It</pronoun>
    <verb>is</verb>
    </sentence>
    </reply>
    </replies>
    Piddle! Try this: open up Microsoft Word, write "Hello, world!" and save it as XML:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <?mso-application progid="Word.Document"?>
    <w:wordDocument
        xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
        xmlns:v="urn:schemas-microsoft-com:vml"
        xmlns:w10="urn:schemas-microsoft-com:office:word"
        xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core"
        xmlns:aml="http://schemas.microsoft.com/aml/2001/core"
        xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"
        xmlns:o="urn:schemas-microsoft-com:office:office"
        xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
        xmlns:wsp="http://schemas.microsoft.com/office/word/2003/wordml/sp2"
        w:macrosPresent="no"
        w:embeddedObjPresent="no"
        w:ocxPresent="no"
        xml:space="preserve">
        <w:ignoreElements w:val="http://schemas.microsoft.com/office/word/2003/wordml/sp2"/>
        <o:DocumentProperties>
            <o:Title>Hello, world</o:Title>
            <o:Author>BDLH</o:Author>
            <o:LastAuthor>BDLH</o:LastAuthor>
            <o:Revision>1</o:Revision>
            <o:TotalTime>0</o:TotalTime>
            <o:Created>2008-09-19T17:37:00Z</o:Created>
            <o:LastSaved>2008-09-19T17:37:00Z</o:LastSaved>
            <o:Pages>1</o:Pages>
            <o:Words>2</o:Words>
            <o:Characters>12</o:Characters>
            <o:Company>Weight Watchers</o:Company>
            <o:Lines>1</o:Lines>
            <o:Paragraphs>1</o:Paragraphs>
            <o:CharactersWithSpaces>13</o:CharactersWithSpaces>
            <o:Version>11.0000</o:Version>
        </o:DocumentProperties>
        <w:fonts>
            <w:defaultFonts w:ascii="Times New Roman" w:fareast="Times New Roman" w:h-ansi="Times New Roman" w:cs="Times New Roman"/>
        </w:fonts>
        <w:styles>
            <w:versionOfBuiltInStylenames w:val="4"/>
            <w:latentStyles w:defLockedState="off" w:latentStyleCount="156"/>
            <w:style w:type="paragraph" w:default="on" w:styleId="Normal">
                <w:name w:val="Normal"/>
                <w:rPr>
                    <wx:font wx:val="Times New Roman"/>
                    <w:sz w:val="24"/>
                    <w:sz-cs w:val="24"/>
                    <w:lang w:val="EN-US" w:fareast="EN-US" w:bidi="AR-SA"/>
                </w:rPr>
            </w:style>
            <w:style w:type="character" w:default="on" w:styleId="DefaultParagraphFont">
                <w:name w:val="Default Paragraph Font"/>
                <w:semiHidden/>
            </w:style>
            <w:style w:type="table" w:default="on" w:styleId="TableNormal">
                <w:name w:val="Normal Table"/><wx:uiName wx:val="Table Normal"/>
                <w:semiHidden/>
                <w:rPr>
                    <wx:font wx:val="Times New Roman"/>
                </w:rPr>
                <w:tblPr>
                    <w:tblInd w:w="0" w:type="dxa"/>
                    <w:tblCellMar>
                        <w:top w:w="0" w:type="dxa"/>
                        <w:left w:w="108" w:type="dxa"/>
                        <w:bottom w:w="0" w:type="dxa"/>
                        <w:right w:w="108" w:type="dxa"/>
                    </w:tblCellMar>
                </w:tblPr>
            </w:style>
            <w:style w:type="list" w:default="on" w:styleId="NoList">
                <w:name w:val="No List"/>
                <w:semiHidden/>
            </w:style>
        </w:styles>
        <w:docPr>
            <w:view w:val="print"/>
            <w:zoom w:percent="100"/>
            <w:doNotEmbedSystemFonts/>
            <w:proofState w:spelling="clean" w:grammar="clean"/>
            <w:attachedTemplate w:val=""/>
            <w:defaultTabStop w:val="720"/>
            <w:punctuationKerning/>
            <w:characterSpacingControl w:val="DontCompress"/>
            <w:optimizeForBrowser/>
            <w:validateAgainstSchema/>
            <w:saveInvalidXML w:val="off"/>
            <w:ignoreMixedContent w:val="off"/>
            <w:alwaysShowPlaceholderText w:val="off"/>
            <w:compat>
                <w:breakWrappedTables/>
                <w:snapToGridInCell/>
                <w:wrapTextWithPunct/>
                <w:useAsianBreakRules/>
                <w:dontGrowAutofit/>
            </w:compat>
            <wsp:rsids>
                <wsp:rsidRoot wsp:val="0077226E"/>
                <wsp:rsid wsp:val="0077226E"/>
            </wsp:rsids>
        </w:docPr>
        <w:body>
            <wx:sect>
                <w:p wsp:rsidR="0077226E" wsp:rsidRDefault="0077226E">
                    <w:r>
                        <w:t>Hello, world!</w:t>
                    </w:r>
                </w:p>
                <w:sectPr wsp:rsidR="0077226E">
                    <w:pgSz w:w="12240" w:h="15840"/>
                    <w:pgMar w:top="1440" w:right="1800" w:bottom="1440" w:left="1800" w:header="708" w:footer="708" w:gutter="0"/>
                    <w:cols w:space="708"/>
                    <w:docGrid w:line-pitch="360"/>
                </w:sectPr>
            </wx:sect>
        </w:body>
    </w:wordDocument>

  • Reading XML file using BAPI and then uploading that xml file data into SAP

    I am getting a xml file from Java server. I need to take
    data from this file using BAPI and need to upload into SAP using SAP.
    Please tell me how to read XML files using BAPI's.

    <b>SDIXML_DATA_TO_DOM</b> Convert SAP data (elementary/structured/table types) into DOM (XML
    <b>SDIXML_DOM_TO_XML</b>  Convert DOM (XML) into string of bytes that can be downloaded to PC or application server
    <b>SDIXML_DOM_TO_SCREEN</b> Display DOM (XML)
    <b>SDIXML_DOM_TO_DATA</b>
    data: it_table like t001 occurs 0.
    data: l_dom      TYPE REF TO IF_IXML_ELEMENT,
          m_document TYPE REF TO IF_IXML_DOCUMENT,
          g_ixml     TYPE REF TO IF_IXML,
          w_string   TYPE XSTRING,
          w_size     TYPE I,
          w_result   TYPE I,
          w_line     TYPE STRING,
          it_xml     TYPE DCXMLLINES,
          s_xml      like line of it_xml,
          w_rc       like sy-subrc.
    start-of-selection.
      select * from t001 into table it_table.
    end-of-selection.
    initialize iXML-Framework          ****
      write: / 'initialiazing iXML:'.
      class cl_ixml definition load.
      g_ixml = cl_ixml=>create( ).
      check not g_ixml is initial.
      write: 'ok'.
    create DOM from SAP data           ****
      write: / 'creating iXML doc:'.
      m_document = g_ixml->create_document( ).
      check not m_document is initial.
      write: 'ok'.
      write: / 'converting DATA TO DOM 1:'.
      CALL FUNCTION 'SDIXML_DATA_TO_DOM'
        EXPORTING
          NAME               = 'IT_TABLE'
          DATAOBJECT         = it_table[]
        IMPORTING
          DATA_AS_DOM        = l_dom
        CHANGING
          DOCUMENT           = m_document
        EXCEPTIONS
          ILLEGAL_NAME       = 1
          OTHERS             = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
      check not l_dom is initial.
      write: / 'appending DOM to iXML doc:'.
      w_rc = m_document->append_child( new_child = l_dom ).
      if w_rc is initial.  write  'ok'.
      else.                write: 'Err =', w_rc.
      endif.
    visualize iXML (DOM)               ****
      write: / 'displaying DOM:'.
      CALL FUNCTION 'SDIXML_DOM_TO_SCREEN'
        EXPORTING
          DOCUMENT          = m_document
        EXCEPTIONS
          NO_DOCUMENT       = 1
          OTHERS            = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
    convert DOM to XML doc (table)     ****
      write: / 'converting DOM TO XML:'.
      CALL FUNCTION 'SDIXML_DOM_TO_XML'
        EXPORTING
          DOCUMENT            = m_document
        PRETTY_PRINT        = ' '
        IMPORTING
          XML_AS_STRING       = w_string
          SIZE                = w_size
        TABLES
          XML_AS_TABLE        = it_xml
        EXCEPTIONS
          NO_DOCUMENT         = 1
          OTHERS              = 2.
      if sy-subrc = 0.   write  'ok'.
      else.              write: 'Err =', sy-subrc.
      endif.
      write: / 'XML as string of size:', w_size, / w_string.
      describe table it_xml lines w_result.
      write: / 'XML as table of', w_result, 'lines:'..
      loop at it_xml into s_xml.
        write s_xml.
      endloop.
      write: / 'end of processing'.
    end of code
    Hope this will be useful.
    regards
    vinod

  • Add schema location and version to the XML file header

    HI, I used XMLBean to generate a XML file:
    <?xml version="1.0" encoding="UTF-8"?>
    <bo:TXLife xmlns:bo="http://ACORD.org/Standards/Life/2">
    </bo:TXLife>
    I need add a schema location, a version, another name space so the header looks
    like:
    <?xml version="1.0" encoding="UTF-8"?>
    <bo:TXLife xmlns:bo="http://ACORD.org/Standards/Life/2"
    xmlns:xsd="http://www.w3.com/2001/XMLSchema"
    xmlns:xsi="http://www.w3.com/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.iit.com/schema/Schema29.xsd"
    version="2.9">
    </bo:TXLife>
    Thanks,

    Thanks Steve.
    Your right, it seems that I can't access the attribute or in this case add it
    by just editing the xsd. At least I haven't found a way to do that.
    The cursor solution works ok, but we'll have to add that code to every transformation
    etc.
    Timo
    "Steve Traut" <[email protected]> wrote:
    Hello Timo -- Unless your schema defines the attribute as part of the
    element you want to edit, I don't think you'll get access to the attribute
    through JavaBeans-style accessors.
    If you have any feedback about why the cursor won't work in your situation,
    though, I'd love to hear it.
    Steve
    "Timo Lukumaa" <[email protected]> wrote in message
    news:[email protected]...
    Hello, where having a similar problem. We need a schema locationdefinition so
    that XML is valid. We can edit the xsd files and add stuff there, wouldthere
    be a way to do that with out the cursor? This cursor solution isn'ttoo
    nice..
    "Steve Traut" <[email protected]> wrote:
    Henry -- You'll need an XmlCursor for inserting attributes that aren't
    defined in your schema. Try something like the following.
    TXLifeDocument txLifeDoc = TXLifeDocument.Factory.newInstance();
    TXLife txLife = txLifeDoc.addNewTXLife();
    // Create a cursor and move it to where you want to start inserting
    attributes.
    XmlCursor cursor = txLife.newCursor();
    cursor.toFirstContentToken();
    cursor.toLastAttribute();
    // Insert your attributes.
    cursor.insertAttributeWithValue("schemaLocation","http://www.w3.com/2001/XM
    L
    Schema-instance", "http://www.iit.com/schema/Schema29.xsd");
    cursor.insertAttributeWithValue("version", "2.9");
    cursor.insertNamespace("xsi",
    "http://www.w3.com/2001/XMLSchema-instance");
    cursor.insertNamespace("xsd", "http://www.w3.com/2001/XMLSchema");
    // Dispose of the cursor.
    cursor.dispose();
    Steve
    "Henry Niu" <[email protected]> wrote in message
    news:[email protected]...
    HI, I used XMLBean to generate a XML file:
    <?xml version="1.0" encoding="UTF-8"?>
    <bo:TXLife xmlns:bo="http://ACORD.org/Standards/Life/2">
    </bo:TXLife>
    I need add a schema location, a version, another name space so theheader
    looks
    like:
    <?xml version="1.0" encoding="UTF-8"?>
    <bo:TXLife xmlns:bo="http://ACORD.org/Standards/Life/2"
    xmlns:xsd="http://www.w3.com/2001/XMLSchema"
    xmlns:xsi="http://www.w3.com/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.iit.com/schema/Schema29.xsd"
    version="2.9">
    </bo:TXLife>
    Thanks,

  • How to validate and transform large (180M) xml files

    Hi:
    I've been looking at various ways to do this with oracle and am getting a bit lost in the sea of documentation and different ways to go about this. I was hoping that something like the XMLParser class and XMLTransform would be smart enough to handle large files by using SAX when it has to but I'm getting "too many nodes" when trying to transform a really large file. I've gotten oraxsl to handle it if I pass in the proper memory parameters on the command line but a) this will still have limits and b) I was trying to do this in a stored procedure which (I think) means I'm looking at XMLParser?
    I've also seen documentation on something called "Scalable DOM" but I think that's only in 11g? So I'm thinking I have to write a (Java?) stored procedure to loop through the top elements of this XML file (select extract(...)) and transform each node?
    I have the XML, XSD, and XSLT all in clob columns. What's the easiest/quickest path within Oracle to validate the XML against the xsd and translate source XML with XSL?
    I'm using Oracle 10gR2 on RH Linux.
    Thanks.

    So I'm thinking I have to write a (Java?) stored procedure to loop through the top elements of this XML file (select extract(...)) and transform each node? Here's something I've written a while back when I hit the same restrictions ("too many nodes") on 10.2.0.4.
    It takes XMLType as input parameters (but it's easy to adapt for CLOB), and streams the transformed XML directly into a file :
    create or replace and compile java source named ora_xslt_util as
    import oracle.xml.parser.v2.*;
    import oracle.xdb.XMLType;
    import java.io.*;
    import org.w3c.dom.*;
    public class oraXSL
    private static XMLDocument getXMLDocument(XMLType xml) throws Exception
        XMLDocument doc = null;
        DOMParser parser  = new DOMParser();
        parser.setValidationMode(oracle.xml.parser.v2.XMLParser.NONVALIDATING);
        parser.setPreserveWhitespace(true);
        parser.parse(new StringReader(xml.getStringVal()));
        doc = parser.getDocument();
        return doc;
    public static void transform(XMLType doc, XMLType xsl, String filename) throws Exception
        OutputStream os = new FileOutputStream(filename);
        XMLDocument xmldoc = getXMLDocument(doc);
        XMLDocument xsldoc = getXMLDocument(xsl);
        XSLProcessor xsp = new XSLProcessor();
        XSLStylesheet xss = xsp.newXSLStylesheet(xsldoc);
        xsp.processXSL(xss, xmldoc, os);
        os.close();
    }and the PL/SQL wrapper (originally part of a package) :
    PROCEDURE processXSL (
       p_xmldoc IN XMLType
    , p_xsldoc IN XMLType
    , p_filename IN VARCHAR2
    IS
    LANGUAGE JAVA NAME 'oraXSL.transform(oracle.xdb.XMLType,oracle.xdb.XMLType,java.lang.String)'
    ;

  • Can I unzip the .ipa file and edit the application.xml file

    I want to modify the below info to also have an additional string value of 2, which somewhere along the line tells something somewhere that the app can run on the ipad. Is there some info in the compiled application that will error out if I modify this document?
    <InfoAdditions>
    - <![CDATA[ <key>UIDeviceFamily</key><array><string>1</string></array> ]]>
    </InfoAdditions>
    into this
    <InfoAdditions>
    - <![CDATA[ <key>UIDeviceFamily</key><array><string>1</string><string>2</string></array> ]]>
    </InfoAdditions>

    you can change the file extension to zip, unzip it, find the application.xml file in one of the subdirectories, edit it, rezip the files, change the file extension to ipa and install.

  • Preserving CDATA when reading then writing XML files

    Hi All,
    I have some source XML that needs to have an update applied and then written back out into a new directory. This all works fine except some of the other elements have values with CDATA around them in the input file and on the output file the CDATA is replaced and the characters substituted ie: turned in &amp;
    This is (I guess) default behaviour but I would like the CDATA preserved and writing out into the new XML file.
    How can I do this ?
    Regards,
    Steve

    Found the answer :
            DOMParser dp = new DOMParser();
            dp.retainCDATASection(true);
            dp.parse(xmlFile);
            xmlDoc = (XMLDocument)dp.getDocument();

Maybe you are looking for

  • Unable to send mail with different fonts and colors

    Hi All, here is the explanation for my problem: I am sending mail using javamail. when i send the text with different font and color its not received in the same way. it is simply sending as plain text. Please help me on this issue. Thanks NG

  • How to create date variable with interval in VC

    Hi Everyone, I have 2 questions: <u>My scenario:</u> I am using a BI 7.0 Query which is having some variables. I want the same variables to be displayed in the VC output. <u>Question 1:</u> I know that how to bring these variables in variable screen,

  • Question about logon screen

    i have this weird problem - i searched the forums but couldnt find any answer - im on 10.7 Lion - sometimes my mac goes into a state where it goes back to the logon screen and i have to enter my password to unlock the mac - this interferes with some

  • Warrenty Is available in other country

    hello..! I have purchased i phone 4s from otherside my residential country. is warrenty for my iphone  available in my country (i.e. India)..?? please reply fast

  • If I buy a magazine in iTunes will it down load to both my iPhone and iPad or mac

    If I buy a magazine in iTunes will it down load to both my iPhone and iPad or mac