Creating XML nested tags as output in XML files

Hello:
My question is a little extraordinary compared to most users since I am
primarily concerned with the xml output that is generated when a form is
submitted and emailed to a recipient.
Can anyone tell me if it is possible to design a form that can generate an xml file containing nested XML tags using Designer? (See sample output below).
Example:
             PARTIAL
             MONOCLONAL ANTIBODY
Our company needs this type of nested code for input so we can paste it into a database field we are testing. I have other concerns but I'll defer these to another forum question.
Regards.
Harold

[email protected] wrote:<br />> Thanks for the reply. That really helped! To build on this, I have another question which really gets to my dilemma.<br />> <br />> Is there a way to program a numeric text field to control the number of instances of a subform? For example, I would like to have a nested subform appear twice in the form if the user enters 2 in the numeric field. But more importantly, I would like to see its corresponding XML output appear like the following:<br />> <br />> <SUBUNIT_1><br />>    <LENGTH></LENGTH><br />>    <SEQUENCE><br />>        ELEESGGGLVQPGGRQSPEKGLETHYAE<br />>    </SEQUENCE><br />>    <N_TERMINAL>Yes</N_TERMINAL><br />>    <C_TERMINAL></C_TERMINAL><br />> </SUBUNIT_1><br />> <br />> <SUBUNIT_2><br />>    <LENGTH></LENGTH><br />>    <SEQUENCE><br />>        ELEESGGGLVQPGGRQSPEKGLETHYAE<br />>    </SEQUENCE><br />>    <N_TERMINAL>No</N_TERMINAL><br />>    <C_TERMINAL></C_TERMINAL><br />> </SUBUNIT_2><br />> <br />> If you pay close attention to the above code, you will see that I want the parent tag's ending digit incremented each time the subform is repeated. <SUBUNIT_1> <SUBUNIT_2> <SUBUNIT_3> ect . . .<br />> <br />> That is the twist! Is this programmatically possible?<br />> <br />> I might mention that the numeric field is not included as part of the subform. It is part of another subform.<br />> <br />> Regards.<br />> <br />> Harold<br /><br />I am going to respond to your question with another question.  Why do <br />you want to do it in this manner?  What you are trying to do is change <br />your XML schema on the fly.  In my opinion, this is not a good idea, <br />because the data is no longer consistent.  Couldn't you just add an <br />index attribute to your xml?  For example:<br />  <SUBUNIT><br />     <INDEX>1</INDEX><br />     <LENGTH></LENGTH><br />     <SEQUENCE><br />         ELEESGGGLVQPGGRQSPEKGLETHYAE<br />     </SEQUENCE><br />     <N_TERMINAL>Yes</N_TERMINAL><br />     <C_TERMINAL></C_TERMINAL><br />  </SUBUNIT><br />  <SUBUNIT><br />     <INDEX>2</INDEX><br />     <LENGTH></LENGTH><br />     <SEQUENCE><br />         ELEESGGGLVQPGGRQSPEKGLETHYAE<br />     </SEQUENCE><br />     <N_TERMINAL>No</N_TERMINAL><br />     <C_TERMINAL></C_TERMINAL><br />  </SUBUNIT><br /><br /><br />   Justin Klei<br />   Cardinal Solutions Group<br />   www.cardinalsolutions.com

