Sorting xml document with xsl

How can I sort below xml on empNo using xsl, I want an output to be in xml format.
<employeeList>
<employee empNo=1000>
<Info >
<fname></fname>
<lname></lname>
</Info>
</employee>
<employee empNo=1001>
<Info >
<fname></fname>
<lname></lname>
</Info>
</employee>
</employeeList>
Can any one tell me the xsl for above.......
Thanks in advance

Hi,
Your xml is not well-formed. Attributes have to be enclosed in double quotes.
You can use the following stylesheet.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:output method="xml"></xsl:output>
          <xsl:template match="/employeeList">
          <employeeList>
          <xsl:apply-templates select="employee">
          <xsl:sort select="@empNo"/>
          </xsl:apply-templates>
          </employeeList>
          </xsl:template>
     <xsl:template match="employee">
     <xsl:copy-of select="."/>
     </xsl:template>
</xsl:stylesheet>

Similar Messages

  • XML Parsing with XSL Performance lag

    Hi there
    I should qualify this post by saying I am fairly new to EJB's and have based the below on a Java Working with XML Tutorial I read.
    I have an EJB which is being developed to parse XML documents with an XSL stylesheet and return HTML for display. The code is working fine however there is a fairly hefty performance lag when using the EJB to generate the HTML as opposed to the straight HTML. I am getting an average response time of 95000ms using the EJB as opposed to 45000ms when viewing the straight HTML. The code I am using to do the parsing is :
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(dataFile);
    // Convert docs into StreamSource
    StreamSource stylesource = new StreamSource(styleSheet);
    StreamSource source = new StreamSource(dataFile);
    StringWriter strWrite = new StringWriter();
    StreamResult result = new StreamResult(strWrite);
    // Use a Transformer for output
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer(stylesource);
    transformer.transform(source, result);
    There is then some error handling and the strWrite object is placed into an array to be returned.
    I am really looking to find out if the performance lag I am experiencing is normal or if there is anything I can do to improve the speed of the code.
    All comments and help is most appreciated.
    Cheers
    Justin.

    You should be able to increase performance by caching Templates objects in memory as a previous post suggested.
    Here is some untested code:public final class TransformerCache
         private static Map cache = new Vector();
         private TransformerCache(){}
         public static Transformer getTransformer( String filename )
              if( ! cache.containsKey( filename ) )
                   TransformerFactory tf = TransformerFactory.newInstance();
                   Templates template = tf.newTemplates( new StreamSource( filename ) );
                   cache.put( filename, template );     
              return ( ( Templates ) cache.get( filename ) ).newTransformer();
    }This aproach works in a clustered environment, just bear in ming that there will be an instance of the cache on each server instance (virtual machine).

  • Transfer 100M XML file with XSL

    Hi,
    I am trying to transfer 100M XML file with XSL. Input.xml is the XML file, format.xsl is the XSL file. I type in the command line as:
    java org.apache.xalan.xslt.Process -IN input.xml -XSL format.xsl -OUT output.xml
    It got "out of memeory" error. My questions are:
    1. Is it possible to transfer such large XML file with XSLT?
    2. The XSL processor used SAX or DOM to parse XML file?
    3. Any suggestions?
    Thanks.
    James

    maybe?
    java -Xmx200m org.apache.xalan.xslt.Process -IN input.xml -XSL format.xsl -OUT output.xml
    http://java.sun.com/j2se/1.3/docs/tooldocs/win32/java-classic.html

  • Open XML document with proper layout

    Hi,
    I created my own XML form and I have problem when accessing the document within "KM Content".
    Indeed, when I click on the XML file generated by the XML Form it doesn't render it with the "Show" form but rather displays it as an usual XML document (with all its tags).
    Hint:
    I linked my iView to a custom CM repository. But, if I link my iView containing the XML Form to the out-of-the-box CM repository "/documents", it works fine.
    What should I do to make this work?
    Thanks in advance,
    Eric

    Hi Eric,
    in the Configuration under 'System Administration' -> 'System Configuration' -> 'Knowledge Management' -> 'Content Management' -> 'Repository Filters' you can find a filter named 'xmlforms_filter'. Some repositories are registered for this filter (in the standard e.g. documents). You should add your repositoriy here. After that the files in your repository should use the Show-form when being displayed.
    Hope this helps
    Karin

  • Please help; how to write XML document with JSP?

    I try to write XML document with JSP...
    But I got wrong results everytime.
    The result is not XML file displayed in the browser,
    but HTML file.
    I even tried to use HTML special code for <, >, "
    but still display as HTML file not XML file.
    How to do this?
    Thanks in advance. I put my codes below.
    Sincerely,
    Ted.
    ================
    Here is code for the JSP (called stk.jsp):
    <%@ page contentType="text/xml" %>
    <%@ page import="bean.Stock" %>
    <jsp:useBean id="portfolio" class="bean.Portfolio" />
    <% java.util.Iterator pfolio = portfolio.getPortfolio();
    Stock stock = null; %>
    <?xml version="1.0" encoding="UTF-8"?>
    <portfolio>
    <% while (pfolio.hasNext())
    stock = (Stock) pfolio.next(); %>
    <stock>
    <symbol>
    <%=stock.getSymbol() %>
    </symbol>
    <name><%=stock.getName() %> </name>
    <price><%=stock.getPrice() %> </price>
    </stock>
    <% } %>
    </portfolio>
    =================
    Here is the code for bean.Stock:
    package bean;
    public class Stock implements java.io.Serializable
    String symbol, name;
    float price;
    public Stock(String symbol, String name, float price)
    this.symbol = symbol;
    this.name = name;
    this.price = price;
    public String getSymbol()
    return symbol;
    public String getName()
    return name;
    public float getPrice()
    return price;
    ===============
    And here is bean.Portfolio:
    package bean;
    import java.util.Iterator;
    import java.util.Vector;
    public class Portfolio implements java.io.Serializable
    private Vector portfolio = new Vector();
    public Portfolio()
    portfolio.addElement(new Stock("SUNW", "Sun Microsystem", 34.5f));
    portfolio.addElement(new Stock("HWP", "Hewlett Packard", 15.15f));
    portfolio.addElement(new Stock("AMCC", "Applied Micro Circuit Corp.", 101.35f));
    public Iterator getPortfolio()
    return portfolio.iterator();
    }

    Hi
    I'm not sure whta your query is but I tested your code as it is has been pasted and it seems to work fine. There is an XML output that I'm getting.
    Keep me posted.
    Good Luck!
    Eshwar Rao
    Developer Technical Support
    Sun microsystems
    http://www.sun.com/developers/support

  • Split XML files with XSL result document

    Hi All,
    I have below xml file...
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <T0020
    xsi:schemaLocation="http://www.safersys.org/namespaces/T0020V1 T0020V1.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.safersys.org/namespaces/T0020V1">
    <INTERFACE>
    <NAME>SAFER</NAME>
    <VERSION>04.02</VERSION>
    </INTERFACE>
    <TRANSACTION>
    <VERSION>01.00</VERSION>
    <OPERATION>REPLACE</OPERATION>
    <DATE_TIME>2009-09-01T00:00:00</DATE_TIME>
    <TZ>CT</TZ>
    </TRANSACTION>
    <IRP_ACCOUNT>
    <IRP_CARRIER_ID_NUMBER>274845</IRP_CARRIER_ID_NUMBER>
    <IRP_BASE_COUNTRY>US</IRP_BASE_COUNTRY>
    <IRP_BASE_STATE>AR</IRP_BASE_STATE>
    <IRP_ACCOUNT_NUMBER>55002</IRP_ACCOUNT_NUMBER>
    <IRP_ACCOUNT_TYPE>I</IRP_ACCOUNT_TYPE>
    <IRP_STATUS_CODE>100</IRP_STATUS_CODE>
    <IRP_STATUS_DATE>2007-11-06</IRP_STATUS_DATE>
    <IRP_UPDATE_DATE>2009-08-03</IRP_UPDATE_DATE>
    <IRP_NAME>
    <NAME_TYPE>LG</NAME_TYPE>
    <NAME>A P SUPPLY CO</NAME>
    <IRP_ADDRESS>
    <ADDRESS_TYPE>PH</ADDRESS_TYPE>
    <STREET_LINE_1>1400 N OATS</STREET_LINE_1>
    <STREET_LINE_2/>
    <CITY>TEXARKANA</CITY>
    <STATE>AR</STATE>
    <ZIP_CODE>71854</ZIP_CODE>
    <COUNTY>MILLER</COUNTY>
    <COLONIA/>
    <COUNTRY>US</COUNTRY>
    </IRP_ADDRESS>
    <IRP_ADDRESS>
    <ADDRESS_TYPE>MA</ADDRESS_TYPE>
    <STREET_LINE_1>P O BOX 1927</STREET_LINE_1>
    <STREET_LINE_2/>
    <CITY>TEXARKANA</CITY>
    <STATE>AR</STATE>
    <ZIP_CODE>75504</ZIP_CODE>
    <COUNTY/>
    <COLONIA/>
    <COUNTRY>US</COUNTRY>
    </IRP_ADDRESS>
    </IRP_NAME>
    </IRP_ACCOUNT>
    <IRP_ACCOUNT> ..... </IRP_ACCOUNT>
    <IRP_ACCOUNT> ..... </IRP_ACCOUNT>
    <IRP_ACCOUNT> ..... </IRP_ACCOUNT>
    </T0020>
    and i want to take this xml file and split it into multiple files through java code like this ...
    File1.xml
    <T0020>
    <IRP_ACCOUNT> ..... </IRP_ACCOUNT>
    <IRP_ACCOUNT> ..... </IRP_ACCOUNT>
    </T0020>
    File2.xml
    <T0020>
    <IRP_ACCOUNT> ..... </IRP_ACCOUNT>
    <IRP_ACCOUNT> ..... </IRP_ACCOUNT>
    </T0020>
    so i have applied following xslt ...
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:t="http://www.safersys.org/namespaces/T0020V1" version="2.0">
    <xsl:output method="xml" indent="yes" name="xml" />
    <xsl:variable name="accounts" select="t:T0020/t:IRP_ACCOUNT" />
    <xsl:variable name="size" select="10" />
    <xsl:template match="/">
    <xsl:for-each select="$accounts[position() mod $size = 1]">
    <xsl:variable name="filename" select="resolve-uri(concat('output/',position(),'.xml'))" />
    <xsl:result-document href="{$filename}" format="xml">
    <T0020>
    <xsl:for-each select=". | following-sibling::t:IRP_ACCOUNT[position() < $size]">
    <xsl:copy-of select="." />
    </xsl:for-each>
    </T0020>
    </xsl:result-document>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    Now i want to apply this XSL to xml through Java Code...
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xslSource = new StreamSource(xslFilePath);
    Transformer trans = tFactory.newTransformer(xslSource);
    trans.transform(new StreamSource(xmlFileName), new StreamResult( ????));
    here how can i map new StreamResult( ) input parameter with xsl Result document argument ??
    Please help me.....
    Or Can you give me a link of Example which use result document and Java transform method to Output multiple doucment ??
    Here new StreamResult take only 1 file as to be transformed ....

    hi Tejas ,
    I have done as you said but now able to generate multiple xml file .
    I am giving you the xsl file i have used ....
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:t="http://www.safersys.org/namespaces/T0020V1" version="2.0">
         <xsl:output method="xml" indent="yes" name="xml" />
         <xsl:variable name="accounts" select="t:T0020/t:IRP_ACCOUNT" />
         <xsl:variable name="size" select="5" />
         <xsl:template match="/">
              <xsl:for-each select="$accounts[position() mod $size = 1]">
                   <xsl:variable name="filename" select="concat(position(),'.xml')" />
                        <xsl:result-document href="{$filename}" format="xml">
                             <T0020>
                                  <xsl:for-each select=". | following-sibling::t:IRP_ACCOUNT[position() < $size]">
                                       <xsl:copy-of select="." />
                                  </xsl:for-each>                              
                             </T0020>
                        </xsl:result-document>                    
              </xsl:for-each>
         </xsl:template>
    </xsl:stylesheet>
    and i have done transformation like this ...
    Transformer trans = tFactory.newTransformer(xslSource);
    trans.transform(new StreamSource(xmlFileName), new DOMResult());
    but not getting any result .
    Can you please help me out ?
    - Nisarg

  • Updating a XML document with a processing instruction

    Greetings Guru's
    I have a fully functional XML database solution for our new system. The only thing left is for me to update a xml document in the database with a processing instruction to find the style sheet (JAXB strips it out when the XML must go back into the database).
    I can update complete nodes and node elements in the xml document using updateXML in a regular update statement, but I do not know how to add the following processing instruction to my documents.
    <?xml-stylesheet type="text/xsl" href="/RASWEB/JIT_REPORT.xslt"?>
    [pre]
    Thanks in advance
    Derrick                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    SQL> var xmltext varchar2(4000)
    SQL> --
    SQL> begin
      2    :xmlText := '<Hello>World</Hello>';
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SQL> drop table t
      2  /
    drop table t
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> create table t of xmltype
      2  /
    Table created.
    SQL> set long 10000
    SQL> --
    SQL> insert into t values (xmltype(:xmltext))
      2  /
    1 row created.
    SQL> select *
      2    from t
      3  /
    SYS_NC_ROWINFO$
    <Hello>World</Hello>
    SQL> update t set object_value = updateXML
      2                              (
      3                                object_value,
      4                                '/',
      5                                xmlconcat
      6                                (
      7                                  xmlpi("xml-stylesheet",'type="text/xsl" href="/RASWEB/JIT_REPORT.xslt"'),
      8                                  object_value
      9                                )
    10                              )
    11  /
    1 row updated.
    SQL> select * from t
      2  /
    SYS_NC_ROWINFO$
    <?xml-stylesheet type="text/xsl" href="/RASWEB/JIT_REPORT.xslt"?>
    <Hello>World</Hello>
    SQL>

  • Is there a way to modify the style sheet so that it transforms an XML document with empty tags as tag / ?

    I have extracted some code from codeproject to
    reindent an XML document. Does anyone know how I can modify the stylesheet to make it so that the transform of an XML file will result in empty tags showing up as <tag /> instead of <tag></tag>?
    // http://www.codeproject.com/Articles/43309/How-to-create-a-simple-XML-file-using-MSXML-in-C
    MSXML2::IXMLDOMDocumentPtr FormatDOMDocument(MSXML2::IXMLDOMDocumentPtr pDoc)
    LPCSTR const static szStyleSheet =
    R"!(<?xml version="1.0" encoding="utf-8"?>)!"
    R"!(<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">)!"
    R"!( <xsl:output method="xml" indent="yes"/>)!"
    R"!( <xsl:template match="@* | node()">)!"
    R"!( <xsl:copy>)!"
    R"!( <xsl:apply-templates select="@* | node()"/>)!"
    R"!( </xsl:copy>)!"
    R"!( </xsl:template>)!"
    R"!(</xsl:stylesheet>)!";
    MSXML2::IXMLDOMDocumentPtr pXmlStyleSheet;
    pXmlStyleSheet.CreateInstance(__uuidof(MSXML2::DOMDocument60));
    pXmlStyleSheet->loadXML(szStyleSheet);
    MSXML2::IXMLDOMDocumentPtr pXmlFormattedDoc;
    pXmlFormattedDoc.CreateInstance(__uuidof(MSXML2::DOMDocument60));
    CComPtr<IDispatch> pDispatch;
    HRESULT hr = pXmlFormattedDoc->QueryInterface(IID_IDispatch, (void**)&pDispatch);
    if (SUCCEEDED(hr))
    _variant_t vtOutObject;
    vtOutObject.vt = VT_DISPATCH;
    vtOutObject.pdispVal = pDispatch;
    vtOutObject.pdispVal->AddRef();
    hr = pDoc->transformNodeToObject(pXmlStyleSheet, vtOutObject);
    //By default it is writing the encoding = UTF-16. Let us change the encoding to UTF-8
    // <?xml version="1.0" encoding="UTF-8"?>
    MSXML2::IXMLDOMNodePtr pXMLFirstChild = pXmlFormattedDoc->GetfirstChild();
    // A map of the a attributes (vesrsion, encoding) values (1.0, UTF-8) pair
    MSXML2::IXMLDOMNamedNodeMapPtr pXMLAttributeMap = pXMLFirstChild->Getattributes();
    MSXML2::IXMLDOMNodePtr pXMLEncodNode = pXMLAttributeMap->getNamedItem(_T("encoding"));
    pXMLEncodNode->PutnodeValue(_T("UTF-8")); //encoding = UTF-8
    return pXmlFormattedDoc;
    Or, if there is some other method for reindenting a MSXML2::IXMLDOMDocumentPtr object where I can specify how I want empty tags to be stored, that would be great too.  However, I don't want it to lose its status of an MSXML2::IXMLDOMDocumentPtr object.
     I.e. I would like to still perform operations on the result as if it was still an MSXML2::IXMLDOMDocumentPtr object.
    Thanks,
    A
    Adrian

    If anyone is interested, I got an answer on StackOverflow
    here.
    Adrian

  • How to search for a text node with a particular value in an xml document with labview

    supposing i have the following xml document:
    <head>
    <book>
    <bookname>zio</bookname>
    <author>dan</author>
    </book>
    <book>
    <bookname>the spear warrior</bookname>
    <author>britney</author>
    </book>
    <book>
    <bookname>the beard</bookname>
    <author>derrick</author>
    </book>
    </head>
    i want to search for the author of the book "the beard" using for example the V.I Get first match  of labview to access the the node with value "the beard" and then use Get next sibling  V.I  and Get node text content to get get the author of this book..so my question is how do i write the xpath expression for Get first match so as to access the node with bookname "the beard" instantyly?  am trying to minimise the use of loops because they increase the time duration,..thank you (NB:i dont want to use Get all Matched V.I because it obliges me to use a loop in order to access the name derrick and this increases the time duration for my v.i)
    Solved!
    Go to Solution.

    Since it's all text, why not use a real quick Match Pattern (or Regular Expression, but you don't need that much power here), see attached.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ
    Attachments:
    Two-stage match demo.vi ‏8 KB

  • Problem when trying to load an XML document with DTD or XML SCHEMA

    Hello
    I have tried to load an XML document in Data Services, and I created the xsd file and Dtd file. (With altova xml spy software automatically) to import into SAP Data Services 3.2. .
    In Data Services I created the dtd import file DTD and then called the XML file from the DTD (the xml file is validated vs the dtd file), and I could not read the xml correctly because it tells me that an ELEMENT called <item> expected joiners who did not come in the structure of import (dtd), but if the xml.
    I understand that the document root is the label: CUSTOMER_FULL_2014, the data flow is as follows:CARGA_XML_CUSTOMER |
    Turns out the joiners element is used to separate the xml elements are repeated, but is used at different levels. My idea is that the design will dtd second, or something I'm missing or is incorrectly stated.
    Thank you.
    xml
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    <?xml version="1.0" encoding="utf-8"?>
    <CUSTOMER_FULL_2014>
      <item>
      <CUST_NO>202222</CUST_NO>
      <ADDRESS>
      <item>
      <SHIP_TO>202222</SHIP_TO>
      <NAME1>Henley.</NAME1>
      <STREET>Vitacura #40</STREET>
      <CITY>LIMA</CITY>
      </item>
      </ADDRESS>
      <EQUIPMENT>
      <item>
      <EQUI_NO>81623</EQUI_NO>
      </item>
      <item>
      <EQUI_NO>81633</EQUI_NO>
      </item>
      <item>
      <EQUI_NO>81993</EQUI_NO>
      </item>
      <item>
      <EQUI_NO>82003</EQUI_NO>
      </item>
      <item>
      <EQUI_NO>82013</EQUI_NO>
      </item>
      <item>
      <EQUI_NO>82103</EQUI_NO>
      </item>
      <item>
      <EQUI_NO>82113</EQUI_NO>
      </item>
      <item>
      <EQUI_NO>581203</EQUI_NO>
      </item>
      <item>
      <EQUI_NO>900003-EMER</EQUI_NO>
      </item>
      <item>
      <EQUI_NO>9000033-STOCK</EQUI_NO>
      </item>
      </EQUIPMENT>
      <STORAGE_LOC>
      <item>
      <STOR_LOC_NO>0001</STOR_LOC_NO>
      <DESCRIPTION>01 Parts Center</DESCRIPTION>
      </item>
      <item>
      <STOR_LOC_NO>0056</STOR_LOC_NO>
      <DESCRIPTION>56 henley</DESCRIPTION>
      </item>
      </STORAGE_LOC>
      </item>
      <item>
      <CUST_NO>2007933434343</CUST_NO>
      <ADDRESS>
      <item>
      <SHIP_TO>2007933434343</SHIP_TO>
      <NAME1>Campos de Almacenaje SA</NAME1>
      <STREET>Calacoto2, Calle 1</STREET>
      <HOUSE_NO>Piso 1</HOUSE_NO>
      <CITY>La Paz</CITY>
      </item>
      </ADDRESS>
      <EQUIPMENT>
      <item>
      <EQUI_NO>90000-EMER</EQUI_NO>
      </item>
      <item>
      <EQUI_NO>90000333-STOCK</EQUI_NO>
      </item>
      </EQUIPMENT>
      <STORAGE_LOC>
      <item>
      <STOR_LOC_NO>00012</STOR_LOC_NO>
      <DESCRIPTION>01 Parts Center</DESCRIPTION>
      </item>
      <item>
      <STOR_LOC_NO>0056</STOR_LOC_NO>
      <DESCRIPTION>56 henley</DESCRIPTION>
      </item>
      </STORAGE_LOC>
      </item>
      <item>
      <CUST_NO>200801333</CUST_NO>
      <ADDRESS>
      <item>
      <SHIP_TO>200801333</SHIP_TO>
      <NAME1>CONSTRUCTORA SA.</NAME1>
      <STREET>Ruta Panamericana Km 100</STREET>
      <CITY>San Antonio 23</CITY>
      </item>
      </ADDRESS>
      <EQUIPMENT>
      <item>
      <EQUI_NO>1507933</EQUI_NO>
      </item>
      <item>
      <EQUI_NO>1509733</EQUI_NO>
      </item>
      <item>
      <EQUI_NO>90000-EMER</EQUI_NO>
      </item>
      <item>
      <EQUI_NO>90000333-STOCK</EQUI_NO>
      </item>
      </EQUIPMENT>
      <STORAGE_LOC>
      <item>
      <STOR_LOC_NO>0001</STOR_LOC_NO>
      <DESCRIPTION>01 Parts Center</DESCRIPTION>
      </item>
      <item>
      <STOR_LOC_NO>0056</STOR_LOC_NO>
      <DESCRIPTION>56 henley</DESCRIPTION>
      </item>
      </STORAGE_LOC>
      </item>
    </CUSTOMER_FULL_2014>
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ARCHIVO DTD CREADO (automáticamente con xml spy)
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- DTD generado con XMLSpy v2014 rel. 2 (x64) (http://www.altova.com) -->
    <!ELEMENT CITY (#PCDATA)>
    <!ELEMENT item ((SHIP_TO, NAME1, STREET, HOUSE_NO?, CITY) | (CUST_NO, ADDRESS, EQUIPMENT, STORAGE_LOC) | (STOR_LOC_NO, DESCRIPTION) | EQUI_NO)>
    <!ELEMENT NAME1 (#PCDATA)>
    <!ELEMENT STREET (#PCDATA)>
    <!ELEMENT ADDRESS (item)>
    <!ELEMENT CUST_NO (#PCDATA)>
    <!ELEMENT EQUI_NO (#PCDATA)>
    <!ELEMENT SHIP_TO (#PCDATA)>
    <!ELEMENT HOUSE_NO (#PCDATA)>
    <!ELEMENT EQUIPMENT (item+)>
    <!ELEMENT DESCRIPTION (#PCDATA)>
    <!ELEMENT STORAGE_LOC (item+)>
    <!ELEMENT STOR_LOC_NO (#PCDATA)>
    <!ELEMENT CUSTOMER_FULL_2014 (item+)>
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    The error of MONITOR Data Services
    11676
    5184
    XML-240108
    11-04-2014 17:34:16
    |Data flow CARGA_XML_CUSTOMER|Reader READ MESSAGE customer OUTPUT(customer)
    11676
    5184
    XML-240108
    11-04-2014 17:34:16
    An element named <item> present in the XML data input does not exist in the XML format used to set up this XML source in data
    11676
    5184
    XML-240108
    11-04-2014 17:34:16
    flow <CARGA_XML_CUSTOMER>. Please validate your XML data.
    11676
    5184
    XML-240307
    11-04-2014 17:34:16
    |Data flow CARGA_XML_CUSTOMER|Reader READ MESSAGE customer OUTPUT(customer)
    11676
    5184
    XML-240307
    11-04-2014 17:34:16
    XML parser failed: See previously displayed error message.
    The Error from Monitor
    The metadata DTD
    Thanks
    Juan

    Hi Juan Juan,
    I generated a new XSD file using MS Visual Studio based on your XML file.
    The empty spaces in the source is replaced with <Null> in the target table.
    Here is the XSD:
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <xs:element name="CUSTOMER_FULL_20140207_033015_001">
            <xs:complexType>
                <xs:sequence>
                    <xs:choice maxOccurs="unbounded">
                        <xs:element name="CUST_NO" type="xs:unsignedInt" />
                        <xs:element name="ADDRESS">
                            <xs:complexType>
                                <xs:sequence>
                                    <xs:element name="SHIP_TO" type="xs:unsignedInt" />
                                    <xs:element name="NAME1" type="xs:string" />
                                    <xs:element name="STREET" type="xs:string" />
                                    <xs:element minOccurs="0" name="HOUSE_NO" type="xs:string" />
                                    <xs:element name="CITY" type="xs:string" />
                                </xs:sequence>
                            </xs:complexType>
                        </xs:element>
                        <xs:element name="EQUIPMENT">
                            <xs:complexType>
                                <xs:sequence>
                                    <xs:element maxOccurs="unbounded" name="EQUI_NO" type="xs:string" />
                                </xs:sequence>
                            </xs:complexType>
                        </xs:element>
                        <xs:element name="STORAGE_LOC">
                            <xs:complexType>
                                <xs:sequence>
                                    <xs:choice maxOccurs="unbounded">
                                        <xs:element name="STOR_LOC_NO" type="xs:unsignedByte" />
                                        <xs:element name="DESCRIPTION" type="xs:string" />
                                    </xs:choice>
                                </xs:sequence>
                            </xs:complexType>
                        </xs:element>
                    </xs:choice>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
    </xs:schema>
    For Source XML
    <?xml version="1.0" encoding="utf-8"?>
    <CUSTOMER_FULL_20140207_033015_001>
      <CUST_NO>200530</CUST_NO>
      <ADDRESS>
      <SHIP_TO>903533</SHIP_TO>
      <NAME1>HENLEY - PART MAQUINARIAS S.A.</NAME1>
      <STREET>Dean Camilo # 148, San Carlos</STREET>
      <CITY>LIMA</CITY>
      </ADDRESS>
      <EQUIPMENT>
      <EQUI_NO>4442</EQUI_NO>
      <EQUI_NO>8163</EQUI_NO>
      <EQUI_NO>8199</EQUI_NO>
      <EQUI_NO>8200</EQUI_NO>
      <EQUI_NO>8201</EQUI_NO>
      <EQUI_NO>8210</EQUI_NO>
      <EQUI_NO>8211</EQUI_NO>
      <EQUI_NO>58120</EQUI_NO>
      <EQUI_NO>90000-EMERGENCY</EQUI_NO>
      <EQUI_NO>90000-STOCK</EQUI_NO>
      </EQUIPMENT>
      <STORAGE_LOC>
      <STOR_LOC_NO>0001</STOR_LOC_NO>
      <DESCRIPTION>01 Parts Center</DESCRIPTION>
      <STOR_LOC_NO>0056</STOR_LOC_NO>
      <DESCRIPTION>56 HEN</DESCRIPTION>
      </STORAGE_LOC>
      <CUST_NO>200793</CUST_NO>
      <ADDRESS>
      <SHIP_TO>200793</SHIP_TO>
      <NAME1>Minera San Cristobal S.A.</NAME1>
      <STREET>Calacoto, Calle 90, Torre 2</STREET>
      <HOUSE_NO>Piso 5</HOUSE_NO>
      <CITY>La Paz</CITY>
      </ADDRESS>
      <EQUIPMENT>
      <EQUI_NO>90000-EMERGENCY</EQUI_NO>
      <EQUI_NO>90000-STOCK</EQUI_NO>
      </EQUIPMENT>
      <STORAGE_LOC>
      <STOR_LOC_NO>0001</STOR_LOC_NO>
      <DESCRIPTION>01 Parts Center</DESCRIPTION>
      <STOR_LOC_NO>0056</STOR_LOC_NO>
      <DESCRIPTION>56 HEN</DESCRIPTION>
      </STORAGE_LOC>
      <CUST_NO>200801</CUST_NO>
      <ADDRESS>
      <SHIP_TO>200801</SHIP_TO>
      <NAME1>ISEMAR S.A.</NAME1>
      <STREET>Ruta Km 28.45</STREET>
      <CITY>Don Torcuato Paraguay</CITY>
      </ADDRESS>
      <EQUIPMENT>
      <EQUI_NO>15079</EQUI_NO>
      <EQUI_NO>15097</EQUI_NO>
      <EQUI_NO>90000-EMERGENCY</EQUI_NO>
      <EQUI_NO>90000-STOCK</EQUI_NO>
      </EQUIPMENT>
      <STORAGE_LOC>
      <STOR_LOC_NO>0001</STOR_LOC_NO>
      <DESCRIPTION>01 Parts Center</DESCRIPTION>
      <STOR_LOC_NO>0056</STOR_LOC_NO>
      <DESCRIPTION>56 HEN</DESCRIPTION>
      </STORAGE_LOC>
    </CUSTOMER_FULL_20140207_033015_001>
    Output:
    Regards,
    Akhileshkiran.

  • XML-Document with special characters

    Hallo
    i have an oracle database with a table of XmlType.
    Now i want to insert the following document:
    <message>
    <to>[email protected]</to>
    <from>[email protected]</from>
    <subject>Question</subject>
    <body>über den Wolken</body>
    </message>
    The problem is the special character "ü" which is transformed to "??". Must i declare a special character set? If yes - where? In the XML-Document or in the Database? And how must i do this?
    Thank you very much
    cu
    Heidi

    Hallo Raghu,
    when i insert the following by iSqlPlus in Internet Explorer (on a German WinXP):
    insert into xml_table_test values (xmltype ('<message><to>[email protected]</to><from>[email protected]</from><subject>Question</subject><body>über den Wolken</body></message>')) /
    a new page is displayed with the following:
    Substitution Variables
    Enter values for substitution variables in the script to execute:
    Variable Value
    uuml
    and in the inputfield above Value i can insert something (in my case "ü" - i think)
    But i want to insert the documents with webdav and then i can´t do this...
    when i select this:
    select * from nls_session_parameters
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    PARAMETER VALUE
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    it´s all american --> must i change this to German/Europe? How?
    Thank you very much
    cu
    Heidi

  • Please help to read the XML document with XMLTable

    Hi Gurus,
    I am not very familiar with XML parsing. It seems to me it should be very easy to get the data. For some reason, I am having a problem to get the data.
    SELECT *
    FROM util.hlsr_online_entries e,
    XMLTABLE(
      xmlnamespaces(
       'http://tempuri.org/'    as "dt",
       'urn:schemas-microsoft-com:xml-diffgram-v1' as "dg"),
      '/DataTable/dg:diffgram/DocumentElement/JrShowCustomerHeifers'
      PASSING XMLTYPE(e.entry_data)
      COLUMNS
      SeqNo  FOR ORDINALITY,
      DocumentID NUMBER  PATH 'DocumentID',
      ClubName VARCHAR2(100) PATH 'ClubName') as test
    WHERE e.ref_id = 33422
    The above query does not bring any data for me. My hunts is the problem with DocumentElement tab. I have been trying a different variation to handle.
    Please help me out to tune the query
    I have the following XML document from the DotNet developer
    <?xml version="1.0" encoding="utf-8"?>
    <DataTable xmlns="http://tempuri.org/">
      <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="JrShowCustomerHeifers" msdata:UseCurrentLocale="true">
          <xs:complexType>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element name="JrShowCustomerHeifers">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="DocumentID" type="xs:int" minOccurs="0" />
                    <xs:element name="ClubName" type="xs:string" minOccurs="0" />
                    <xs:element name="LastName" type="xs:string" minOccurs="0" />
                    <xs:element name="FirstName" type="xs:string" minOccurs="0" />
                    <xs:element name="PreferredName" type="xs:string" minOccurs="0" />
                    <xs:element name="Email" type="xs:string" minOccurs="0" />
                    <xs:element name="Exhibitor" type="xs:string" minOccurs="0" />
                    <xs:element name="AnimalName" type="xs:string" minOccurs="0" />
                    <xs:element name="RegistryNo" type="xs:string" minOccurs="0" />
                    <xs:element name="DateofBirth" type="xs:string" minOccurs="0" />
                    <xs:element name="NameofSire" type="xs:string" minOccurs="0" />
                    <xs:element name="SireRegistryNo" type="xs:string" minOccurs="0" />
                    <xs:element name="NameofDam" type="xs:string" minOccurs="0" />
                    <xs:element name="DamRegistryNo" type="xs:string" minOccurs="0" />
                    <xs:element name="Tattoo" type="xs:string" minOccurs="0" />
                    <xs:element name="SecondaryTattoo" type="xs:string" minOccurs="0" />
                    <xs:element name="UniversalIDNumber" type="xs:string" minOccurs="0" />
                    <xs:element name="Tattoo_Location" type="xs:string" minOccurs="0" />
                    <xs:element name="Secondary_Tattoo_Location" type="xs:string" minOccurs="0" />
                    <xs:element name="OracleBreedID" type="xs:int" minOccurs="0" />
                    <xs:element name="JrValidationBreedName" type="xs:string" minOccurs="0" />
                    <xs:element name="ValidationDate" type="xs:dateTime" minOccurs="0" />
                    <xs:element name="ValidatedBy" type="xs:string" minOccurs="0" />
                    <xs:element name="ValidationComment" type="xs:string" minOccurs="0" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:choice>
          </xs:complexType>
        </xs:element>
      </xs:schema>
      <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
        <DocumentElement xmlns="">
          <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers1" msdata:rowOrder="0">
            <DocumentID>18442</DocumentID>
            <ClubName>Perrin FFA</ClubName>
            <LastName>Hamman</LastName>
            <FirstName>Kaily</FirstName>
            <Email>[email protected]</Email>
            <Exhibitor>Hamman, Kaily</Exhibitor>
            <AnimalName>113</AnimalName>
            <RegistryNo>C1026447</RegistryNo>
            <DateofBirth>01/14/2013</DateofBirth>
            <NameofSire>808 GAME DAY 808 LH</NameofSire>
            <SireRegistryNo>C961101</SireRegistryNo>
            <NameofDam>SADDIE 7/7 LE</NameofDam>
            <DamRegistryNo>C941067</DamRegistryNo>
            <Tattoo>113</Tattoo>
            <SecondaryTattoo />
            <UniversalIDNumber>1194F020</UniversalIDNumber>
            <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
            <Secondary_Tattoo_Location />
            <OracleBreedID>6383</OracleBreedID>
            <JrValidationBreedName>Beefmaster</JrValidationBreedName>
            <ValidationDate>2014-11-25T08:39:00-06:00</ValidationDate>
            <ValidatedBy>laineyb</ValidatedBy>
            <ValidationComment />
          </JrShowCustomerHeifers>
          <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers2" msdata:rowOrder="1">
            <DocumentID>18473</DocumentID>
            <ClubName>Perrin FFA</ClubName>
            <LastName>Hamman</LastName>
            <FirstName>Kaily</FirstName>
            <Email>[email protected]</Email>
            <Exhibitor>Hamman, Kaily</Exhibitor>
            <AnimalName>KPH PURPLE CORALEE 349</AnimalName>
            <RegistryNo>P43461953</RegistryNo>
            <DateofBirth>11/04/2013</DateofBirth>
            <NameofSire>PURPLE MOXY 22X ET</NameofSire>
            <SireRegistryNo>P43126458</SireRegistryNo>
            <NameofDam>TCC CORKY 6603</NameofDam>
            <DamRegistryNo>P42457119</DamRegistryNo>
            <Tattoo>349</Tattoo>
            <SecondaryTattoo>KPH</SecondaryTattoo>
            <UniversalIDNumber>1194F021</UniversalIDNumber>
            <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
            <Secondary_Tattoo_Location>TATTOO - Right Ear</Secondary_Tattoo_Location>
            <OracleBreedID>6389</OracleBreedID>
            <JrValidationBreedName>Polled Hereford</JrValidationBreedName>
            <ValidationDate>2014-12-01T11:55:00-06:00</ValidationDate>
            <ValidatedBy>Hannah</ValidatedBy>
            <ValidationComment />
          </JrShowCustomerHeifers>
          <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers3" msdata:rowOrder="2">
            <DocumentID>18474</DocumentID>
            <ClubName>Perrin FFA</ClubName>
            <LastName>Hamman</LastName>
            <FirstName>Kaily</FirstName>
            <Email>[email protected]</Email>
            <Exhibitor>Hamman, Kaily</Exhibitor>
            <AnimalName>LANGFORDS SWEET N SOUR 4107</AnimalName>
            <RegistryNo>43504761</RegistryNo>
            <DateofBirth>03/02/2014</DateofBirth>
            <NameofSire>LH TNT 1017</NameofSire>
            <SireRegistryNo>43199794</SireRegistryNo>
            <NameofDam>LANGFORDS LADY 2206 ET</NameofDam>
            <DamRegistryNo>43315143</DamRegistryNo>
            <Tattoo>4107</Tattoo>
            <SecondaryTattoo />
            <UniversalIDNumber>1194F018</UniversalIDNumber>
            <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
            <Secondary_Tattoo_Location />
            <OracleBreedID>6398</OracleBreedID>
            <JrValidationBreedName>Hereford</JrValidationBreedName>
            <ValidationDate>2014-11-24T14:26:00-06:00</ValidationDate>
            <ValidatedBy>Validator</ValidatedBy>
            <ValidationComment />
          </JrShowCustomerHeifers>
          <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers4" msdata:rowOrder="3">
            <DocumentID>18475</DocumentID>
            <ClubName>Perrin FFA</ClubName>
            <LastName>Hamman</LastName>
            <FirstName>Kaily</FirstName>
            <Email>[email protected]</Email>
            <Exhibitor>Hamman, Kaily</Exhibitor>
            <AnimalName>PURPLE CCC LYDIA 19A</AnimalName>
            <RegistryNo>P43406978</RegistryNo>
            <DateofBirth>02/05/2013</DateofBirth>
            <NameofSire>PURPLE MB WOMANIZER 14UET</NameofSire>
            <SireRegistryNo>P42945146</SireRegistryNo>
            <NameofDam>PURPLE CMCC NASTIA 9U</NameofDam>
            <DamRegistryNo>P42927201</DamRegistryNo>
            <Tattoo>19A</Tattoo>
            <SecondaryTattoo />
            <UniversalIDNumber>1194F017</UniversalIDNumber>
            <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
            <Secondary_Tattoo_Location />
            <OracleBreedID>6389</OracleBreedID>
            <JrValidationBreedName>Polled Hereford</JrValidationBreedName>
            <ValidationDate>2014-12-01T11:55:00-06:00</ValidationDate>
            <ValidatedBy>Hannah</ValidatedBy>
            <ValidationComment />
          </JrShowCustomerHeifers>
          <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers5" msdata:rowOrder="4">
            <DocumentID>18477</DocumentID>
            <ClubName>Perrin FFA</ClubName>
            <LastName>Hamman</LastName>
            <FirstName>Kaily</FirstName>
            <Email>[email protected]</Email>
            <Exhibitor>Hamman, Kaily</Exhibitor>
            <AnimalName>PURPLE SGW EDEN 12B</AnimalName>
            <RegistryNo>P43521932</RegistryNo>
            <DateofBirth>04/02/2014</DateofBirth>
            <NameofSire>RST TIME'S A WASTIN' 0124</NameofSire>
            <SireRegistryNo>43123163</SireRegistryNo>
            <NameofDam>PURPLE SM WONDER WOMAN 160Y</NameofDam>
            <DamRegistryNo>P43235169</DamRegistryNo>
            <Tattoo>12B</Tattoo>
            <SecondaryTattoo>12B</SecondaryTattoo>
            <UniversalIDNumber>1194F015</UniversalIDNumber>
            <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
            <Secondary_Tattoo_Location>TATTOO - Right Ear</Secondary_Tattoo_Location>
            <OracleBreedID>6389</OracleBreedID>
            <JrValidationBreedName>Polled Hereford</JrValidationBreedName>
            <ValidationDate>2014-12-01T11:56:00-06:00</ValidationDate>
            <ValidatedBy>Hannah</ValidatedBy>
            <ValidationComment />
          </JrShowCustomerHeifers>
        </DocumentElement>
      </diffgr:diffgram>
    </DataTable>

    Hi odie_63,
    Good evening. I am not sure what you are suggesting. Please provide me the example how to solve the problem. I am very new to XML parsing.
    In the meantime, I am having another problem to get the data because .net developer changes the webservice format. To me it is supposed to work fine. May be my eyes are getting blurred so, I can't see where I am wrong.
    Thanks in advance. Please help me out.
    SELECT exh.docid,exh.clubname,exh.lname,exh.fname,exh.exhibitor,exh.animalname
    FROM util.hlsr_online_entries e,
    XMLTABLE(
      xmlnamespaces(
       'http://webservices.hlsr.net/JrShowOracleService/' as "dt",
       'urn:schemas-microsoft-com:xml-diffgram-v1'  as "dg"),
      '/dt:GetJrShowCustomerHeifersResponse/GetJrShowCustomerHeifersResult/dg:diffgram/DocumentElement/JrShowCustomerHeifers'
      PASSING XMLTYPE(e.entry_data)
      COLUMNS
      SeqNo  FOR ORDINALITY,
      DocID  NUMBER  PATH 'DocumentID',
      ClubName VARCHAR2(100) PATH 'ClubName',
      LName  VARCHAR2(100) PATH 'LastName',
      FName  VARCHAR2(100) PATH 'FirstName',
      Email  VARCHAR2(100) PATH 'Email',
      Exhibitor VARCHAR2(100) PATH 'Exhibitor',
      AnimalName VARCHAR2(100) PATH 'AnimalName', 
      RegNo  VARCHAR2(100) PATH 'RegistryNo',
      DOB  VARCHAR2(100) PATH 'DateofBirth',
      SireName VARCHAR2(100) PATH 'NameofSire',
      SireRegNo VARCHAR2(100) PATH 'SireRegistryNo',
      Dam  VARCHAR2(100) PATH 'NameofDam',
      DamRegNo VARCHAR2(100) PATH 'DamRegistryNo',
      Tattoo  VARCHAR2(100) PATH 'Tattoo',
      SecTattoo VARCHAR2(100) PATH 'SecondaryTattoo',
      UnivIDNum VARCHAR2(100) PATH 'UniversalIDNumber',
      TattooLoc VARCHAR2(100) PATH 'Tattoo_Location',
      OraBreedID NUMBER  PATH 'OracleBreedID',
      Breed  VARCHAR2(100) PATH 'JrValidationBreedName',
      ValDate  VARCHAR2(100) PATH 'ValidationDate'
      ) as exh
    WHERE e.ref_id = 33432
    <GetJrShowCustomerHeifersResponse xmlns="http://webservices.hlsr.net/JrShowOracleService/">
      <GetJrShowCustomerHeifersResult>
        <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
          <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="JrShowCustomerHeifers" msdata:UseCurrentLocale="true">
            <xs:complexType>
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element name="JrShowCustomerHeifers">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="DocumentID" type="xs:int" minOccurs="0"/>
                      <xs:element name="ClubName" type="xs:string" minOccurs="0"/>
                      <xs:element name="LastName" type="xs:string" minOccurs="0"/>
                      <xs:element name="FirstName" type="xs:string" minOccurs="0"/>
                      <xs:element name="PreferredName" type="xs:string" minOccurs="0"/>
                      <xs:element name="Email" type="xs:string" minOccurs="0"/>
                      <xs:element name="Exhibitor" type="xs:string" minOccurs="0"/>
                      <xs:element name="AnimalName" type="xs:string" minOccurs="0"/>
                      <xs:element name="RegistryNo" type="xs:string" minOccurs="0"/>
                      <xs:element name="DateofBirth" type="xs:string" minOccurs="0"/>
                      <xs:element name="NameofSire" type="xs:string" minOccurs="0"/>
                      <xs:element name="SireRegistryNo" type="xs:string" minOccurs="0"/>
                      <xs:element name="NameofDam" type="xs:string" minOccurs="0"/>
                      <xs:element name="DamRegistryNo" type="xs:string" minOccurs="0"/>
                      <xs:element name="Tattoo" type="xs:string" minOccurs="0"/>
                      <xs:element name="SecondaryTattoo" type="xs:string" minOccurs="0"/>
                      <xs:element name="UniversalIDNumber" type="xs:string" minOccurs="0"/>
                      <xs:element name="Tattoo_Location" type="xs:string" minOccurs="0"/>
                      <xs:element name="Secondary_Tattoo_Location" type="xs:string" minOccurs="0"/>
                      <xs:element name="OracleBreedID" type="xs:int" minOccurs="0"/>
                      <xs:element name="JrValidationBreedName" type="xs:string" minOccurs="0"/>
                      <xs:element name="ValidationDate" type="xs:string" minOccurs="0"/>
                      <xs:element name="ValidatedBy" type="xs:string" minOccurs="0"/>
                      <xs:element name="ValidationComment" type="xs:string" minOccurs="0"/>
                    </xs:sequence>
                  </xs:complexType>
                </xs:element>
              </xs:choice>
            </xs:complexType>
          </xs:element>
        </xs:schema>
        <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
          <DocumentElement xmlns="">
            <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers1" msdata:rowOrder="0">
              <DocumentID>18442</DocumentID>
              <ClubName>Perrin FFA</ClubName>
              <LastName>Hamman</LastName>
              <FirstName>Kaily</FirstName>
              <Email>[email protected]</Email>
              <Exhibitor>Hamman, Kaily</Exhibitor>
              <AnimalName>113</AnimalName>
              <RegistryNo>C1026447</RegistryNo>
              <DateofBirth>01/14/2013</DateofBirth>
              <NameofSire>808 GAME DAY 808 LH</NameofSire>
              <SireRegistryNo>C961101</SireRegistryNo>
              <NameofDam>SADDIE 7/7 LE</NameofDam>
              <DamRegistryNo>C941067</DamRegistryNo>
              <Tattoo>113</Tattoo>
              <SecondaryTattoo/>
              <UniversalIDNumber>1194F020</UniversalIDNumber>
              <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
              <Secondary_Tattoo_Location/>
              <OracleBreedID>6383</OracleBreedID>
              <JrValidationBreedName>Beefmaster</JrValidationBreedName>
              <ValidationDate>11/25/2014</ValidationDate>
              <ValidatedBy>laineyb</ValidatedBy>
              <ValidationComment/>
            </JrShowCustomerHeifers>
            <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers2" msdata:rowOrder="1">
              <DocumentID>18473</DocumentID>
              <ClubName>Perrin FFA</ClubName>
              <LastName>Hamman</LastName>
              <FirstName>Kaily</FirstName>
              <Email>[email protected]</Email>
              <Exhibitor>Hamman, Kaily</Exhibitor>
              <AnimalName>KPH PURPLE CORALEE 349</AnimalName>
              <RegistryNo>P43461953</RegistryNo>
              <DateofBirth>11/04/2013</DateofBirth>
              <NameofSire>PURPLE MOXY 22X ET</NameofSire>
              <SireRegistryNo>P43126458</SireRegistryNo>
              <NameofDam>TCC CORKY 6603</NameofDam>
              <DamRegistryNo>P42457119</DamRegistryNo>
              <Tattoo>349</Tattoo>
              <SecondaryTattoo>KPH</SecondaryTattoo>
              <UniversalIDNumber>1194F021</UniversalIDNumber>
              <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
              <Secondary_Tattoo_Location>TATTOO - Right Ear</Secondary_Tattoo_Location>
              <OracleBreedID>6389</OracleBreedID>
              <JrValidationBreedName>Polled Hereford</JrValidationBreedName>
              <ValidationDate>12/01/2014</ValidationDate>
              <ValidatedBy>Hannah</ValidatedBy>
              <ValidationComment/>
            </JrShowCustomerHeifers>
            <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers3" msdata:rowOrder="2">
              <DocumentID>18474</DocumentID>
              <ClubName>Perrin FFA</ClubName>
              <LastName>Hamman</LastName>
              <FirstName>Kaily</FirstName>
              <Email>[email protected]</Email>
              <Exhibitor>Hamman, Kaily</Exhibitor>
              <AnimalName>LANGFORDS SWEET N SOUR 4107</AnimalName>
              <RegistryNo>43504761</RegistryNo>
              <DateofBirth>03/02/2014</DateofBirth>
              <NameofSire>LH TNT 1017</NameofSire>
              <SireRegistryNo>43199794</SireRegistryNo>
              <NameofDam>LANGFORDS LADY 2206 ET</NameofDam>
              <DamRegistryNo>43315143</DamRegistryNo>
              <Tattoo>4107</Tattoo>
              <SecondaryTattoo/>
              <UniversalIDNumber>1194F018</UniversalIDNumber>
              <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
              <Secondary_Tattoo_Location/>
              <OracleBreedID>6398</OracleBreedID>
              <JrValidationBreedName>Hereford</JrValidationBreedName>
              <ValidationDate>11/24/2014</ValidationDate>
              <ValidatedBy>Validator</ValidatedBy>
              <ValidationComment/>
            </JrShowCustomerHeifers>
            <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers4" msdata:rowOrder="3">
              <DocumentID>18475</DocumentID>
              <ClubName>Perrin FFA</ClubName>
              <LastName>Hamman</LastName>
              <FirstName>Kaily</FirstName>
              <Email>[email protected]</Email>
              <Exhibitor>Hamman, Kaily</Exhibitor>
              <AnimalName>PURPLE CCC LYDIA 19A</AnimalName>
              <RegistryNo>P43406978</RegistryNo>
              <DateofBirth>02/05/2013</DateofBirth>
              <NameofSire>PURPLE MB WOMANIZER 14UET</NameofSire>
              <SireRegistryNo>P42945146</SireRegistryNo>
              <NameofDam>PURPLE CMCC NASTIA 9U</NameofDam>
              <DamRegistryNo>P42927201</DamRegistryNo>
              <Tattoo>19A</Tattoo>
              <SecondaryTattoo/>
              <UniversalIDNumber>1194F017</UniversalIDNumber>
              <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
              <Secondary_Tattoo_Location/>
              <OracleBreedID>6389</OracleBreedID>
              <JrValidationBreedName>Polled Hereford</JrValidationBreedName>
              <ValidationDate>12/01/2014</ValidationDate>
              <ValidatedBy>Hannah</ValidatedBy>
              <ValidationComment/>
            </JrShowCustomerHeifers>
            <JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers5" msdata:rowOrder="4">
              <DocumentID>18477</DocumentID>
              <ClubName>Perrin FFA</ClubName>
              <LastName>Hamman</LastName>
              <FirstName>Kaily</FirstName>
              <Email>[email protected]</Email>
              <Exhibitor>Hamman, Kaily</Exhibitor>
              <AnimalName>PURPLE SGW EDEN 12B</AnimalName>
              <RegistryNo>P43521932</RegistryNo>
              <DateofBirth>04/02/2014</DateofBirth>
              <NameofSire>RST TIME&apos;S A WASTIN&apos; 0124</NameofSire>
              <SireRegistryNo>43123163</SireRegistryNo>
              <NameofDam>PURPLE SM WONDER WOMAN 160Y</NameofDam>
              <DamRegistryNo>P43235169</DamRegistryNo>
              <Tattoo>12B</Tattoo>
              <SecondaryTattoo>12B</SecondaryTattoo>
              <UniversalIDNumber>1194F015</UniversalIDNumber>
              <Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
              <Secondary_Tattoo_Location>TATTOO - Right Ear</Secondary_Tattoo_Location>
              <OracleBreedID>6389</OracleBreedID>
              <JrValidationBreedName>Polled Hereford</JrValidationBreedName>
              <ValidationDate>12/01/2014</ValidationDate>
              <ValidatedBy>Hannah</ValidatedBy>
              <ValidationComment/>
            </JrShowCustomerHeifers>
          </DocumentElement>
        </diffgr:diffgram>
      </GetJrShowCustomerHeifersResult>
    </GetJrShowCustomerHeifersResponse>
    Thanks again.

  • Creation of a XML Document with DTD entry

    I am trying to create a XML file on the fly. I use the
    NodeFactory to contruct a document (createDocument()). I have
    then setStandalone("no") and setVersion("1.0"). when I try to
    add a DOCTYPE node via appendChild( new XMLNode("test",
    Node.DOCUMENT_TYPE_NODE)), I get a ClassCastException.
    This is using the 1.0.1.1.0 xml parser.
    What is the mechanism to add a node of this type? I noticed that
    the NodeFactory did not have a machanism for creating a DOCTYPE
    node.
    null

    Nestor Dutko (guest) wrote:
    : I am trying to create a XML file on the fly. I use the
    : NodeFactory to contruct a document (createDocument()). I have
    : then setStandalone("no") and setVersion("1.0"). when I try to
    : add a DOCTYPE node via appendChild( new XMLNode("test",
    : Node.DOCUMENT_TYPE_NODE)), I get a ClassCastException.
    : This is using the 1.0.1.1.0 xml parser.
    : What is the mechanism to add a node of this type? I noticed
    that
    : the NodeFactory did not have a machanism for creating a DOCTYPE
    : node.
    There is no mechanism to create a new DOCUMENT_TYPE_NODE object
    via DOM APIs. The only way to get a DTD object is to parse the
    DTD file or the XML file using the DOMParser, and then use the
    getDocType() method. Note that new XMLNode("test",
    Node.DOCUMENT_TYPE_NODE) does not create a DTD
    object. It creates an XMLNode object with the type set to
    DOCUMENT_TYPE_NODE, which infact should not be allowed. The
    ClassCastException is raised because appendChild expects a DTD
    object (based on the type).
    Also, we do not do any validation while creating the DOM tree
    using the DOM APIs. So setting the DTD in the Document will not
    help in validating the DOM tree that is constructed. The only way
    to validate an XML file is to parse the XML document using
    DOMParser or SAXParser.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

  • How do I add (or insert) a node into an XML document with JSTL?

    Dear all,
    I am trying to use JSTL to store some data from a form into XML. However, I have read many articles in JSTL and only found that it can only be, as far as those articles are concerned, used to "read" data from XML files, but not "write" to them.
    Am I missing something in JSTL? Or, if I want to write to an XML file (e.g., insert a new node, or modify a node's data), will I have to write my own bean and then use <c:usebean />?
    Thanks very much in advance.
    Regards,
    Robert

    JSTL is not a programming language in and of itself. It is intended to help you to write scriptlet free JSPs.
    JSP pages (by one school of thought) are intended to function as the "View" in a Model-View-Controller architecture.
    Being a view, JSP pages should be able to look at things - but not touch.
    The standard pattern is to go to a servlet first, which invokes the logic, and then forwards to a JSP for rendering.
    Editing XML by adding new nodes etc etc is thus a function of the java code layer - servlet/action whatever you want to call it.
    Giving you the power to edit XML documents via JSTL (ie on a JSP page) takes away from purity of the MVC design.
    Hence why they don't provide the tags for manipulating XML, and only provide the database tags with a disclaimer that they should only be used for prototypes/trivial apps!
    JSTL is designed to replace scriptlet code on a JSP page.
    It can replace 99% of scriptlet code. The other 1% shouldn't be on the JSP in the first place :-)
    cheers,
    evnafets

  • Parsing XML document with nested elements into multiple db tables(master-detail)

    Can you help me with storing xml document into master-detail tables?
    I have two tables:
    1) customers (customerid number primary key, firstname varchar2(30),lastname varchar2(30))
    2) cust_addresses (customerid number references customers, street varchar2(30),city varchar2(30),state varchar2(10),zip varchar2(10))
    I have XML document:
    <?xml version="1.0"?>
    <ROWSET>
    <ROW num="1">
    <CUSTOMERID>1044</CUSTOMERID>
    <FIRSTNAME>Paul</FIRSTNAME>
    <LASTNAME>Astoria</LASTNAME>
    <HOMEADDRESS>
    <STREET>123 Cherry Lane</STREET>
    <CITY>SF</CITY>
    <STATE>CA</STATE>
    <ZIP>94132</ZIP>
    </HOMEADDRESS>
    <HOMEADDRESS>
    <STREET>N.Fryda 4</STREET>
    <CITY>CB</CITY>
    <STATE>CZ</STATE>
    <ZIP>37005</ZIP>
    </HOMEADDRESS>
    </ROW>
    </ROWSET>
    I know that I must use DBSM_XMLSave package, create view and instead of trigger but I did found no example in documentation.
    Thanx.

    Interested question; one I do not know the answer to at the moment, I am afraid. I would like to know your results.
    To tell others, though, what I have done. I did finally adapt Muench's not-yet-published examples #71 to work with a table. Here the table has as it's value "#{backing_app_EPG_DAYPG.jobDayDriverTable[row.Id1]}"
    This accesses a hash map defined in the backing bean as follows:
    public Map jobDayDriverTable = new HashMap(){
    @Override
    public Object get(Object key) {
    Number jobDayId = (Number)key;
    if (getEpgDayPage().jobDayDrivers(jobDayId) != null) {
    return getEpgDayPage().jobDayDrivers(jobDayId).getAllRowsInRange();
    else return null;
    jobDayDrivers returns RowIterator. From this I call getAllRowsInRange which returns a Row[]. The table consumes this as a value, and lists the values as I want.
    Since the table is using Rows for its rows, I am guessing that it would have access to #{row.rowKeyStr}, or at least #{row.<pk>} which would allow you to programmatically set the current row using code like the following:
    public static boolean setCurrentRow() {
    // BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    // bindings.getOperationBinding("setCurrentRowWithKey");
    (OperationBinding)EL.get("#{bindings.setCurrentRowWithKey}");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return false;
    return true;
    You could call this as part of code in a pages backing bean behind a button or link.
    Hope this helps somebody.
    By the way example #71 was to get a detail set of rows from a master row value and display the detail set in the master row of an af:table.
    You can find this and other examples at http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html

Maybe you are looking for