Similar Messages

  • Unclosed meta/img tag. Output method= xml / xhtml / xml

    Hello,
    Im trying to parse from a Document to an String, in the usually way, as follows:
        public static String parseDocument(Document document) {
            try {
                if (document== null) {
                    return null;
                TransformerFactory tFactory =
                        TransformerFactory.newInstance();
                Transformer transformer = tFactory.newTransformer();
                DOMSource source = new DOMSource(document);
                StringWriter sw = new StringWriter();
                StreamResult result = new StreamResult(sw);
                transformer.transform(source, result);
                String xmlString = sw.toString();
                return xmlString;
    //TODO: error handling
            } catch (TransformerConfigurationException ex) {
                return null;
            } catch (TransformerException ex) {
                return null;
            } catch (Exception ex) {
                return null;
    }Ive maked a test that creates a Document:
      public static Document createFromDoc(){
            try {
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                DocumentBuilder builder = factory.newDocumentBuilder();
                DOMImplementation impl = builder.getDOMImplementation();
                Document doc = impl.createDocument(null, null, null);
                Element root = doc.createElement("html");
                doc.appendChild(root);
                Element head = doc.createElement("head");
                root.appendChild(head);
                Element meta = doc.createElement("meta");
                meta.setAttribute("http-equiv", "Content-Type");
                meta.setAttribute("content", "text/xml");
                meta.setAttribute("charset", "UTF-8");
                head.appendChild(meta);
                Element title = doc.createElement("title");
                head.appendChild(title);
                Element body = doc.createElement("body");
                root.appendChild(body);
                Element div = doc.createElement("div");
                div.appendChild(doc.createTextNode("Created with docs."));
                body.appendChild(div);
                return doc;
            } catch (ParserConfigurationException ex) {
                Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
                return null;
        }Well, you can see the test method "prueba1". Y:
        public static void prueba1(){
            Document doc1 = Main.createFromDoc();
            //String doc2 = Main.createFromString();
            String doc1Str = GestorXMLDoc.parseDocument(doc1);
            return;
        }Why my method public static String parseDocument(Document document) adds this extra meta tag when it transforms a Document to an String:
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
    and modifies the other meta tag as follows (I mean, unclosing it):
    <meta charset="UTF-8" content="text/xhtml" http-equiv="Content-Type">
    You can see the full String result:
    <html>
    <head>
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8" content="text/xhtml" http-equiv="Content-Type">
    <title></title>
    </head>
    <body>
    <div>Created with docs.</div>
    </body>
    </html>I tried parsing with a fake XSLT Template with output: XML, and it doesnt works. I tried changing the meta content data with "text/xml".
    This method makes the document not compatible with XML, because it doesnt close the meta tag. I need work with this XHTML doc as a valid XML document, not as a HTML (W3C allows set meta/link/img tags unclosed) to add new nodes.
    Thank you ppl =)

    First of all, what you are trying to do is transforming, not parsing. Parsing is converting an XML document into an internal form, and you already have the XML in the internal form (org.w3c.dom.Document).
    Anyway, XSLT has special rules for transforming a document whose root element's name is "html". It looks like those rules are being applied in your case. If you don't want them to be applied (which you don't if you are producing XHTML) then you have to tell the transformer you want XML as your output and not HTML.
    If you had an XSLT document you would use <xsl:output method="xml"/>, but you don't have one in this case. So you do it like this:
    transformer.setOutputProperty(OutputKeys.METHOD, "xml");

  • Import XML  Nested tags

    Hi all
    Here is my XML file structure
    <book>
    <section title="My Life">
    <p>
    <ol>
    <li>item 1</li>
    <li>item 2</li>
    <li>item 3</li>
    <li>item 4
        <ol>
            <li>item 1</li>
            <li>item 2</li>
            <li>item 3</li>
        </ol>
    </li>
    </ol>
    </p>
    </section>
    </book>
    I need to do two things from my XML file
    one
    I have a problem with importing my xml file. I have nested tags in my xml file. list inside list. While I am mapping tags to styles I am hang I can’t map different styles to my nested list 2nd level list. I am working with IDCS3. Is there any way to map my nested tag?
    in short
    list level One > Item 1
    TagName: <li>
    Paragraph style>ListIndentOne
    list level Two > Item 1
    TagName: <li>
    Paragraph style>ListIndentTwo
    two
    The next problem is I need to pint the value of my tag variables into indesign document is this is possible?
    <section title="My Life">
    I need to print the value of the variable value "My Life" as title style in my document.
    thanks in advance
    reagrds
    a r u l

    Hi all
    Here is my XML file structure
    <book>
    <section title="My Life">
    <p>
    <ol>
    <li>item 1</li>
    <li>item 2</li>
    <li>item 3</li>
    <li>item 4
        <ol>
            <li>item 1</li>
            <li>item 2</li>
            <li>item 3</li>
        </ol>
    </li>
    </ol>
    </p>
    </section>
    </book>
    I need to do two things from my XML file
    one
    I have a problem with importing my xml file. I have nested tags in my xml file. list inside list. While I am mapping tags to styles I am hang I can’t map different styles to my nested list 2nd level list. I am working with IDCS3. Is there any way to map my nested tag?
    in short
    list level One > Item 1
    TagName: <li>
    Paragraph style>ListIndentOne
    list level Two > Item 1
    TagName: <li>
    Paragraph style>ListIndentTwo
    two
    The next problem is I need to pint the value of my tag variables into indesign document is this is possible?
    <section title="My Life">
    I need to print the value of the variable value "My Life" as title style in my document.
    thanks in advance
    reagrds
    a r u l

  • Creating a list from the output of Xml parsing

    i extracted all the Folder name from the xml file.. (Thanks to Mr.Peter_vd_Wal..... [http://forums.sun.com/thread.jspa?threadID=5388524&tstart=0|http://forums.sun.com/thread.jspa?threadID=5388524&tstart=0] )
    the xml file is
    <?xml version="1.0"?>
    <folders>
      <folder><name>A</name><uid>C1</uid></folder>
      <folder><name>B</name><uid>C2</uid></folder>
      <folder><name>C</name><uid>C3</uid></folder>
      <folder><name>D</name><uid>C4</uid></folder>
      <folder><name>E</name><uid>C5</uid></folder>
    </folders>
    now i want create a list of folders form the output.
    i tried....
    public void endDocument() throws SAXException
        StringBuffer result = new StringBuffer();
        for (int i=0; i<nodes.size(); i++)
          Noden currentnode = (Noden)nodes.elementAt(i);
          result.append(" \"" + currentnode.getName() +  "\" ,");  
         midlet.alert(result.toString());
         System.out.println(result);
    ...........and
    protected void alert(String msg)
        Display display = Display.getDisplay(this);
       String[] stringElements = {msg};
        List list = new List("Listing",List.IMPLICIT,stringElements,null);
        display.setCurrent(list);
    ....the output i get is
    "A" , "B" , "C" , "D" , "E" ,i want a LIST of folders.... like
    A
    B
    C
    D
    Ebut i get all the folders as the first option in the list.
    > "A" , "B" , "C" , "D" , "E" ,

    ... i get all the folders as the first option in the list.
    "A" , "B" , "C" , "D" , "E" ,
    WYSIWYC (What You See Is What You Coded) - with code like your, above is the correct behavior.
    To make a list of folders, I'd rather try something like this....
    public void endDocument() throws SAXException
        String[] result = new String[nodes.size()];
        for (int i=0; i<nodes.size(); i++)
          Noden currentnode = (Noden)nodes.elementAt(i);
          result[i] = currentnode.getName();
          System.out.println(result);
    midlet.createAndDisplayList(result);
    System.out.println("createAndDisplayList called");
    and//.....
    protected void createAndDisplayList(String[] msg)
    Display display = Display.getDisplay(this);
    List list = new List("Listing", List.IMPLICIT, msg, null);
    display.setCurrent(list);

  • Archivelink smartforms - Is it possible create a link if the output is XML?

    Hello expert,
    I created a link between smartforms and archivelink ti archive my form.
    This link run ok.
    Now I changed my smartform's output. I put XML output, and the link is not created .
    Why, do you some idea ?
    I have to change some paramteres to continue to archive ?
    Tks,
    Roberto.

    it's not possible

  • JDom + XML (nested tags) + JTree (Swing)

    I have an XML file that looks like this:
    <root>
      <subtree>
        <a name="John Doe">Here is one big string with information about john doe</a>
        <a name="Tom Smith">Another string</a>
      </subtree>
      <subtree>
        <subtree>
            <a name="abc">mlsjkfqm</a>
        </subtree>
        <subtree>
            <a name="def">qsmdlfkj</a>
             <subtree>
                <a name="ghi">mqsldjkf</a>
                <a name="jkl">mqlsdfjkq</a>
             </subtree>
        </subtree>
      </subtree>
    </root>I want to have this XML file viewed in a JTree. I was told I should use a JTreeModel to store the data in, and org.JDom to parse the data and put them in the JTreeModel. But I still don't see how...
    Can anyone please put me in the right direction, or give some examples of similar examples?
    (I found examples on the web, but they all use trees like <root><node>qsdf</node><node>qsfqsdf</node><node>...</node></root>, so no nested nodes, and I have a difference between <subtree> and <a>...)
    Thanks in advance!

    I want to have this XML file viewed in a JTree. I was
    told I should use a JTreeModel to store the data in,
    and org.JDom to parse the data and put them in the
    JTreeModel. But I still don't see how...
    By writing an Adapter, a JDOMTreeModel class that implements TreeModel by using the JDOM API. Then, you could instantiate a JTree from that JDomTreeModel...

  • XML "Document" tag issue

    In my data xml file, I get data like this:
    <?xml version='1.0' encoding='UTF-8'?>
    <Document xmlns='urn:iso:std:iso:20022:tech:xsd:pain.002.001.02' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
    In Document tag, because of this: xmlns='urn:iso:std:iso:20022:tech:xsd:pain.002.001.02', the rtf doesn't show any output. But if I manually go data xml file and remove xmlns='urn:iso:std:iso:20022:tech:xsd:pain.002.001.02', then my data xml file will be like this:
    <?xml version='1.0' encoding='UTF-8'?>
    <Document xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
    This perfectly works for me. For testing purpose, I removed it (*xmlns='urn:iso:std:iso:20022:tech:xsd:pain.002.001.02'*). As the data file is from external source, I can't control always. Can someone pls help on this?
    Thanks,
    Mani

    I also have problem with 'Document' tag:
    My xsl is like :
    <?xml version="1.0" encoding="UTF-8" ?>
    <!-- $Header: XXMCK_FINLAND_SEPA_EFT_R51-58.xsl 2011/08/4 12:43:27 $ -->
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output omit-xml-declaration="no" />
    <xsl:output method="xml"/>
    <xsl:key name="contacts-by-LogicalGroupReference" match="OutboundPayment" use="PaymentNumber/LogicalGroupReference" />
    <xsl:template match="OutboundPaymentInstruction">
    <Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02 pain.001.001.02.xsd">
              <pain.001.001.02>
    Here in Document tag 2 lines are there, but in xml output these lines get reversed as shown below:
    <Document xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02 C:\XMLSPY~1\pain.001.001.02.xsd" xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    Can anybody plz help in this regard?

  • Error While trying to Get XML element(tag) Values

    We are trying to get XML element (TAG) value from the XML pay load.
    Example.
    Getting XML String from a web service and then converting into XML payload.
    ora:parseEscapedXML(bpws:getVariableData('signOn_Out','signOnReturn'))
    From this XML payload we are trying to get an element (Tag) value.
    We are getting following error
    Error in evaluate <from> expression at line "130". The result is empty for the XPath expression : "/client:TririgaProcessResponse/client:User/client:LastName".
    oracle.xml.parser.v2.XMLElement@118dc2a
    {http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown.
    - <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    - <part name="summary">
    <summary>
    empty variable/expression result.
    xpath variable/expression expression "/client:TririgaProcessResponse/client:User/client:LastName" is empty at line 130, when attempting reading/copying it.
    Please make sure the variable/expression result "/client:TririgaProcessResponse/client:User/client:LastName" is not empty.
    </summary>
    </part>
    </selectionFailure>
    Here are signOnReturn and XML Payload XSD's
    <schema attributeFormDefault="unqualified"
         elementFormDefault="qualified"
         targetNamespace="http://xmlns.oracle.com/Web1"
         xmlns="http://www.w3.org/2001/XMLSchema">
         <element name="Web1ProcessRequest">
              <complexType>
                   <sequence>
                        <element name="userName" type="string"/>
    <element name="password" type="string"/>
                   </sequence>
              </complexType>
         </element>
         <element name="Web1ProcessResponse">
              <complexType>
                   <sequence>
                        <element name="result" type="string"/>
                   </sequence>
              </complexType>
         </element>
    </schema>
    <?xml version="1.0" encoding="windows-1252" ?>
    <schema attributeFormDefault="unqualified"
         elementFormDefault="qualified"
         targetNamespace="http://xmlns.oracle.com/Web"
         xmlns="http://www.w3.org/2001/XMLSchema">
         <element name="TProcessResponse">
              <complexType>
                   <sequence>
                        <element name="result" type="string"/>
    <element name="User">
    <complexType>
                   <sequence>
                        <element name="Id" type="string"/>
    <element name="CompanyId" type="string"/>
    <element name="SecurityToken" type="string"/>
    <element name="FirstName" type="string"/>
    <element name="LastName" type="string"/>
    </sequence>
    </complexType>
    </element>
                   </sequence>
              </complexType>
         </element>
    </schema>

    I am sure and can see the data in audit trail.
    [2006/12/12 09:17:36]
    Updated variable "signOn_Output"
    - <signOn_Output>
    - <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
    - <WebMethodsProcessResponse xmlns="http://xmlns.oracle.com/WebMethods">
    <Result xmlns="">
    Success
    </Result>
    - <User xmlns="">
    <Id>
    2694069
    </Id>
    <CompanyId>
    208133
    </CompanyId>
    <SecurityToken>
    1165936654605
    </SecurityToken>
    <FirstName>
    Jagan
    </FirstName>
    <LastName>
    Rao
    </LastName>
    </User>
    </WebMethodsProcessResponse>
    </part>
    </signOn_Output>
    Copy details to clipboard
    [2006/12/12 09:17:36]
    Updated variable "tririga"
    - <tririga>
    - <TririgaProcessResponse xmlns="http://xmlns.oracle.com/WebMethods">
    <Result xmlns="">
    Success
    </Result>
    - <User xmlns="">
    <Id>
    2694069
    </Id>
    <CompanyId>
    208133
    </CompanyId>
    <SecurityToken>
    1165936654605
    </SecurityToken>
    <FirstName>
    Jagan
    </FirstName>
    <LastName>
    Rao
    </LastName>
    </User>
    </TririgaProcessResponse>
    </tririga>
    Copy details to clipboard
    [2006/12/12 09:17:36]
    Updated variable "Variable_2"
    - <Variable_2>
    - <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
    - <TririgaProcessResponse xmlns="http://xmlns.oracle.com/WebMethods">
    <Result xmlns="">
    Success
    </Result>
    - <User xmlns="">
    <Id>
    2694069
    </Id>
    <CompanyId>
    208133
    </CompanyId>
    <SecurityToken>
    1165936654605
    </SecurityToken>
    <FirstName>
    Jagan
    </FirstName>
    <LastName>
    Rao
    </LastName>
    </User>
    </TririgaProcessResponse>
    </part>
    </Variable_2>
    Copy details to clipboard
    [2006/12/12 09:17:36]
    Error in evaluate <from> expression at line "130". The result is empty for the XPath expression : "/client:TririgaProcessResponse/client:User/client:LastName".
    oracle.xml.parser.v2.XMLElement@1c8768e
    Copy details to clipboard
    [2006/12/12 09:17:36]
    "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown.
    - <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    - <part name="summary">
    <summary>
    empty variable/expression result.
    xpath variable/expression expression "/client:TririgaProcessResponse/client:User/client:LastName" is empty at line 130, when attempting reading/copying it.
    Please make sure the variable/expression result "/client:TririgaProcessResponse/client:User/client:LastName" is not empty.
    </summary>
    </part>
    </selectionFailure>
    Copy details to clipboard

  • How do I create XML output as string without the ?xml ? tag

    I need to create xml from a database query result. I am able to do this but it includes the <?xml ?> header tag. I need to create the xml without the header tag <?xml ?>. Please advise.
    Here is my source:
    package sql_test;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.*;
    import javax.xml.transform.dom.*;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import java.sql.*;
    public class SQLConnector {
         java.sql.Connection conn;
         public SQLConnector()
                conn = null;
                 try {
                         Class.forName("com.mysql.jdbc.Driver").newInstance();
                         conn = DriverManager.getConnection("jdbc:mysql://localhost/test", "admin", "admin");
                       } catch(Exception e) {
                         System.err.println("Exception: " + e.getMessage());
         public String getTestData()
              Document doc = null;
              Statement s = null;
              ResultSet rs = null;
              String str = null;
              try {
                   DocumentBuilderFactory factory =
                  DocumentBuilderFactory.newInstance();
                  DocumentBuilder builder = factory.newDocumentBuilder();
                  doc = builder.newDocument();
                  Element results = doc.createElement("Results");
                  doc.appendChild(results);
                   s = conn.createStatement();
                   s.executeQuery("select * from test_table");
                   rs = s.getResultSet ();
                  ResultSetMetaData rsmd = rs.getMetaData();
                  int colCount = rsmd.getColumnCount();
                    while (rs.next()) {
                        Element row = doc.createElement("Row");
                        results.appendChild(row);
                        for (int ii = 1; ii <= colCount; ii++) {
                           String columnName = rsmd.getColumnName(ii);
                           Object value = rs.getObject(ii);
                           Element node = doc.createElement(columnName);
                           node.appendChild(doc.createTextNode(value.toString()));
                           row.appendChild(node);
                  str = getDocumentAsXml(doc);
             catch (Exception e) {
                 e.printStackTrace();
             finally {
               try {
                 if (conn != null) conn.close();
                 if (s != null) s.close();
                 if (rs != null) rs.close();
               catch (Exception e) {
             return str;
         public static String getDocumentAsXml(Document doc) throws TransformerConfigurationException, TransformerException
              DOMSource domSource = new DOMSource(doc);
              TransformerFactory tf = TransformerFactory.newInstance();
              Transformer transformer = tf.newTransformer();
              transformer.setOutputProperty(OutputKeys.INDENT, "yes");
              java.io.StringWriter sw = new java.io.StringWriter();
              StreamResult sr = new StreamResult(sw);
              transformer.transform(domSource, sr);
              return sw.toString();
    }

    OutputKeys.OMIT_XML_DECLARATION

  • Creating the DTD tag in an XML Documento

    I am using the Xalan XLST Transformer to generate XML documents.
    I want to include a DTD tag in each XML file and in my programs I create it using the following code:
    DocumentType dt = documento.getImplementation().createDocumentType(nombreDTD, nombreDTD, nombreArchivo);
    documento.appendChild(dt);
    ..The variable documento is the root element of the document, nombreDTD is the name identifying the root element tag, nombreArchivo is the name of the DTD file I want to reference.
    However when the XML output is generated, the DTD tag is always missing.
    Do anybody have any idea what might be causing this?
    Thanks,
    Color

    XSLT has its own method of putting the DTD information in the XML it creates. Include an xsl:output element in your XSL transformation like this:
    <xsl:output doctype-public="..." doctype-system="..." />

  • Loading an XML with multiple nested tags

    I've got some problems dealing with loading a nested tags XML file.
    Let's suppose I have such a very simple myxml.xml file:
    <ROWDATA>
    <ROW>
      <EMPNO>7369</EMPNO>
      <ENAME>SMITH</ENAME>
       </ROW>
    <ROW>
      <EMPNO>7902</EMPNO>
      <ENAME>FORD</ENAME>
    </ROW>
    </ROWDATA>
    I can create the following table:
    create table EMP
    empno NUMBER(4) not null,
    ename VARCHAR2(10),
    and then inserting the XML file in this way:
    insert into EMP
        (empno, ename)
      select extractvalue (column_value, '/ROW/EMPNO'),
          extractvalue (column_value, '/ROW/ENAME'),
      from   table
               (xmlsequence
              (extract
               (xmltype
                 (bfilename ('MY_DIR', 'myxml.xml'),
                   nls_charset_id ('AL32UTF8')),
                 '/ROWDATA/ROW')))
    so as to get inserted two rows into my table:
    EMPNO   ENAME
    7369         SMITH
    7902         FORD
    Now, and this is my question, let's suppose I have such a “more difficult” XML:
    <ROWDATA>
    <ROW>
      <COMPANY>
        <EMPNO>7369</EMPNO>
        <ENAME>SMITH</ENAME>
        <EMPNO>1111</EMPNO>
        <ENAME>TAYLOR</ENAME>
      </COMPANY>
    </ROW>
    <ROW>
      <COMPANY>
       <EMPNO>7902</EMPNO>
       <ENAME>FORD</ENAME>
      </COMPANY>
    </ROW>
    <ROW>
      <COMPANY>
      </COMPANY>
    </ROW>
    </ROWDATA>
    In this case it seems to me things look harder 'cause for every row that I should insert into my table, I don't know how many “empno” and “ename” I'll find for each /ROW/COMPANY and so how could I define a table since the number of empno and ename columns are “unknown”?
    According to you, in that case should I load the whole XML file in an unique XMLType column and than “managing” its content by using EXTRACT and EXTRACTVALUE built-in funcions? But this looks a very difficult job.
    My Oracle version is 10gR2 Express Edition
    Thanks in advance!

    Here's a possible solution using a single pass through the XML data :
    with sample_data as (
      select xmltype(
        '<ROWDATA>
        <ROW>
          <COMPANY>
            <EMPNO>7369</EMPNO>
            <ENAME>SMITH</ENAME>
            <EMPNO>1111</EMPNO>
            <ENAME>TAYLOR</ENAME>
          </COMPANY>
        </ROW>
        <ROW>
          <COMPANY>
           <EMPNO>7902</EMPNO>
           <ENAME>FORD</ENAME>
          </COMPANY>
        </ROW> 
      </ROWDATA>'
      ) doc
      from dual
    select min(case when node_name = 'EMPNO' then node_value end) as empno
         , min(case when node_name = 'ENAME' then node_value end) as ename
    from (
      select trunc((rownum-1)/2) as rn
           , extractvalue(value(x), '.') as node_value
           , value(x).getrootelement() as node_name
      from sample_data t
         , table(
             xmlsequence(extract(t.doc, '/ROWDATA/ROW/COMPANY/*'))
           ) x
    group by rn ;
    I would be cautious with this approach though, as I'm not sure the ROWNUM projection is entirely deterministic.
    As Jason said, it's probably safer to first apply a transformation in order to get a more friendly format.
    For example :
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:template match="node()|@*">
        <xsl:copy>
          <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
      </xsl:template>
      <xsl:template match="COMPANY">
        <xsl:apply-templates select="EMPNO"/>
      </xsl:template>
      <xsl:template match="EMPNO">
        <EMP>
          <xsl:copy-of select="."/>
          <xsl:copy-of select="following-sibling::ENAME[1]"/>
        </EMP>
      </xsl:template>
    </xsl:stylesheet>

  • Creating a text output using XML Publisher

    Hi All,
    Recently i created a  report for my client using XMl Publisher. The Data Definition was XML and the template type was RTF and i got the output in a PDF format. All was going smoothly until the client decided at the last moment that they wanted to print this in a dot matrix printer!
    I've read some articles on XSL- Text layout templates. But i can't get my head around it (I'm Functio-Technical as opposed to Techno-Functional )
    How do i convert my RTF template to give me a text output?
    Miranga

    From what I know, you will have to create another template based on "XSL" layout or eText layout (both of them require different coding methods). The RTF can not create text outputs even in 11g. This is based on my experience so far. You can create RTF output (available by default) based on the current layout that you use for PDF and see if it can be printed in a dot matrix printer though.

  • How to Create MultiSheet Excel Report Output in XML Publisher in Oracle R12

    Dear All,
    How to Create MultiSheet Excel Report Output in XML Publisher in Oracle R12.
    My Requirement is to develop RTF Template and geneate Excel output in Multiple sheet.
    plz guide me on this..
    thnx
    Khushal

    plz see
    BI Publisher: How to create Multisheet in Single Excel file using Excel Template [ID 1352000.1]
    for r12 you can use excel template
    i think it more appropriate for excel output

  • Is it possible to create a Webservice in BI which takes XML as an input and gives PDF as output with an additional requirement that Siebel expecting the XSD from BI to send data in the BI requested format

    Is it possible to create a Webservice in BI which takes XML as an input and gives PDF as output with an additional requirement that Siebel expecting the XSD from BI to send data in the BI requested format. Siebel wants to send the data as xml to BI but not sure of the BI capabilities on giving WSDL embedded with XSD (input is a hierarchical)

    Hi All,
    I am able to fulfil above requirement. Now I am stuck at below point. Need your help!
    Is there any way to UPDATE the XML file attached to a Data Definition (XML Publisher > Data Definition) using a standard package or procedure call or may be an API from backend? I am creating an XML dynamically and I want to attach it to its Data Definition programmatically using SQL.
    Please let me know if there is any oracle functionality to do this.
    If not, please let me know the standard directories on application/database server where the XML files attached to Data Definitions are stored.
    For eg, /$APPL_TOP/ar/1.0/sql or something.
    Regards,
    Swapnil K.

  • Can't get the DOM to output XML document tags in correct order.

    I'm trying to output an XML document from the DOM using the DOMWriter class: new DOMWriter(document, filename, outputEncoding, encodingTag, getDocTypeString());
    It refuses to output the tags in the correct order so my document always fails validation when it is read back in. I've tried explicitly placing the elements in the correct order into the DOM and it still outputs them the way it wants to. Is there some method I'm missing to set the xsd or dtd to validate the output on. It actually appears as though it has a definite idea as to what order the tags should be output, because no matter what order I append the nodes into the document, it always outputs them in the same incorrect order. I've got the validation working when it reads the document in. Does anyone know what I have to do to get it to output the tags in the correct order?

    Does anyone know what I
    have to do to get it to output the tags in the correct
    order?You have to build the DOM in the correct way. Based on the code you posted it's impossible to tell what you are doing wrong. How about posting some code?

Maybe you are looking for

  • Nokia N97 - My laptop does not recognize my n97 se...

    Hi there please help me! I just bought N97, for a couple of days it worked wonderful but today my laptop won't recognise the mobile. I tried it on other computers but still the same. When I select "pc suite" it doesn't recognise my mobile even with O

  • For financial report requirment can we consider secondary cost element cost

    For financial reporting requirment can we consider secondary cost element cost to profit and loss a/c

  • What is the Bluray Stream option for in Mpeg2 preset?

    I just noticed by accident that in the mpeg2 preset quality tab when I clicked the SD DVD drop-down box that there is an option to create a bluray stream. Am I correct to assume therefore that it is possible to create a bluray mpeg2 file direct from

  • Error parsing feed: invalid xml

    Just got an email yesterday that my podcast was taken down due to technical problems. But it was fine for the last 3 years. I use feedburner and everything seems to be fine on their side. my feed is http://feeds.feedburner.com/bolttalk Apple please h

  • How to use S-VIdeo to SCART lead?

    I've just bought a monster S-VIdeo to SCART lead to enable me to watch PC out-put on TV screen. Pluged in but nothing works. Tried on second TV (all singing/dancing posh one self diagnosing). Still no joy... Any suggestions apprecaited apart from thr