[XMLType] : Appending list of XML elements

hi everybody,
I have a lttle question : a would like to append a list of XML elements to another XML document :
I have two XMLs :
<rowset><A>..</A> <A>..</A></rowset> (1)
and
<rowset><B>..</B> <B>..</B></rowset> (2)
and I would like to have
<rowset><A>..</A> <A>..</A><B>..</B> <B>..</B></rowset>
I have generated the two XML (1) and (2) by using DBMS_XMLGEN package, and I have them stored in an XMLType, but I dont know how to operate to get the wanted result.
Can anybody tell me how to do this in a PL/SQL program?
thanks,
Marie.

I don't use XSLT, i just query the XML-documents stored in an XMLType column with a simple SQL-statement.
I have posted a simple example over here Re: Is it possible to influence the creation of empty elements?

Similar Messages

  • XML file too large or XML element too large

    I am attempting to import an xml file into the repository and have it shred into the object-relational tables. I registered a schema and it created object-relational xml_tables, triggers, and types. The full xml file is > 80MB. XDB created all the fields as VARCHAR2(4000).
    error code when importing the full XML file. This is what I need to ultimately fix.
    DECLARE
      res BOOLEAN;
    BEGIN
      res := DBMS_XDB.createResource('/home/pharma/drugbank.xml',
                    bfilename('XMLPHARMA', 'drugbank.xml'),
                    nls_charset_id('AL32UTF8'));
    END;
    COMMIT;
    XML file encounters errors on the import.
    An error was encountered performing the requested operation
    ORA-30951: Element or attribute at Xpath references exceeds maximum length
    ORA-06512 at "XDB.DBMS_XDB", line 315
    ORA-06512 at line 4
    30951.00000 - "Element or attribute at Xpath %x exceeds maximum length"
    *Cause: An attempt was made to insert a node of length exceeding the maximum length (specified by the maxLength facet) into an XML document.
    *Action: Do not attempt to add a node exceeding the maximum length to XML documents.
    Vendor code 30951Error at Line:18I would guess that some of the fields have max lengths > 4000. I plan to annotate the schema with SQLType="CLOB", but need to know which fields to change. I was able to copy the xml file and reduce that xml file to one record, which imported into the tables. My plan was to write a view over the bfile to get the lengths of certain fields, annotate the .xsd with CLOBS where needed, and then import again. In order to do that, I have a 1 record file imported into a table and as a bfile.
    Here is my code selecting length from a generated object-relational table of only one record.
    CREATE OR REPLACE VIEW pharma.drugs_vw AS
    SELECT d.*
    FROM drugs, XMLTABLE
      ('/drugs' PASSING OBJECT_VALUE COLUMNS
        drugbank_id        VARCHAR2(20)   PATH 'drug/drugbank-id',
        name               VARCHAR2(50)   PATH 'drug/name',
        description        VARCHAR2(4000) PATH 'drug/description'   
      ) d
    select max(length(drugbank_id)) as dbidlen,
          max(length(name)) as nmlen,
          max(length(description)) as desclen
    from drugs_vw;
            DBIDLEN           NMLEN         DESCLEN
                  7               9             229
    1 row selected.Here is the code for the bfile. Same results, but using deprecated functions. I read the whitepaper, Oracle XML DB: Best practices to get optimal performance out of XML Queries. It says that extract(), extractvalue(), Table(XMLSequence()), and XMLType() are deprecated in 11gr2.
    -- Note extractvalue is deprecated in 11gr2 replaced by W3C standard
    --                                          XMLCast(XMLQuery())
    -- TABLE(XMLSequence) is replaced by XMLTable
    -- XMLType() is replaced by XMLParse()
    SELECT max(length(extractvalue(column_value, '/drug/drugbank-id'))) dbidlen,
           max(length(extractvalue(column_value, '/drug/name'))) nmlen,
           max(length(extractvalue(column_value, '/drug/description'))) desclen
    FROM TABLE(XMLSequence(XMLTYPE(bfilename('XMLPHARMA',
    'db00001.xml'),nls_charset_id('AL32UTF8')).extract('/drugs/drug'))) d
    WHERE ROWNUM <= 5;
            DBIDLEN           NMLEN         DESCLEN
                  7               9             229Is this better code for getting the maximum length of xml fields from a bfile? Here is what I have so far. This works on a single drugbank-id.
    SELECT max(length(drugbank_id)) AS dbidlen,
           max(length(name)) AS nmlen,
           max(length(description)) AS desclen
    FROM (XMLTABLE('*'
                    PASSING (XMLType(bfilename('XMLPHARMA', 'db00001.xml'),nls_charset_id('AL32UTF8')))
                    COLUMNS
        drugbank_id        VARCHAR2(20)   PATH 'drug/drugbank-id',
        name               VARCHAR2(50)   PATH 'drug/name',
        description        VARCHAR2(4000) PATH 'drug/description'
    );I try to run it on the full file and get this error
    Error report:
    SQL Error: ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00007: unexpected end-of-file encountered
    31011. 00000 -  "XML parsing failed"
    *Cause:    XML parser returned an error while trying to parse the document.
    *Action:   Check if the document to be parsed is valid.The code to create schema and object-relational tables. This worked fine.
    set serveroutput on
    -- Create resource file for schema
    DECLARE
      res BOOLEAN;
    BEGIN
      res := DBMS_XDB.createResource('/home/pharma/drugbank.xsd',
                    bfilename('XMLPHARMA', 'drugbank.xsd'),
                    nls_charset_id('AL32UTF8'));
      COMMIT;
    END;
    -- optional debugging of create types and tables if you want a trace
    ALTER SESSION SET EVENTS = '31098 TRACE NAME CONTEXT FOREVER';
    BEGIN
      DBMS_XMLSCHEMA.registerSchema(
          SCHEMAURL => 'http://localhost:8080/home/pharma/drugbank.xsd',
          SCHEMADOC => bfilename('XMLPHARMA', 'drugbank.xsd'),
          CSID      => nls_charset_id('AL32UTF8'),
          LOCAL     => TRUE,
          GENTYPES  => TRUE,
          GENTABLES => TRUE,
          OWNER     => 'PHARMA');
      COMMIT;
    END;
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - ProductionThe xml schema follows. Sorry about the length, but I think I might break something if I snipped it.
    <?xml version="1.0" encoding="UTF-8"?>
         <xs:schema 
         xmlns:xs="http://www.w3.org/2001/XMLSchema" 
         xmlns:xdb="http://xmlns.oracle.com/xdb"
         >
         <!-- General type definitions -->
         <xs:simpleType name="DecimalOrEmptyType">
              <xs:union memberTypes="xs:decimal EmptyStringType"/>
         </xs:simpleType>
         <xs:simpleType name="EmptyStringType">
              <xs:restriction base="xs:string">
                   <xs:enumeration value=""/>
              </xs:restriction>
         </xs:simpleType>
         <!-- Element Definitions -->
         <!-- Drug secondary accession number definition begins -->
         <xs:element name="secondary-accession-numbers" xdb:defaultTable="SECONDARY_ACCESSION_NUMBERS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="secondary-accession-number" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug secondary accession number definition ends -->
         <!-- Drug groups definition begins -->
         <xs:element name="groups" xdb:defaultTable="GROUPS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="group">
                             <xs:simpleType>
                                  <xs:restriction base="xs:string">
                                       <xs:enumeration value="approved"/>
                                       <xs:enumeration value="illicit"/>
                                       <xs:enumeration value="experimental"/>
                                       <xs:enumeration value="withdrawn"/>
                                       <xs:enumeration value="nutraceutical"/>
                                  </xs:restriction>
                             </xs:simpleType>
                        </xs:element>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug groups definition ends -->
         <!-- Drug taxonomy definition begins -->
         <xs:element name="substructure">
              <xs:complexType>
                   <xs:simpleContent>
                        <xs:extension base="xs:string">
                             <xs:attribute name="class" type="xs:string" use="required"/>
                        </xs:extension>
                   </xs:simpleContent>
              </xs:complexType>
         </xs:element>
         <xs:element name="substructures" xdb:defaultTable="SUBSTRUCTURES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="substructure"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="taxonomy" xdb:defaultTable="TAXONOMY">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="kingdom" type="xs:string"/>
                        <xs:element ref="substructures"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug taxonomy definition ends -->
         <!-- Drug brands definition begins -->
         <xs:element name="brands" xdb:defaultTable="BRANDS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="brand" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug brands definition ends -->
         <!-- Drug mixtures definition begins -->
         <xs:element name="mixture">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name" type="xs:string"/>
                        <xs:element name="ingredients" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="mixtures" xdb:defaultTable="MIXTURES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="mixture"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug mixtures definition ends -->
         <!-- Drug packagers definition begins -->
         <xs:element name="packager">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name" type="xs:string"/>
                        <xs:element name="url" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="packagers" xdb:defaultTable="PACKAGERS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="packager"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug packagers definition ends -->
         <!-- Drug manufacturers definition begins -->
         <xs:element name="manufacturer">
              <xs:complexType>
                   <xs:simpleContent>
                        <xs:extension base="xs:string">
                             <xs:attribute name="generic" type="xs:string" use="required"/>
                        </xs:extension>
                   </xs:simpleContent>
              </xs:complexType>
         </xs:element>
         <xs:element name="manufacturers" xdb:defaultTable="MANUFACTURERS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="manufacturer"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug manufactures definition ends -->
         <!-- Drug pricing definition begins -->
         <xs:element name="cost">
              <xs:complexType>
                   <xs:simpleContent>
                        <xs:extension base="xs:string">
                             <xs:attribute name="currency" type="xs:string" use="required"/>
                        </xs:extension>
                   </xs:simpleContent>
              </xs:complexType>
         </xs:element>
         <xs:element name="price">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="description" type="xs:string"/>
                        <xs:element ref="cost"/>
                        <xs:element name="unit" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="prices" xdb:defaultTable="PRICES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="price"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug pricing definition ends -->
         <!-- Drug categories definition begins -->
         <xs:element name="categories" xdb:defaultTable="CATEGORIES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="category" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug categories definition ends -->
         <!-- Drug affected orgainsms definition begins -->
         <xs:element name="affected-organisms" xdb:defaultTable="AFFECTED_ORGANISMS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="affected-organism" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug affected organisms definition ends -->
         <!-- Drug dosage definition begins -->
         <xs:element name="dosage">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="form" type="xs:string"/>
                        <xs:element name="route" type="xs:string"/>
                        <xs:element name="strength" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="dosages" xdb:defaultTable="DOSAGES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="dosage"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug dosages definition ends -->
         <!-- Drug ATC codes definition begins -->
         <xs:element name="atc-codes" xdb:defaultTable="ATC_CODES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="atc-code" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug ATC codes definition ends -->
         <!-- Drug AHFS codes definition begins -->
         <xs:element name="ahfs-codes" xdb:defaultTable="AHFS_CODES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="ahfs-code" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug AHFS codes definition ends -->
         <!-- Drug Patent definition begins -->
         <xs:element name="patent">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="number" type="xs:string"/>
                        <xs:element name="country" type="xs:string"/>
                        <xs:element name="approved" type="xs:string"/>
                        <xs:element name="expires" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="patents" xdb:defaultTable="PATENTS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="patent"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug patent definition ends -->
         <!-- Drug food interactions definition begins -->
         <xs:element name="food-interactions" xdb:defaultTable="FOOD_INTERACTIONS">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="food-interaction" type="xs:string" maxOccurs="unbounded" minOccurs="0"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug food interactions definition ends -->
         <!-- Drug drug interactions definition begins -->
         <xs:element name="drug-interaction">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="drug" type="xs:integer"/>
                        <xs:element name="description" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="drug-interactions" xdb:defaultTable="DRUG_INTERACTIONS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="drug-interaction"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug drug interactions definition ends -->
         <!-- Drug protein sequences (biotech) definition begins -->
         <xs:element name="protein-sequences" xdb:defaultTable="PROTEIN_SEQUENCES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="protein-sequence" type="SequenceType"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug protein sequences (biotech) definition ends-->
         <!-- Drug external links definition begins -->
         <xs:element name="external-link">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="resource" type="xs:string"/>
                        <xs:element name="url" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="external-links" xdb:defaultTable="EXTERNAL_LINKS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="external-link"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug external links definition ends -->
         <!-- Drug targets definition begins -->
         <xs:element name="targets" xdb:defaultTable="TARGETS">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="target" type="TargetBondType" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug targets definition ends -->
         <!-- Drug enzymes definition begins -->
         <xs:element name="enzymes" xdb:defaultTable="ENZYMES">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="enzyme" type="BondType" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug enzmes definition ends -->
         <!-- Drug transporters definition begins -->
         <xs:element name="transporters" xdb:defaultTable="TRANSPORTERS">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="transporter" type="BondType" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug transporters definition ends -->
         <!-- Drug carriers definition begins -->
         <xs:element name="carriers" xdb:defaultTable="CARRIERS">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="carrier" type="BondType" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug carriers definition ends -->
         <!-- Partner  Pfams definition begins -->
         <xs:element name="pfam">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="identifier" type="xs:string"/>
                        <xs:element name="name" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="pfams" xdb:defaultTable="PFAMS">
              <xs:complexType>
                   <xs:sequence minOccurs="0" maxOccurs="unbounded">
                        <xs:element ref="pfam"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Partner  Pfams definition end -->
         <!-- Partner  GO Classification definition begins -->
         <xs:element name="go-classifier">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="category" type="xs:string"/>
                        <xs:element name="description" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="go-classifiers" xdb:defaultTable="GO_CLASSIFIERS">
              <xs:complexType>
                   <xs:sequence minOccurs="0" maxOccurs="unbounded">
                        <xs:element ref="go-classifier"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Partner  GO Classification definition ends -->
         <!-- Partner Essentiality definition begins -->
         <xs:element name="essentiality">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="Essential"/>
                        <xs:enumeration value="Non-Essential"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <!-- Partner Essentiality definition ends -->
         <!-- Complex Type Definitions -->
         <xs:complexType name="SequenceType">
              <xs:sequence>
                   <xs:element name="header" type="xs:string"/>
                   <xs:element name="chain" type="xs:string"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="PropertyType">
              <xs:sequence>
                   <xs:element name="kind">
                        <xs:simpleType>
                             <xs:restriction base="xs:string">
                                  <xs:enumeration value="logP"/>
                                  <xs:enumeration value="logS"/>
                                  <xs:enumeration value="logP/hydrophobicity"/>
                                  <xs:enumeration value="Water Solubility"/>
                                  <xs:enumeration value="caco2 Permeability"/>
                                  <xs:enumeration value="pKa"/>
                                  <xs:enumeration value="IUPAC Name"/>
                                  <xs:enumeration value="Molecular Weight"/>
                                  <xs:enumeration value="Monoisotopic Weight"/>
                                  <xs:enumeration value="SMILES"/>
                                  <xs:enumeration value="Molecular Formula"/>
                                  <xs:enumeration value="InChI"/>
                                  <xs:enumeration value="InChIKey"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
                   <xs:element name="value" type="xs:string"/>
                   <xs:element name="source">
                        <xs:simpleType>
                             <xs:restriction base="xs:string">
                                  <xs:enumeration value="JChem"/>
                                  <xs:enumeration value="ALOGPS"/>
                                  <xs:enumeration value=""/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="PropertiesType">
              <xs:sequence>
                   <xs:element name="property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="SynonymsType">
              <xs:sequence maxOccurs="unbounded" minOccurs="0">
                   <xs:element name="synonym" type="xs:string"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="IdentifiersType">
              <xs:sequence maxOccurs="unbounded" minOccurs="0">
                   <xs:element name="external-identifier">
                        <xs:complexType>
                             <xs:sequence>
                                  <xs:element name="resource" type="xs:string"/>
                                  <xs:element name="identifier" type="xs:string"/>
                             </xs:sequence>
                        </xs:complexType>
                   </xs:element>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="BondActionsType">
              <xs:sequence maxOccurs="unbounded" minOccurs="0">
                   <xs:element name="action" type="xs:string"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="BondType">
              <xs:sequence>
                   <xs:element name="actions" type="BondActionsType"/>
                   <xs:element name="references" type="xs:string"/>
              </xs:sequence>
              <xs:attribute name="position" type="xs:integer" use="optional"/>
              <xs:attribute name="partner" type="xs:integer"/>
         </xs:complexType>
         <xs:complexType name="TargetBondType">
              <xs:complexContent>
                   <xs:extension base="BondType">
                        <xs:sequence>
                             <xs:element name="known-action">
                                  <xs:simpleType>
                                       <xs:restriction base="xs:string">
                                            <xs:enumeration value="yes"/>
                                            <xs:enumeration value="no"/>
                                            <xs:enumeration value="unknown"/>
                                       </xs:restriction>
                                  </xs:simpleType>
                             </xs:element>
                        </xs:sequence>
                   </xs:extension>
              </xs:complexContent>
         </xs:complexType>
         <xs:complexType name="PartnerType">
              <xs:sequence>
                   <xs:element name="name" type="xs:string"/>
                   <xs:element name="general-function" type="xs:string"/>
                   <xs:element name="specific-function" type="xs:string"/>
                   <xs:element name="gene-name" type="xs:string"/>
                   <xs:element name="locus" type="xs:string"/>
                   <xs:element name="reaction" type="xs:string"/>
                   <xs:element name="signals" type="xs:string"/>
                   <xs:element name="cellular-location" type="xs:string"/>
                   <xs:element name="transmembrane-regions" type="xs:string"/>
                   <xs:element name="theoretical-pi" type="DecimalOrEmptyType"/>
                   <xs:element name="molecular-weight" type="DecimalOrEmptyType"/>
                   <xs:element name="chromosome" type="xs:string"/>
                   <xs:element ref="essentiality"/>
                   <xs:element name="references" type="xs:string"/>
                   <xs:element name="external-identifiers" type="IdentifiersType"/>
                   <xs:element name="synonyms" type="SynonymsType"/>
                   <xs:element name="protein-sequence" type="SequenceType" minOccurs="0"/>
                   <xs:element name="gene-sequence" type="SequenceType" minOccurs="0"/>
                   <xs:element ref="pfams"/>
                   <xs:element ref="go-classifiers"/>
              </xs:sequence>
              <xs:attribute name="id" type="xs:integer" use="required"/>
         </xs:complexType>
         <xs:complexType name="DrugType">
              <xs:sequence>
                   <xs:element name="drugbank-id" type="xs:string"/>
                   <xs:element name="name" type="xs:string"/>
                   <xs:element name="description" type="xs:string"/>
                   <xs:element name="cas-number" type="xs:string"/>
                   <xs:element name="general-references" type="xs:string"/>
                   <xs:element name="synthesis-reference" type="xs:string"/>
                   <xs:element name="indication" type="xs:string"/>
                   <xs:element name="pharmacology" type="xs:string"/>
                   <xs:element name="mechanism-of-action" type="xs:string"/>
                   <xs:element name="toxicity" type="xs:string"/>
                   <xs:element name="biotransformation" type="xs:string"/>
                   <xs:element name="absorption" type="xs:string"/>
                   <xs:element name="half-life" type="xs:string"/>
                   <xs:element name="protein-binding" type="xs:string"/>
                   <xs:element name="route-of-elimination" type="xs:string"/>
                   <xs:element name="volume-of-distribution" type="xs:string"/>
                   <xs:element name="clearance" type="xs:string"/>
                   <xs:element ref="secondary-accession-numbers"/>
                   <xs:element ref="groups"/>
                   <xs:element ref="taxonomy"/>
                   <xs:element name="synonyms" type="SynonymsType"/>
                   <xs:element ref="brands"/>
                   <xs:element ref="mixtures"/>
                   <xs:element ref="packagers"/>
                   <xs:element ref="manufacturers"/>
                   <xs:element ref="prices"/>
                   <xs:element ref="categories"/>
                   <xs:element ref="affected-organisms"/>
                   <xs:element ref="dosages"/>
                   <xs:element ref="atc-codes"/>
                   <xs:element ref="ahfs-codes"/>
                   <xs:element ref="patents"/>
                   <xs:element ref="food-interactions"/>
                   <xs:element ref="drug-interactions"/>
                   <xs:element ref="protein-sequences" minOccurs="0"/><!-- Only present for biotech drugs -->
                   <xs:element name="calculated-properties" type="PropertiesType" minOccurs="0"/><!-- Only present for small molecule drugs -->
                   <xs:element name="experimental-properties" type="PropertiesType"/>
                   <xs:element name="external-identifiers" type="IdentifiersType"/>
                   <xs:element ref="external-links"/>
                   <xs:element ref="targets"/>
                   <xs:element ref="enzymes"/>
                   <xs:element ref="transporters"/>
                   <xs:element ref="carriers"/>
              </xs:sequence>
              <xs:attribute name="type" use="required">
                   <xs:simpleType>
                        <xs:restriction base="xs:string">
                             <xs:enumeration value="small molecule"/>
                             <xs:enumeration value="biotech"/>
                        </xs:restriction>
                   </xs:simpleType>
              </xs:attribute>
              <xs:attribute name="updated" type="xs:string" use="required"/>
              <xs:attribute name="created" type="xs:string" use="required"/>
              <xs:attribute name="version" type="xs:decimal" use="required"/>
         </xs:complexType>
         <xs:element name="drugs"  xdb:defaultTable="DRUGS">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="drug" type="DrugType" minOccurs="0" maxOccurs="unbounded" />
                        <xs:element name="partners">
                             <xs:complexType>
                                  <xs:sequence>
                                       <xs:element name="partner" type="PartnerType" minOccurs="0" maxOccurs="unbounded" />
                                  </xs:sequence>
                             </xs:complexType>
                        </xs:element>
                   </xs:sequence>
              </xs:complexType>
              <xs:keyref name="targetPartnerIdKeyRef" refer="partnerIdKey">
                   <xs:selector xpath="drug/targets/*"/>
                   <xs:field xpath="@partner"/>
              </xs:keyref>
              <xs:keyref name="enzymePartnerIdKeyRef" refer="partnerIdKey">
                   <xs:selector xpath="drug/enzymes/*"/>
                   <xs:field xpath="@partner"/>
              </xs:keyref>
              <xs:keyref name="transporterPartnerIdKeyRef" refer="partnerIdKey">
                   <xs:selector xpath="drug/transporters/*"/>
                   <xs:field xpath="@partner"/>
              </xs:keyref>
              <xs:keyref name="carrierPartnerIdKeyRef" refer="partnerIdKey">
                   <xs:selector xpath="drug/carriers/*"/>
                   <xs:field xpath="@partner"/>
              </xs:keyref>
              <xs:key name="partnerIdKey">
                   <xs:selector xpath=".//partner"/>
                   <xs:field xpath="@id"/>
              </xs:key>
         </xs:element>     
    </xs:schema>Query optimizing whitepaper
    http://www.oracle.com/technetwork/database/features/xmldb/xmlqueryoptimize11gr2-168036.pdf

    I attempted to insert the xml file into an xml table and into a relational table with an xml column both based on the schema. I get the same errors.
    -This creates an XML table based on the schema successfully
    CREATE TABLE pharma.drugs_xmltype OF XMLTYPE
    XMLSCHEMA "http://localhost:8080/home/pharma/drugbank.xsd"
    ELEMENT "drugs";
    Table created.
    Elapsed: 00:00:02.67
    SQL>desc pharma.drugs_xmltype
    Name                                                                          Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "http://localhost:8080/home/pharma/drugbank.xsd" Element "drugs") STORAGE Object-relational TYPE "drugs1200_T"-- it refers to these types
    create or replace TYPE          "drugs1200_T" AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T","drug" "drug1201_COLL","partners" "partners1202_T")FINAL INSTANTIABLE
    create or replace TYPE          "drug1201_COLL" AS VARRAY(2147483647) OF "DrugType1121_T"
    create or replace TYPE          "partners1202_T" AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T","partner" "partner1203_COLL")FINAL INSTANTIABLE
    create or replace TYPE          "partner1203_COLL" AS VARRAY(2147483647) OF "PartnerType1190_T"
    create or replace TYPE          "DrugType1121_T" AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T","type" "XDB"."XDB$ENUM_T","updated" VARCHAR2(4000 CHAR),"created" VARCHAR2(4000 CHAR),"version" NUMBER,"drugbank-id" VARCHAR2(4000 CHAR),"name" VARCHAR2(4000 CHAR),"description" VARCHAR2(4000 CHAR),"cas-number" VARCHAR2(4000 CHAR),"general-references" VARCHAR2(4000 CHAR),"synthesis-reference" VARCHAR2(4000 CHAR),"indication" VARCHAR2(4000 CHAR),"pharmacology" VARCHAR2(4000 CHAR),"mechanism-of-action" VARCHAR2(4000 CHAR),"toxicity" VARCHAR2(4000 CHAR),"biotransformation" VARCHAR2(4000 CHAR),"absorption" VARCHAR2(4000 CHAR),"half-life" VARCHAR2(4000 CHAR),"protein-binding" VARCHAR2(4000 CHAR),"route-of-elimination" VARCHAR2(4000 CHAR),"volume-of-distribution" VARCHAR2(4000 CHAR),"clearance" VARCHAR2(4000 CHAR),"secondary-accession-numbers" "secondary-accession1122_T","groups" "groups1124_T","taxonomy" "taxonomy1126_T","synonyms" "SynonymsType1131_T","brands" "brands1132_T","mixtures" "mixtures1133_T","packagers" "packagers1137_T","manufacturers" "manufacturers1141_T","prices" "prices1145_T","categories" "categories1151_T","affected-organisms" "affected-organisms1152_T","dosages" "dosages1153_T","atc-codes" "atc-codes1157_T","ahfs-codes" "ahfs-codes1158_T","patents" "patents1159_T","food-interactions" "food-interactions1163_T","drug-interactions" "drug-interactions1164_T","protein-sequences" "protein-sequences1168_T","calculated-properties" "PropertiesType1171_T","experimental-properties" "PropertiesType1171_T","external-identifiers" "IdentifiersType1174_T","external-links" "external-links1177_T","targets" "targets1181_T","enzymes" "enzymes1186_T","transporters" "transporters1188_T","carriers" "carriers1189_T")NOT FINAL INSTANTIABLE -- drugs type
    PHARMA@scidev> desc "drugs1200_T"
    Name          Null?    Type
    SYS_XDBPD$             XDB.XDB$RAW_LIST_T
    drug                   drug1201_COLL
    partners               partners1202_T-- I planned to insert using a subselect and got the same error on the select.
    Error starting at line 1 in command:
    SELECT max(length(drugbank_id)) AS dbidlen
    FROM (XMLTABLE('*'
                    PASSING (XMLType(bfilename('XMLPHARMA', 'drugbank.xml'),nls_charset_id('AL32UTF8')))
                    COLUMNS
        drugbank_id        VARCHAR2(20)   PATH 'drug/drugbank-id'
    Error report:
    SQL Error: ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00007: unexpected end-of-file encountered
    31011. 00000 -  "XML parsing failed"
    *Cause:    XML parser returned an error while trying to parse the document.
    *Action:   Check if the document to be parsed is valid.--This creates a row in the xmltype table from a single drug file.
    INSERT INTO drugs_xmltype
    VALUES(XMLType(bfilename('XMLPHARMA', 'db00001.xml'),nls_charset_id('AL32UTF8')).CreateSchemaBasedXML(
        'http://localhost:8080/home/pharma/drugbank.xsd'))
    ;-- The create using the full xml file fails.
    INSERT INTO drugs_xmltype
    VALUES(XMLType(bfilename('XMLPHARMA', 'drugbank.xml'),nls_charset_id('AL32UTF8')).CreateSchemaBasedXML(
    'http://localhost:8080/home/pharma/drugbank.xsd'))
    VALUES(XMLType(bfilename('XMLPHARMA', 'drugbank.xml'),nls_charset_id('AL32UTF8')).CreateSchemaBasedXML(
    ERROR at line 2:
    ORA-30951: Element or attribute at Xpath references exceeds maximum length
    Elapsed: 00:01:17.90-- Then I tried the same using a relational table with an xml column
    -- Then I created a relational table with an xml column
    CREATE TABLE pharma.drugs_xmlcolumn_type (drug_xml XMLTYPE)
    XMLTYPE COLUMN drug_xml STORE AS OBJECT RELATIONAL
    XMLSCHEMA "http://localhost:8080/home/pharma/drugbank.xsd"
    ELEMENT "drugs";
    CREATE TABLE succeeded.--This command refers to the following types
    SYS.XMLTYPE(XMLSchema "http://localhost:8080/home/pharma/drugbank.xsd" Element "drugs" ) STORAGE Object-relational TYPE "drugs1200_T"-- This creates a row in the xmlcolumn table from a single drug file.
    INSERT INTO drugs_xmlcolumn_type
    VALUES(XMLType(bfilename('XMLPHARMA', 'db00001.xml'),nls_charset_id('AL32UTF8')).CreateSchemaBasedXML(
        'http://localhost:8080/home/pharma/drugbank.xsd'))
    ;--The create using the full xml file into a relational table with an xml column fails
    INSERT INTO drugs_xmlcolumn_type
    VALUES(XMLType(bfilename('XMLPHARMA', 'drugbank.xml'),nls_charset_id('AL32UTF8')).CreateSchemaBasedXML(
    'http://localhost:8080/home/pharma/drugbank.xsd'))
    VALUES(XMLType(bfilename('XMLPHARMA', 'drugbank.xml'),nls_charset_id('AL32UTF8')).CreateSchemaBasedXML(
    ERROR at line 2:
    ORA-30951: Element or attribute at Xpath references exceeds maximum length
    Elapsed: 00:01:06.74

  • XMLType column based on XML Schema: several questions

    Hi,
    I've a table on an oracle db version 10.1.0.4 where I stage the xml files containing orders created on a third party's system using BizTalk.
    Although the storage I opted for is based on an XML Schema, defined by this third-party, I am facing big perfomance issues with files bigger than a few hundreds of kBs.
    For instance, a 32Mb file takes more than 2 hours to be processed.
    Now, after reading other threads in this forum and the documentation, my understanding of the problem is that the whole issue is with the correct indexing of the nested tables.
    Here is my current XML Schema definition:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema
                   xmlns:xs="http://www.w3.org/2001/XMLSchema"
                   xmlns:xdb="http://xmlns.oracle.com/xdb"
                   elementFormDefault="qualified"
                   attributeFormDefault="unqualified"
                   xdb:storeVarrayAsTable="true">
         <xs:include schemaLocation="private/Types.xsd"/>
         <xs:element name="PickData">
              <xs:complexType xdb:maintainDOM="false">
                   <xs:sequence>
                        <xs:element name="ProdRun">
                             <xs:complexType xdb:maintainDOM="false">
                                  <xs:sequence>
                                       <xs:element name="Nr" type="xs:int"/>
                                       <xs:element name="Date" type="string8"/>
                                       <xs:element name="Final" type="xs:int"/>
                                       <xs:element name="PickWave" maxOccurs="unbounded">
                                            <xs:complexType xdb:maintainDOM="false">
                                                 <xs:sequence>
                                                      <xs:element name="Nr" type="string10"/>
                                                      <xs:element name="ProdLine" type="string2"/>
                                                      <xs:element name="TourSeq" type="xs:int"/>
                                                      <xs:element name="Tour" type="string20"/>
                                                      <xs:element name="Customer" maxOccurs="unbounded">
                                                           <xs:complexType xdb:maintainDOM="false">
                                                                <xs:sequence>
                                                                     <xs:element name="Seq" type="string20"/>
                                                                     <xs:element name="Cust" type="string10"/>
                                                                     <xs:element name="Mod" type="string30"/>
                                                                     <xs:element name="Tod" type="string30"/>
                                                                     <xs:element name="InvOrder" maxOccurs="unbounded">
                                                                          <xs:complexType xdb:maintainDOM="false">
                                                                               <xs:sequence>
                                                                                    <xs:element name="Nr" type="string20"/>
                                                                                    <xs:element name="Item" type="string20"/>
                                                                                    <xs:element name="Qty" type="xs:int"/>
                                                                                    <xs:element name="Priority" type="xs:int"/>
                                                                                    <xs:element name="Reordering" type="xs:int"/>
                                                                                    <xs:element name="DelDate" type="string8"/>
                                                                                    <xs:element name="HlOrder" type="string20"/>
                                                                               </xs:sequence>
                                                                          </xs:complexType>
                                                                          <xs:unique name="InvOrderKey">
                                                                               <xs:selector xpath="InvOrder"/>
                                                                               <xs:field xpath="Nr"/>
                                                                          </xs:unique>
                                                                     </xs:element>
                                                                </xs:sequence>
                                                           </xs:complexType>
                                                           <xs:unique name="CustomerKey">
                                                                <xs:selector xpath="Customer"/>
                                                                <xs:field xpath="Seq"/>
                                                           </xs:unique>
                                                      </xs:element>
                                                 </xs:sequence>
                                            </xs:complexType>
                                            <xs:unique name="PickWaveKey">
                                                 <xs:selector xpath="PickWave"/>
                                                 <xs:field xpath="Nr"/>
                                            </xs:unique>
                                       </xs:element>
                                  </xs:sequence>
                             </xs:complexType>
                             <xs:unique name="ProdRunKey">
                                  <xs:selector xpath="ProdRun"/>
                                  <xs:field xpath="Nr"/>
                             </xs:unique>
                        </xs:element>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    Here is the included sub-schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
              <xsd:simpleType name="string2">
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="2"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="string5">
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="5"/>
    </xsd:restriction>
    </xsd:simpleType>
              <xsd:simpleType name="string6">
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="6"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="string8">
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="8"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="string10">
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="10"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="string15">
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="15"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="string20">
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="20"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="string30">
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="30"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="string40">
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="40"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="string50">
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="50"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="string250">
                   <xsd:restriction base="xsd:string">
                        <xsd:maxLength value="250"/>
                   </xsd:restriction>
              </xsd:simpleType>
         </xsd:schema>
    The statement for creating my table is
    CREATE TABLE "XML_ORDERS"
    ("ID" NUMBER(7,0) NOT NULL ENABLE,
    "XMLFILE" "SYS"."XMLTYPE" ,
    "INSERTED" DATE DEFAULT sysdate,
    CONSTRAINT "XML_ORDERS_PK" PRIMARY KEY ("ID") USING INDEX ENABLE
    ) XMLTYPE COLUMN XMLFILE STORE AS OBJECT RELATIONAL
    XMLSCHEMA "private/PickData.xsd" ELEMENT "PickData"
    Here is a simple instance document:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <PickData xsi:noNamespaceSchemaLocation="private/PickData.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ProdRun>
    <Nr>5</Nr>
    <Date>15112005</Date>
    <Final>1</Final>
    <PickWave>
    <Nr>IPW0000017</Nr>
    <ProdLine>01</ProdLine>
    <TourSeq>1</TourSeq>
    <Tour>00000043_078</Tour>
    <Customer>
    <Seq>5</Seq>
    <Cust>100000006</Cust>
    <Mod>FO</Mod>
    <Tod>DDU</Tod>
    <InvOrder>
    <Nr>IIO0000457</Nr>
    <Item>100000036</Item>
    <Qty>20</Qty>
    <Priority>1</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000742</HlOrder>
    </InvOrder>
    <InvOrder>
    <Nr>IIO0000459</Nr>
    <Item>100000045</Item>
    <Qty>20</Qty>
    <Priority>1</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000742</HlOrder>
    </InvOrder>
    </Customer>
    <Customer>
    <Seq>6</Seq>
    <Cust>100000013</Cust>
    <Mod>FO</Mod>
    <Tod>DDU</Tod>
    <InvOrder>
    <Nr>IIO0000461</Nr>
    <Item>100000036</Item>
    <Qty>20</Qty>
    <Priority>1</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000743</HlOrder>
    </InvOrder>
    <InvOrder>
    <Nr>IIO0000463</Nr>
    <Item>100000045</Item>
    <Qty>20</Qty>
    <Priority>1</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000743</HlOrder>
    </InvOrder>
    </Customer>
    <Customer>
    <Seq>2</Seq>
    <Cust>100000114</Cust>
    <Mod>FO</Mod>
    <Tod>DDU</Tod>
    <InvOrder>
    <Nr>IIO0000465</Nr>
    <Item>100000036</Item>
    <Qty>20</Qty>
    <Priority>1</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000744</HlOrder>
    </InvOrder>
    <InvOrder>
    <Nr>IIO0000467</Nr>
    <Item>100000045</Item>
    <Qty>20</Qty>
    <Priority>1</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000744</HlOrder>
    </InvOrder>
    </Customer>
    <Customer>
    <Seq>3</Seq>
    <Cust>100000140</Cust>
    <Mod>FO</Mod>
    <Tod>DDU</Tod>
    <InvOrder>
    <Nr>IIO0000469</Nr>
    <Item>100000036</Item>
    <Qty>20</Qty>
    <Priority>1</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000745</HlOrder>
    </InvOrder>
    <InvOrder>
    <Nr>IIO0000471</Nr>
    <Item>100000045</Item>
    <Qty>20</Qty>
    <Priority>1</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000745</HlOrder>
    </InvOrder>
    </Customer>
    <Customer>
    <Seq>7</Seq>
    <Cust>100000143</Cust>
    <Mod>FO</Mod>
    <Tod>DDU</Tod>
    <InvOrder>
    <Nr>IIO0000473</Nr>
    <Item>100000036</Item>
    <Qty>20</Qty>
    <Priority>1</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000746</HlOrder>
    </InvOrder>
    <InvOrder>
    <Nr>IIO0000475</Nr>
    <Item>100000045</Item>
    <Qty>20</Qty>
    <Priority>1</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000746</HlOrder>
    </InvOrder>
    </Customer>
    <Customer>
    <Seq>8</Seq>
    <Cust>100000145</Cust>
    <Mod>FO</Mod>
    <Tod>DDU</Tod>
    <InvOrder>
    <Nr>IIO0000477</Nr>
    <Item>100000036</Item>
    <Qty>20</Qty>
    <Priority>1</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000747</HlOrder>
    </InvOrder>
    <InvOrder>
    <Nr>IIO0000479</Nr>
    <Item>100000045</Item>
    <Qty>20</Qty>
    <Priority>1</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000747</HlOrder>
    </InvOrder>
    </Customer>
    <Customer>
    <Seq>9</Seq>
    <Cust>100000146</Cust>
    <Mod>FO</Mod>
    <Tod>DDU</Tod>
    <InvOrder>
    <Nr>IIO0000481</Nr>
    <Item>100000036</Item>
    <Qty>20</Qty>
    <Priority>0</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000748</HlOrder>
    </InvOrder>
    <InvOrder>
    <Nr>IIO0000483</Nr>
    <Item>100000045</Item>
    <Qty>20</Qty>
    <Priority>1</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000748</HlOrder>
    </InvOrder>
    </Customer>
    <Customer>
    <Seq>4</Seq>
    <Cust>100000147</Cust>
    <Mod>FO</Mod>
    <Tod>DDU</Tod>
    <InvOrder>
    <Nr>IIO0000485</Nr>
    <Item>100000036</Item>
    <Qty>20</Qty>
    <Priority>0</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000750</HlOrder>
    </InvOrder>
    <InvOrder>
    <Nr>IIO0000487</Nr>
    <Item>100000045</Item>
    <Qty>20</Qty>
    <Priority>1</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000750</HlOrder>
    </InvOrder>
    </Customer>
    <Customer>
    <Seq>10</Seq>
    <Cust>100000148</Cust>
    <Mod>FO</Mod>
    <Tod>DDU</Tod>
    <InvOrder>
    <Nr>IIO0000489</Nr>
    <Item>100000036</Item>
    <Qty>20</Qty>
    <Priority>0</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000751</HlOrder>
    </InvOrder>
    <InvOrder>
    <Nr>IIO0000491</Nr>
    <Item>100000045</Item>
    <Qty>20</Qty>
    <Priority>1</Priority>
    <Reordering>0</Reordering>
    <DelDate>15112005</DelDate>
    <HlOrder>CSO000751</HlOrder>
    </InvOrder>
    </Customer>
    </PickWave>
    </ProdRun>
    </PickData>
    When I registered the XMLSchema, the following types and tables were automatically created and you can see the hierarchy below:
    (by the way, I could not find any xdb_utilities.printNestedTables mentioned elsewhere)
    XML_ORDERS
    |_PickData381_T
    |___ProdRun382_T
    |_____PickWave388_COLL
    |_______PickWave383_T
    |_________Customer387_COLL
    |___________Customer384_T
    |_____________InvOrder386_COLL
    These objects are then used in the following nested tables:
    TABLE_NAME     TABLE_TYPE_NAME     PARENT_TABLE_NAME     PARENT_TABLE_COLUMN
    SYS_NTaK/5zar5S0WitSsgu6OKPQ==     PickWave388_COLL     PickData389_TAB     "XMLDATA"."ProdRun"."PickWave"
    SYS_NTf6QvwVm8SFKz+K/YYWq+WQ==     Item408_COLL     ProdData409_TAB     "XMLDATA"."Item"
    SYS_NTtu05ilrRQqmuEN4k+07VDA==     Customer402_COLL     OutboundParty403_TAB     "XMLDATA"."Customer"
    SYS_NTK6fhWq5uTJ+vKcgBpNm1Fg==     InvOrder386_COLL     SYS_NTIIzv7bkXQSSS43igtfi5eg==     InvOrder
    SYS_NTIIzv7bkXQSSS43igtfi5eg==     Customer387_COLL     SYS_NTaK/5zar5S0WitSsgu6OKPQ==     Customer
    I enabled sql tracing and I got the following TKPROF output
    INSERT INTO IMP_ORDERS (PICK_INVORDERNR, PICK_ITEM, PICK_QTY, PICK_PRIORITY,
    PICK_REORDERING, PICK_HLORDER, PICK_DELDATE, PICK_CUST, PICK_MOD, PICK_TOD,
    PICK_SEQ, PICK_PICKWAVENR, PICK_PICKWAVEPRODLINE, PICK_PICKWAVETOUR,
    PICK_PICKWAVETOURSEQ, PICK_ORDKEY, PICK_RUNKEY) SELECT INVORDERNR, ITEM,
    QTY, PRIORITY, REORDERING, HLORDER, DELDATE, CUST, MOD, TOD, SEQ,
    PICKWAVENR, PICKWAVEPRODLINE, PICKWAVETOUR, PICKWAVETOURSEQ, ROWNUM AS
    PICK_ORDKEY, PRODRUNID FROM (SELECT /*+ cardinality(g 15)*/
    EXTRACTVALUE(VALUE(G), '/InvOrder/Nr') AS INVORDERNR, EXTRACTVALUE(VALUE(G),
    '/InvOrder/Item') AS ITEM, EXTRACTVALUE(VALUE(G), '/InvOrder/Qty') AS QTY,
    EXTRACTVALUE(VALUE(G), '/InvOrder/Priority') AS PRIORITY,
    EXTRACTVALUE(VALUE(G), '/InvOrder/Reordering') AS REORDERING,
    EXTRACTVALUE(VALUE(G), '/InvOrder/HlOrder') AS HLORDER,
    TO_DATE(EXTRACTVALUE(VALUE(G), '/InvOrder/DelDate'),'DDMMYYYY') AS DELDATE,
    F.CUST, F.MOD, F.TOD, F.SEQ, F.PICKWAVENR, F.PICKWAVEPRODLINE,
    F.PICKWAVETOUR, F.PICKWAVETOURSEQ, F.PRODRUNNR, F.PRODRUNDATE,
    F.PRODRUNFINAL, F.PRODRUNID FROM (SELECT /*+ cardinality(e 60)*/VALUE(E) AS
    CUSTOMERNODE, EXTRACTVALUE(VALUE(E), '/Customer/Cust') AS CUST,
    EXTRACTVALUE(VALUE(E), '/Customer/Mod') AS MOD, EXTRACTVALUE(VALUE(E),
    '/Customer/Tod') AS TOD, TO_NUMBER(EXTRACTVALUE(VALUE(E), '/Customer/Seq'))
    AS SEQ, D.PICKWAVENR, D.PICKWAVEPRODLINE, D.PICKWAVETOUR, D.PICKWAVETOURSEQ,
    D.PRODRUNNR, D.PRODRUNDATE, D.PRODRUNFINAL, D.PRODRUNID FROM (SELECT /*+
    cardinality(c 100)*/VALUE(C) AS PICKWAVENODE, EXTRACTVALUE(VALUE(C),
    '/PickWave/Nr') AS PICKWAVENR, TO_NUMBER(EXTRACTVALUE(VALUE(C),
    '/PickWave/ProdLine')) AS PICKWAVEPRODLINE, EXTRACTVALUE(VALUE(C),
    '/PickWave/Tour') AS PICKWAVETOUR, TO_NUMBER(EXTRACTVALUE(VALUE(C),
    '/PickWave/TourSeq')) AS PICKWAVETOURSEQ, A.PRODRUNNR, A.PRODRUNDATE,
    A.PRODRUNFINAL, A.PRODRUNID FROM (SELECT /*+ cardinality(b 1)*/VALUE(B) AS
    PRODRUNNODE, EXTRACTVALUE(VALUE(B), '/ProdRun/Nr') AS PRODRUNNR,
    TO_DATE(EXTRACTVALUE(VALUE(B), '/ProdRun/Date'),'DDMMYYYY') AS PRODRUNDATE,
    EXTRACTVALUE(VALUE(B), '/ProdRun/Final') AS PRODRUNFINAL, X.ID PRODRUNID
    FROM XML_ORDERS X, TABLE(XMLSEQUENCE(EXTRACT(X.XMLFILE,'/PickData/ProdRun'))
    ) B WHERE X.ID = :B1 ) A, TABLE(XMLSEQUENCE(EXTRACT(A.PRODRUNNODE,
    '/ProdRun/PickWave'))) C ) D, TABLE(XMLSEQUENCE(EXTRACT(D.PICKWAVENODE,
    '/PickWave/Customer'))) E ) F, TABLE(XMLSEQUENCE(EXTRACT(F.CUSTOMERNODE,
    '/Customer/InvOrder'))) G ORDER BY PICKWAVEPRODLINE, PICKWAVETOURSEQ,
    PICKWAVENR, SEQ )
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 4324.09 9994.65 0 57193 0 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 4324.09 9994.65 0 57193 0 0
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 68 (recursive depth: 1)
    Rows Row Source Operation
    0 COUNT (cr=0 pr=0 pw=0 time=180 us)
    0 VIEW (cr=0 pr=0 pw=0 time=166 us)
    0 SORT ORDER BY (cr=0 pr=0 pw=0 time=152 us)
    40866 NESTED LOOPS (cr=54973 pr=0 pw=0 time=31065606 us)
    1363 NESTED LOOPS (cr=54937 pr=0 pw=0 time=11037183 us)
    1 NESTED LOOPS (cr=54889 pr=0 pw=0 time=10145883 us)
    1 NESTED LOOPS (cr=54841 pr=0 pw=0 time=9799012 us)
    1 TABLE ACCESS BY INDEX ROWID XML_ORDERS (cr=2 pr=0 pw=0 time=222 us)
    1 INDEX UNIQUE SCAN XML_ORDERS_PK (cr=1 pr=0 pw=0 time=126 us)(object id 58551)
    1 COLLECTION ITERATOR PICKLER FETCH (cr=54839 pr=0 pw=0 time=9798748 us)
    1 COLLECTION ITERATOR PICKLER FETCH (cr=48 pr=0 pw=0 time=346818 us)
    1363 COLLECTION ITERATOR PICKLER FETCH (cr=48 pr=0 pw=0 time=870830 us)
    40866 COLLECTION ITERATOR PICKLER FETCH (cr=36 pr=0 pw=0 time=18739302 us)
    Note that I cancelled this operation before it was over so I imagine that these figures refer to the statistics as of the time when the operation was interrupted.
    So, here are finally my questions.
    In order to create the constraints on the nested tables as shown in other threads, do I need to drop the existing xml_orders table and ancillary object types and recreate them or is there a way to add such constraints using the existing system generated object names?
    Secondly, the xml_orders table may contain severale documents, not just one and his current primary key is the column ID. So, in order to uniquely identify the deepest element in the xml document, I need first to select the relevant document by means of the id column.
    Would it be better to create the indexes containing this id column together with the nested_table_id and array_index?
    Thanks for you help.
    Flavio
    PS: I wrote a 10 lines xsl transformation that I passed on to Saxon together with the 32Mb file. It took less than 1 minute to produce a flat file that was loaded almost instantly by SQL*Loader. So, what I am looking for is a procedure loading this stuff in less than 2 minutes or possibly less.

    Does the following help
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:53 2005
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    SQL> spool registerSchema_&4..log
    SQL> set trimspool on
    SQL> connect &1/&2
    Connected.
    SQL> --
    SQL> declare
      2    result boolean;
      3  begin
      4    result := dbms_xdb.createResource('/home/&1/xsd/&4',
      5                                      bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
      6  end;
      7  /
    old   4:   result := dbms_xdb.createResource('/home/&1/xsd/&4',
    new   4:   result := dbms_xdb.createResource('/home/OTNTEST/xsd/GetaxTypes.xsd',
    old   5:                                    bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
    new   5:                                    bfilename(USER,'GetaxTypes.xsd'),nls_charset_id('AL32UTF8'));
    PL/SQL procedure successfully completed.
    SQL> commit
      2  /
    Commit complete.
    SQL> alter session set events='31098 trace name context forever'
      2  /
    Session altered.
    SQL> begin
      2    dbms_xmlschema.registerSchema
      3    (
      4      schemaURL => '&3',
      5      schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
      6      local     => TRUE,
      7      genTypes  => TRUE,
      8      genBean   => FALSE,
      9      genTables => &5
    10    );
    11  end;
    12  /
    old   4:     schemaURL => '&3',
    new   4:     schemaURL => 'private/GetaxTypes.xsd',
    old   5:     schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
    new   5:     schemaDoc => xdbURIType('/home/OTNTEST/xsd/GetaxTypes.xsd').getClob(),
    old   9:     genTables => &5
    new   9:     genTables => TRUE
    PL/SQL procedure successfully completed.
    SQL> quit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:55 2005
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    SQL> spool registerSchema_&4..log
    SQL> set trimspool on
    SQL> connect &1/&2
    Connected.
    SQL> --
    SQL> declare
      2    result boolean;
      3  begin
      4    result := dbms_xdb.createResource('/home/&1/xsd/&4',
      5                                      bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
      6  end;
      7  /
    old   4:   result := dbms_xdb.createResource('/home/&1/xsd/&4',
    new   4:   result := dbms_xdb.createResource('/home/OTNTEST/xsd/PickData.xsd',
    old   5:                                    bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
    new   5:                                    bfilename(USER,'PickData.xsd'),nls_charset_id('AL32UTF8'));
    PL/SQL procedure successfully completed.
    SQL> commit
      2  /
    Commit complete.
    SQL> alter session set events='31098 trace name context forever'
      2  /
    Session altered.
    SQL> begin
      2    dbms_xmlschema.registerSchema
      3    (
      4      schemaURL => '&3',
      5      schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
      6      local     => TRUE,
      7      genTypes  => TRUE,
      8      genBean   => FALSE,
      9      genTables => &5
    10    );
    11  end;
    12  /
    old   4:     schemaURL => '&3',
    new   4:     schemaURL => 'private/PickData.xsd',
    old   5:     schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
    new   5:     schemaDoc => xdbURIType('/home/OTNTEST/xsd/PickData.xsd').getClob(),
    old   9:     genTables => &5
    new   9:     genTables => TRUE
    PL/SQL procedure successfully completed.
    SQL> quit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:58 2005
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    SQL> spool createTable.log
    SQL> --
    SQL> connect &1/&2
    Connected.
    SQL> --
    SQL> CREATE TABLE "XML_ORDERS"
      2     ("ID" NUMBER(7,0) NOT NULL ENABLE,
      3      "XMLFILE" "SYS"."XMLTYPE" ,
      4      "INSERTED" DATE DEFAULT sysdate,
      5       CONSTRAINT "XML_ORDERS_PK" PRIMARY KEY ("ID") USING INDEX ENABLE
      6     ) XMLTYPE COLUMN XMLFILE STORE AS OBJECT RELATIONAL
      7       XMLSCHEMA "private/PickData.xsd"
      8       ELEMENT "PickData"
      9           VARRAY XMLFILE."XMLDATA"."ProdRun"."PickWave" STORE AS TABLE PickWave_TAB
    10             (
    11                ( primary key (nested_table_id, array_index)
    12                ) organization index overflow
    13                VARRAY "Customer" STORE AS TABLE Customer_TAB
    14                  (
    15                    (primary key (nested_table_id, array_index)
    16                    ) organization index overflow
    17                    VARRAY "InvOrder" STORE AS TABLE InvOrder_TAB
    18                      (
    19                        (primary key (nested_table_id, array_index)
    20                        ) organization index overflow
    21                      )
    22                  )
    23            )
    24  /
    Table created.
    SQL> quit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:59 2005
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    SQL> spool insertFile_&3..log
    SQL> set trimspool on
    SQL> connect &1/&2
    Connected.
    SQL> --
    SQL> set timing on
    SQL> set long 10000
    SQL> --
    SQL> insert into XML_ORDERS (ID, XMLFILE) values (&4, xmltype(bfilename(USER,'&3'),nls_charset_id('AL32UTF8')))
      2  /
    old   1: insert into XML_ORDERS (ID, XMLFILE) values (&4, xmltype(bfilename(USER,'&3'),nls_charset_id('AL32UTF8')))
    new   1: insert into XML_ORDERS (ID, XMLFILE) values (10, xmltype(bfilename(USER,'testcase.xml'),nls_charset_id('AL32UT
    8')))
    1 row created.
    Elapsed: 00:00:00.11
    SQL> commit
      2  /
    Commit complete.
    Elapsed: 00:00:00.01
    SQL> quit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:59 2005
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    SQL> spool testcase.log
    SQL> set trimspool on
    SQL> connect &1/&2
    Connected.
    SQL> --
    SQL> set timing on
    SQL> set long 10000
    SQL> set pages 0 lines 140
    SQL> --
    SQL> -- Testcase code here
    SQL> --
    SQL> set autotrace on explain
    SQL> --
    SQL> create or replace view PROD_RUN_VIEW
      2  (
      3    PRODRUNNODE,
      4    PRODRUNNR,
      5    PRODRUNDATE,
      6    PRODRUNID,
      7    PRODRUNFINAL
      8  )
      9  as
    10  select EXTRACT(XMLFILE,'/PickData/ProdRun'),
    11         EXTRACTVALUE(XMLFILE , '/PickData/ProdRun/Nr'),
    12         TO_DATE(EXTRACTVALUE(XMLFILE, '/PickData/ProdRun/Date'),'DDMMYYYY'),
    13         ID,
    14         EXTRACTVALUE(XMLFILE,'/PickData/ProdRun/Final')
    15    from XML_ORDERS
    16  /
    View created.
    Elapsed: 00:00:00.09
    SQL> create or replace view PICK_WAVE_VIEW
      2  (
      3    PICKWAVENODE,
      4    PICKWAVENR,
      5    PICKWAVEPRODLINE,
      6    PICKWAVETOUR,
      7    PICKWAVETOURSEQ,
      8    PRODRUNNR,
      9    PRODRUNDATE,
    10    PRODRUNID,
    11    PRODRUNFINAL
    12  )
    13  as
    14  select value(PW),
    15         extractValue(value(PW),'/PickWave/Nr'),
    16         TO_NUMBER(EXTRACTVALUE(value(PW),'/PickWave/ProdLine')),
    17         extractValue(value(PW),'/PickWave/Tour'),
    18         TO_NUMBER(extractValue(value(PW),'/PickWave/TourSeq')),
    19         PRODRUNNR,
    20         PRODRUNDATE,
    21         PRODRUNID,
    22         PRODRUNFINAL
    23    FROM PROD_RUN_VIEW, table(xmlsequence(extract(PRODRUNNODE,'/ProdRun/PickWave'))) PW
    24  /
    View created.
    Elapsed: 00:00:00.09
    SQL> create or replace view CUSTOMER_VIEW
      2  (
      3    CUSTOMERNODE,
      4    CUST,
      5    MOD,
      6    TOD,
      7    SEQ,
      8    PICKWAVENR,
      9    PICKWAVEPRODLINE,
    10    PICKWAVETOUR,
    11    PICKWAVETOURSEQ,
    12    PRODRUNNR,
    13    PRODRUNDATE,
    14    PRODRUNFINAL,
    15    PRODRUNID
    16  )
    17  as
    18  select value(CUST),
    19         EXTRACTVALUE(VALUE(CUST), '/Customer/Cust'),
    20         EXTRACTVALUE(VALUE(CUST), '/Customer/Mod'),
    21         EXTRACTVALUE(VALUE(CUST), '/Customer/Tod'),
    22         TO_NUMBER(EXTRACTVALUE(VALUE(CUST), '/Customer/Seq')),
    23         PICKWAVENR,
    24         PICKWAVEPRODLINE,
    25         PICKWAVETOUR,
    26         PICKWAVETOURSEQ,
    27         PRODRUNNR,
    28         PRODRUNDATE,
    29         PRODRUNFINAL,
    30         PRODRUNID
    31    from PICK_WAVE_VIEW, table(xmlsequence(extract(PICKWAVENODE,'/PickWave/Customer'))) CUST
    32  /
    View created.
    Elapsed: 00:00:00.10
    SQL>
    SQL> create or replace view INVOICE_ORDER_VIEW
      2  (
      3    INVORDERNR,
      4    ITEM,
      5    QTY,
      6    PRIORITY,
      7    REORDERING,
      8    HLORDER,
      9    DELDATE,
    10    CUST,
    11    MOD,
    12    TOD,
    13    SEQ,
    14    PICKWAVENR,
    15    PICKWAVEPRODLINE,
    16    PICKWAVETOUR,
    17    PICKWAVETOURSEQ,
    18    PRODRUNNR,
    19    PRODRUNDATE,
    20    PRODRUNFINAL,
    21    PRODRUNID
    22  )
    23  as
    24  SELECT EXTRACTVALUE(VALUE(INV), '/InvOrder/Nr'),
    25         EXTRACTVALUE(VALUE(INV), '/InvOrder/Item'),
    26         EXTRACTVALUE(VALUE(INV), '/InvOrder/Qty'),
    27         EXTRACTVALUE(VALUE(INV), '/InvOrder/Priority'),
    28         EXTRACTVALUE(VALUE(INV), '/InvOrder/Reordering'),
    29         EXTRACTVALUE(VALUE(INV), '/InvOrder/HlOrder'),
    30         TO_DATE(EXTRACTVALUE(VALUE(INV), '/InvOrder/DelDate'),'DDMMYYYY'),
    31         CUST,
    32         MOD,
    33         TOD,
    34         SEQ,
    35         PICKWAVENR,
    36         PICKWAVEPRODLINE,
    37         PICKWAVETOUR,
    38         PICKWAVETOURSEQ,
    39         PRODRUNNR,
    40         PRODRUNDATE,
    41         PRODRUNFINAL,
    42         PRODRUNID
    43   FROM CUSTOMER_VIEW, table(xmlsequence(extract(CUSTOMERNODE,'Customer/InvOrder'))) INV
    44  /
    View created.
    Elapsed: 00:00:00.13
    SQL> select * from INVOICE_ORDER_VIEW
      2  /
    IIO0000461           100000036                    20          1          0 CSO000743            15-NOV-05 100000013
    FO                             DDU                                     6 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000463           100000045                    20          1          0 CSO000743            15-NOV-05 100000013
    FO                             DDU                                     6 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000473           100000036                    20          1          0 CSO000746            15-NOV-05 100000143
    FO                             DDU                                     7 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000475           100000045                    20          1          0 CSO000746            15-NOV-05 100000143
    FO                             DDU                                     7 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000469           100000036                    20          1          0 CSO000745            15-NOV-05 100000140
    FO                             DDU                                     3 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000471           100000045                    20          1          0 CSO000745            15-NOV-05 100000140
    FO                             DDU                                     3 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000489           100000036                    20          0          0 CSO000751            15-NOV-05 100000148
    FO                             DDU                                    10 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000491           100000045                    20          1          0 CSO000751            15-NOV-05 100000148
    FO                             DDU                                    10 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000481           100000036                    20          0          0 CSO000748            15-NOV-05 100000146
    FO                             DDU                                     9 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000483           100000045                    20          1          0 CSO000748            15-NOV-05 100000146
    FO                             DDU                                     9 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000485           100000036                    20          0          0 CSO000750            15-NOV-05 100000147
    FO                             DDU                                     4 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000487           100000045                    20          1          0 CSO000750            15-NOV-05 100000147
    FO                             DDU                                     4 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000457           100000036                    20          1          0 CSO000742            15-NOV-05 100000006
    FO                             DDU                                     5 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000459           100000045                    20          1          0 CSO000742            15-NOV-05 100000006
    FO                             DDU                                     5 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000477           100000036                    20          1          0 CSO000747            15-NOV-05 100000145
    FO                             DDU                                     8 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000479           100000045                    20          1          0 CSO000747            15-NOV-05 100000145
    FO                             DDU                                     8 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000465           100000036                    20          1          0 CSO000744            15-NOV-05 100000114
    FO                             DDU                                     2 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    IIO0000467           100000045                    20          1          0 CSO000744            15-NOV-05 100000114
    FO                             DDU                                     2 IPW0000017                1 00000043_078
                    1
             5 15-NOV-05            1         10
    18 rows selected.
    Elapsed: 00:00:00.22
    Execution Plan
    Plan hash value: 1730223965
    | Id  | Operation                | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT         |                   |    18 | 10278 |   877   (0)| 00:00:11 |
    |   1 |  NESTED LOOPS            |                   |    18 | 10278 |   877   (0)| 00:00:11 |
    |   2 |   NESTED LOOPS           |                   |    18 |  8424 |   841   (0)| 00:00:11 |
    |   3 |    MERGE JOIN CARTESIAN  |                   |    18 |  4680 |   805   (0)| 00:00:10 |
    |   4 |     TABLE ACCESS FULL    | XML_ORDERS        |     1 |    67 |     3   (0)| 00:00:01 |
    |   5 |     BUFFER SORT          |                   |    18 |  3474 |   802   (0)| 00:00:10 |
    |   6 |      INDEX FAST FULL SCAN| SYS_IOT_TOP_64187 |    18 |  3474 |   802   (0)| 00:00:10 |
    |*  7 |    INDEX UNIQUE SCAN     | SYS_IOT_TOP_64185 |     1 |   208 |     2   (0)| 00:00:01 |
    |*  8 |     INDEX RANGE SCAN     | SYS_C008783       |     1 |       |     0   (0)| 00:00:01 |
    |*  9 |   INDEX UNIQUE SCAN      | SYS_IOT_TOP_64183 |     1 |   103 |     2   (0)| 00:00:01 |
    |* 10 |    INDEX RANGE SCAN      | SYS_C008785       |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       7 - access("NESTED_TABLE_ID"="CUSTOMER_TAB"."SYS_NC0000800009$")
       8 - access("NESTED_TABLE_ID"="CUSTOMER_TAB"."SYS_NC0000800009$")
       9 - access("NESTED_TABLE_ID"="PICKWAVE_TAB"."SYS_NC0000800009$")
           filter("NESTED_TABLE_ID"="XML_ORDERS"."SYS_NC0001000011$")
      10 - access("NESTED_TABLE_ID"="PICKWAVE_TAB"."SYS_NC0000800009$")
    Note
       - dynamic sampling used for this statement
    SQL> quit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    C:\oracle\xdb\otn\347125>You were sequencing the ProdRun node, which is a mistake. Only nodes which occur multiple times should be sequenced...

  • [CS3] [JS] add XML  Element to Insertion Points

    hi list,
    i'll do some text parsing in indesign cs3 intended to add some xml elements to my document.
    i just wonder why i can't markup an insertion point. is the following approach correct? The code works fine, only the return value (stored in the _xml variable) is not the new element but the parent element. The same code works without using the insertion point (marking up the text object [xmlElements.add(_dokument.xmlTags.item("index") , erg[0]))] ).
    Any ideas or thoughts?
    var _dokument = app.activeDocument;
    main ();
    // ** main ()
    function main() {
    //Set the find options.
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences= NothingEnum.nothing;
    //find any string encloased by @
    app.findGrepPreferences.findWhat = "@.*?@";
    erg = _dokument.findGrep();
    while (erg.length > 0) {
    _xml = _dokument.xmlElements[0].xmlElements.item("text").xmlElements.add(_dokument.xmlTags.item( "index") , erg[0].insertionPoints[0]);
    erg[0].contents = "";
    erg = _dokument.findGrep();

    hi dave,
    gui testing is always a good idea :-) but in this case the behaviour is different:
    your observation is correct (anyway at least a strange behaviour compared to any xml editing tool i know == how adobe intended to insert an empty element?), tagging in the gui a tagged insertion point tags the whole story.
    in the script a new element is added but the return value is the parent element (the xmlElement of the whole story).
    this causes a problem when i add an attribute (the intention of the above script is to add references) which is added to the parent element.
    gregor

  • Carriage Returns and Tabs in XML element

    I have a number of carriage returns and tabs within an xml element. When I take that element I would like it to transform to html in which I am then displaying within a JEditorPane. However, when I do this it is one long string. I have tried the xml:space="preserve" within that element and this still is not working.
    Here is part of the xml with the carriage return line feeds. The element that I am talking about is called pseudocode. You can see it is displayed correctly below.
    Design Document XML : <?xml version="1.0" encoding="ISO-8859-1"?><design-doc><title-page><title>Testing Document</title><class-prepared-for>Lloyd</class-prepared-for><authors>Ben Garbers</authors><date-created>September 23, 2004</date-created></title-page><introduction text="This is the introduction. This is the introduction."/><class-definitions><class-definition class-name="ClassOne" visibility="public" class-complexity="not complex"><global-variables><variable visibility="public" name="VariableOne" object="String" comments="This is a String."/><variable visibility="public" name="VariableTwo" object="Integer" comments="This is an Integer."/></global-variables><methods><method name="MethodOne" synopsis="This will do some things." purpose="public" visibility="public"><input-parms><variable visibility="null" name="firstName" object="String" comments="null"/></input-parms><output-parms><variable visibility="null" name="lastName" object="String" comments="null"/></output-parms><local-variables><variable visibility="null" name="age" object="int" comments="null"/></local-variables><pseudocode xml:space="preserve">/* Ensure that player name exist in the system*/
    if (player =null)
         NullPlayerException;
              if (NOT (isPlayerNameExist(player)))
                   throw PlayerNameNotExistException;
              /* Ensure player name exist in the team already*/
              i ? 1;
              while (i <= length(mPlayers)) {
                   if (mPlayers.mPlayerName != playerName)
                        throw PlayerNameNotExistInTeamException;
    this.mPlayers ? this.mPlayers - player;</pseudocode>
    However, when I do the transformation I get the following with the pseudocode:
    /* Ensure that player name exist in the system*/if (player =null)     NullPlayerException;          if (NOT (isPlayerNameExist(player)))               throw PlayerNameNotExistException;          /* Ensure player name exist in the team already*/          i ? 1;          while (i <= length(mPlayers)) {               if (mPlayers[i].mPlayerName != playerName)                    throw PlayerNameNotExistInTeamException;}this.mPlayers ? this.mPlayers - player;
    It looks like it adds some spaces but no carriage returns or line feeds.
    My transformation code is the following:
         public ParseFile(String xmlString) {
              try {
              //Here we will load the correct style sheet for the message
              //that will be formatted.
              String urlString = "DesignDocument.xsl";
              URL url = this.getClass().getResource(urlString);
              System.out.println("URL to style sheet = " + url.toString());
              String styleSheetName = url.getFile();
              System.out.println("Style sheet name : " + styleSheetName);
              InputStream styleSheetInputStream = this.getClass().getResourceAsStream(urlString);
              //We will than load our SAXParerFactory and parse the message.
              SAXParserFactory SPFactory = SAXParserFactory.newInstance();
              SPFactory.setValidating(true);
              SAXParser sp = SPFactory.newSAXParser();
              XMLReader sax2parser = sp.getXMLReader();
              //NO Validation done on for this because we do NOT have a DTD.
              sax2parser.setFeature(
                   "http://xml.org/sax/features/validation",
                   false);
              sax2parser.setContentHandler(new FileContentHandler());
              //we create a character array of the length of the xml message String
              char[] messageCharacterArray =
                   new char[xmlString.length()];
              // we then put the xml string into the character array.
              messageCharacterArray = xmlString.toCharArray();
              // after this ew end up creating a CharArrayReader that will be used by the Sax
              // parser to parse the xml.
              CharArrayReader xmlCharArrayReader =
                   new CharArrayReader(messageCharacterArray);
              // we put the xml character array within the Input Source which will then be parsed
              // by the Sax2 parser.
              InputSource in = new InputSource(xmlCharArrayReader);
              // Use a Transformer for outputting the message into our formatted xml using
              // the stylesheet defined up in a messages own sxl stylesheet file.
              TransformerFactory tFactory = TransformerFactory.newInstance();
              tFactory.setURIResolver(new BasicURIResolver());
              StreamSource stylesource = new StreamSource(styleSheetInputStream);
              Transformer transformer = tFactory.newTransformer(stylesource);
    //          transformer.setOutputProperty(OutputKeys.INDENT, "yes");
    //          transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
    //          Properties properties = new Properties();
    //          properties.setProperty("indent", "yes");
    //          properties.setProperty("{http://xml.apache.org/xslt}indent-amount", "2");
    //          transformer.setOutputProperties(properties);
              // We will use a ByteArrayOutputStream to put our transformed xml.
              ByteArrayOutputStream bos = new ByteArrayOutputStream();
              StreamResult result = new StreamResult(bos);
              SAXSource source = new SAXSource(in);
              transformer.transform(source, result);
              String s = bos.toString();
              StringBuffer sb = new StringBuffer();
              //This will make sure the Version Line is not shown.
              BufferedReader br = new BufferedReader(new StringReader(s));
              String line = "";
              while ((line = br.readLine()) != null) {
                        sb.append(line);
              bos.close();
              br.close();
              formattedXmlString = sb.toString();
              System.out.println("--------------------------------");
              System.out.println(formattedXmlString);
              System.out.println("--------------------------------");
              } catch (Exception e) {
                   e.printStackTrace();
    I have been searching and trying to figure this out forever. Any help would be greatly appreciated. Bottom line is that I want carriage returns and tabs to work when transferring from the xml to xsl.

    I get the following line when adding the <pre> tags.
    /* Ensure that player name exist in the system*/if (player =null)     NullPlayerException;          if (NOT (isPlayerNameExist(player)))               throw PlayerNameNotExistException;          /* Ensure player name exist in the team already*/          i ? 1;          while (i <= length(mPlayers)) {               if (mPlayers[i].mPlayerName != playerName)                    throw PlayerNameNotExistInTeamException;}this.mPlayers ? this.mPlayers - player;
    On the screen this is shown on 1 line. It looks like the tabs are working correctly. However, the carriage return, line feeds do not seem to be working. The xml that is pushed into the transformation has the carriage returns and line feeds and is formatted correctly. There has to be something happening when the xsl takes the xml String. When I add <BR></BR> within the xml that doesn't seem to work either.
    I am really sumpted. If you could help DrClap I would really be appreciated.

  • Remove XML tags from XML element in Oracle

    Hi,
    I have a requirement where I have to remove all the xml tags from xml element with banks, currently I'm using replace 4 times to replace all different types of xml tags, performance is really bad. is there any better option to remove xml tags from xml data leaving the actual data. please find the example data below.
    select
    TO_CLOB(REPLACE(REPLACE(REPLACE(REPLACE
    ('<Concatcolumn><ConcatGroupID>MyText Data goes here </ConcatGroupID><ConcatGroupID>Data agian</ConcatGroupID></Concatcolumn>','<ConcatGroupID>'),'<Concatcolumn>'),'</ConcatGroupID>',';'),';</Concatcolumn>')) AS Concatcolumn
    from dual
    **************Out put*************
    MyText Data goes here ;Data agian

    One way is to use xquery:
    SQL> with t as
    select xmltype('<Concatcolumn>
                          <ConcatGroupID>MyText Data goes here </ConcatGroupID><ConcatGroupID>Data agian</ConcatGroupID></Concatcolumn>'
       ) xml from dual
    select xmlquery('string-join(//text(), ";")' passing xml returning content).getclobval() xml from t
    XML                                                              
    MyText Data goes here ;Data agian                                
    1 row selected.

  • Multi-level nested tables for repeatable XML Elements

    Hi there,
    Suppose we have a XML Schema „ASchema“ like this (XMLDB schema annotations are left out for simplicity):
    <xs:schema xmlns:xs=" .... " />
    <xs:element name=“A“>
         <xs:complexType>
              <xs:sequence>
                   <xs:element name=“B“ maxOccurs=“unbounded“/>
                        <xs:complexType>
                             <xs:sequence>
                                  <xs:element name = “C“ maxOccurs=“unbounded“/>
                             </xs:sequence>
                        </xs:complexType>
                   </xs:element>
              </xs:sequence>
         </xs:complexType>
    </xs:element>
    </xs:schema>
    After registering this schema in Oracle, I can define a table like this:
    CREATE TABLE ATable
    id NUMBER,
    doc XMLTYPE
    XMLTYPE COLUMN doc
    XMLSCHEMA “ASchema“ ELEMENT “A“
    VARARRAY doc.“XMLDATA“.“B“ STORE AS TABLE “BTable“
    ((PRIMARY KEY (NESTED_TABLE_ID, SYS_NC_ARRAY_INDEX$)) ORGANIZATION INDEX)
    This creates a nested table "BTable" within the table "ATable". So far so good, I can use this nested table to gain faster access on every possible subelement of Element B when I set an appropriate index.
    I now want to create another nested table for element “C“ like this:
    DROP TABLE ATable;
    CREATE TABLE ATable
    id NUMBER,
    doc XMLTYPE
    XMLTYPE COLUMN doc
    XMLSCHEMA “ASchema“ ELEMENT “A“
    VARARRAY doc.“XMLDATA“.“B“ STORE AS TABLE “BTable“
    ((PRIMARY KEY (NESTED_TABLE_ID, SYS_NC_ARRAY_INDEX$)) ORGANIZATION INDEX)
    VARARRAY doc.“XMLDATA“.“B“.“C“ STORE AS TABLE “CTable“
    ((PRIMARY KEY (NESTED_TABLE_ID, SYS_NC_ARRAY_INDEX$)) ORGANIZATION INDEX)
    But this statement fails with the error message something like „ ... no such attribute ... „
    And here's my question: is it possible to create nested tables for repeatable XML Elements that are subelements of other repeatable XML Elements ? And if so, how can I do it ?
    Thank you very much in advance
    Jan

    Found a (partial) solution myself:
    If you add the attribute xdb:storeVarrayAsTable="true" to the root element of the XML schema, Oracle XMLDB generates nested tables for all repeatable XML Elements while registering the XML schema.
    Unfortunately, the names of these nested tables are system-generated, hence it's a bit uncomfortable to set indices on them. You can find out the names of these nested tables as follows:
    select table_name, parent_table_name, parent_table_column from user_nested_tables;
    Further information on that subject is supplied in the following thread:
    Re: default tables for elements with maxoccurs > 1
    It would be nice if there was a way to name the generated nested tables via appropriate XMLDB schema annotations.
    regards
    Jan

  • XML Element of XML Element of XML Element (and so on...)

    Here is my XML data (shorted, in a file myFile):
    <LiveData>
    <Voltage>
    <Total>
    <VoltageNow>1052</VoltageNow>
    </Total>
    </Voltage>
    <Power>
    <Total>
    <PowerNow>345</PowerNow>
    </Total>
    </LiveData>
    I would like to get the VoltageNow and PowerNow values, but the following script does not work:
    tell application "System Events"
    set elem1 to XML element 1 of XML file myFile /*<LiveData>
    set power to XML elements of elem1 whose name is "Power"
    set total to XML elements of power whose name is "Total"
    set powernow to value of XML elements of total whose name is "PowerNow"
    end tell
    Error: System Events got an error: Can’t make {} into type string.
    BTW, I don't want to use XML Element X because the order may change.
    What is the correct method to traverse these elements to obtain values?

    AppleScript can handle the strings, but the System Events XML Suite doesn't work with text strings - it deals with the XML objects, which have name and value properties. The handler can be modified to show the names of an element, but it is just designed to work with the XML Suite.
    The contents of an XML file is just text, so you can forgo System Events and just use regular text manipulation statements, or use another tool such as the Satimage XMLLib osax, which is much more robust and does include commands to display the XML object as a string.
    By the way, my original handler was designed and tested in Leopard, but I discovered a Snow Leopard bug that alters the way it returns array/list contents. The following script has changes that return the functionality, in addition to a dialog handler that will display lists:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #DAFFB6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    on run -- example
    set XMLFile to (choose file without invisibles)
    show("element value:", (getXMLElement from {XMLFile, "LiveData", "Voltage", "Total", "VoltageNow"}))
    end run
    to show(label, something)
    show an alert for something, formatting lists and records
    parameters - label [text]: the alert text
    something [mixed]: an item to put in the alert message
    returns nothing
    if something is not in {null, missing value} then
    try -- show the message
    if (class of something) is in {list, record} then (something as number) -- force an error
    display alert label message (something as text)
    on error errorMessage -- lists and records don't format very well, so cheat
    set {here, there} to {(offset of "{" in errorMessage), -(offset of "}" in (reverse of text items of errorMessage) as text)}
    display alert label message text here thru there of errorMessage
    end try
    else
    display alert label message "*null or missing value*"
    end if
    end show
    to getXMLElement from XMLItems
    get the specified element from a simple XML structure by name or index
        the number of items is not fixed, but must be at least 2 (the XML file and an XML element)
      parameters: XMLItems [list] -
    item 1 [text]: the XML file path (Finder or POSIX)
    item 2 [mixed]: the XML element name or index (names are case sensitive)
    item(s) 3+ [mixed]: sub item(s)
    returns [list]: value of the element
    try
    if (count XMLItems) is less than 2 then error "getXMLElement handler:  item list contains too few items"
    tell application "System Events"
    set theXMLData to contents of XML file ((the first item of XMLItems) as text)
    -- get text of theXMLData
    set theXMLElement to XML element 1 of theXMLData -- start at the root element
    repeat with anItem in rest of XMLItems -- add on the sub items
    set anItem to contents of anItem
    try
    set anItem to anItem as integer -- index number?
    end try
    set theXMLElement to (get XML element anItem of theXMLElement)
    end repeat
    try -- return the element(s)
    -- return name of XML elements of theXMLElement
    set theResult to value of theXMLElement -- SL built-in result variable does not get set
    if theResult is missing value then error -- SL does not error on empty or missing value
    return theResult
    on error errorMessage number errorNumber -- the element is empty, or a list of items
    log errorMessage
    return value of XML elements of theXMLElement
    end try
    end tell
    on error errorMessage number errorNumber
    log errorMessage
    -- return null
    error "getXMLElement handler:  element not found (" & errorNumber & ")"
    end try
    end getXMLElement</pre>

  • How to insert Text physically to xml in xml Element

    hello friends,
    I am newb of jDom. i am trying to change xml "Element's"--->"Text". My xml is as follows .....
    <?xml version ="1.0">
    <Elements>
             <code>
                       <data>EE550</data>
             </code>
    </Elements> I am trying to replace that "<data>" by <data>AA550</data>
    my code is as below
                 SAXBuilder sb = new SAXBuilder();
                 Document doc = sb.build(new File("src/xml/M90EE.xml"));
                 Element element = doc.getRootElement();
                 List children = element.getChildren();
                 String key = (element.getChild("text").getChild("mkey").setText("AA550").getTextTrim());   System.out.println("mkey       :"+key);
    output:
    mkey   :AA550 but is it possible to change in the xml file phisically.
    thanQ
    Ajay

    hello Reegz,
    ThanQ so much for perfect solution....
    when i do like that it is actually adding text to the existing Element Text.. so i wrote as follows....
    SAXBuilder sb = new SAXBuilder();
    Document doc = sb.build(new File("src/xml/M90EE.xml"));
    *String skey = (element.getChild("text").getChild("mkey").removeContent().toString());*     //--------->step 1
    *String skey1 = (element.getChild("text").getChild("mkey").addContent("ISO9001").toString());* //-------->step 2     
    String rdmkey = (element.getChild("text").getChild("mkey").getTextTrim());
    XMLOutputter serializer = new XMLOutputter();
    String str = serializer.outputString(doc);
    FileWriter fr = new FileWriter("src/xml/M90EE.xml");
    fr.write(str);
    fr.flush();
    fr.close();Is there any other way to replace text in step1 and step2 other than above or will it be enough for multiuser programming. Because this application will be accessed by so many number of user's what do u sujjest.
    thanQ ...
    Han.

  • XML element to wanted position in content text?

    Hi,
    I am using java's XML document builder (javax.xml.parsers.*)....
    is it possible to create XML element to wanted position in content text, such as:
    <mycontent>
    Here comes text <AndHereIsElementInWantedPosition ... /> and the normal text does continue.
    Here comes text (2) <AndHereIsElementInWantedPosition ... /> and the normal text (2) does continue.
    </mycontent>
    I see only Element::appendChild(), and Element::setTextContent() functions, but it seems it's not possible with those functions.
    and if it's possible, what functions I should use to read Elements & their position from content text? (Node class doesn't tell the position).

    is it possible to create XML element to wanted position in content textYes. Text is just another kind of node. You can interleave Elements with Text nodes. The Elements aren't 'inside' the text, they are beside it, as sibling nodes.
    I see only Element::appendChild(), and Element::setTextContent() functions, but it seems it's not possible with those functions.Should be. Just append children, Text nodes or Elements.
    and if it's possible, what functions I should use to read Elements & their position from content text?You don't. You read the child nodes from the parent element. Some of them will be Text nodes, some of them will be Elements.

  • How to refer ?XML element tag name? in the RTF variable

    Hi All,
    I want to declare variable and assign the value of XML element tag to that variable.
    Following are the steps:
    <?xdoxslt:set_variable($_XDOCTX, MYCOUNT,1)?>
    <?xdoxslt:get_variable($_XDOCTX, MYCOUNT)?>
    <?if: xdoxslt:get_variable($_XDOCTX, MYCOUNT) =1?>xxx<?end if?>
    In the declaration part,I need to replace 1 with some of the xml element tag value(for example : <?vendor_name?>).
    But when I try to do so,I get some list of exceptions.
    Please suggest how to proceed.
    Thanks and Regards,
    Kaveri

    Hi Pradeep,
    Thanks for your response.Here my requirement goes:
    for -each:
    text(database value)
    end for-each
    This text value will continue from page 1 to N.
    So for page1 I want HEADER1 and from page2 onwards,I require different header HEADR2.
    By using your approach,my text which needs to be continued on different pages will not be acheived.
    One more thing I got from XMLP User guide:
    <xdofo:inline-total
    display-condition="exceptfirst"
    name="InvAmt">.
    SInce all my tags are generated from Oracel reports,I am unable to use the above xml line.Is there any way to use this by modifying the syntax..
    Please let me know your suggestions since this is show stopper for my report.
    Thanks and Regards,
    Kaveri

  • Out XML element values extract

    hi their
    How can I out XML element the values extract and in a loop in variable and/or in an array store?
    Example:
    [loop]
    <SA>'MS','GYM'</SA>
    Values 'MS' and 'GYM' should be in variables e.g var1='MS' and var2='GYM'
    [end loop]
    Please, help me!!!! Urgent
    thanx you for advice
    kind regards
    Holger

    create or replace procedure spTestXML is
      xml   xmltype;
      test  varchar2(100);
      test2 xmltype;
      cursor lvCur_GetAllSecGrps is
        SELECT extractValue(value(asec), '/SEC_GRP/NAME') as Name
        FROM table(xmlsequence(xml)) a,
             table(xmlsequence(extract(value(a), '/EVENT/SEC_GRP_LIST/SEC_GRP'))) asec;
    begin
      xml := xmltype('<EVENT>
    <SWTSUPDATE TYPE="1">
    <MEMBERID>9822598</MEMBERID>
    <DATETIME>Fri Jun 09 14:51:33 CDT 2006</DATETIME>
    <USERID>W951FVK</USERID>
    </SWTSUPDATE>
    <CONTACT_HISTORY>
    <USER>
    <USER_ID>W951FVK</USER_ID>
    <FIRST_NAME>John</FIRST_NAME>
    <LAST_NAME>Givens</LAST_NAME>
    </USER>
    <USER>
    <USER_ID>W951FNN</USER_ID>
    <FIRST_NAME>Mary</FIRST_NAME>
    <LAST_NAME>McNair</LAST_NAME>
    </USER>
    <CONSUMER>
    <CONS_SEQ_NBR>1387445</CONS_SEQ_NBR>
    <FIRST_NAME>SPRINGHOUSE</FIRST_NAME>
    <LAST_NAME>ELLIS</LAST_NAME>
    </CONSUMER>
    </CONTACT_HISTORY>
    <SEC_GRP_LIST>
    <SEC_GRP><NAME>cspupdatecustpayee</NAME><DESCRIPTION>Add/Update/Delete CSP Customer Payees</DESCRIPTION></SEC_GRP>
    <SEC_GRP><NAME>cspupdatepayment</NAME><DESCRIPTION>Add/Update/Delete CSP Payment</DESCRIPTION></SEC_GRP>
    <SEC_GRP><NAME>adminreports</NAME><DESCRIPTION>Administrate Reports</DESCRIPTION></SEC_GRP>
    <SEC_GRP><NAME>billopscsr</NAME><DESCRIPTION>Bill Operations CSR</DESCRIPTION></SEC_GRP>
    </SEC_GRP_LIST>
    </EVENT>');
      if xml.existsNode('/EVENT/SEC_GRP_LIST/SEC_GRP/NAME') != 0 THEN
        for lvAllSecGrps in lvCur_GetAllSecGrps loop
          dbms_output.put_line('Found: '||lvAllSecGrps.Name);
        end loop;
      end if;
    end spTestXML;gives
    Found: cspupdatecustpayee
    Found: cspupdatepayment
    Found: adminreports
    Found: billopscsrhth

  • Extracting the Attributes values of an XML Element

    Dear Forum Members
    Please tell me any XML Function which is used to extract the Attribute value of an XML Element.
    Given below
    <BRKCD_STREDSWTINVIN_C Key="6708">
    is an Element With some Key value.
    I want to have that Key value.
    Using Extract and Extractvalue I am not able to get the Attribute value.
    Is there any way..
    Regards
    Madhu K

    Your xml is not really complete ;), but this should get you started:
    michaels>  with t as
    (select xmltype('<BRKCD_STREDSWTINVIN_C Key="6708"></BRKCD_STREDSWTINVIN_C>') xml from dual)
    select d.xml, d.xml.extract('//BRKCD_STREDSWTINVIN_C/@Key') key
      from t d
    XML                                                            KEY    
    <BRKCD_STREDSWTINVIN_C Key="6708"></BRKCD_STREDSWTINVIN_C>     6708   

  • [JS-CS4] Associated XML element...

    Hi,
    I'm going crazy with this.
    I have a table built with XML import and I need to get the XML element associated with a cell.
    I use this code:
    cell.associatedXMLElement
    but it always returns "null".
    Obviously that cell has a content in XML structure...
    Any idea why?
    Thanks.

    Here's my script:
    var my_doc = app.activeDocument;
    var my_table = my_doc.pages.firstItem().textFrames.firstItem().tables.firstItem();
    my_table.columns.firstitem().select();
    var my_selection = doc.selection;
    for(var c = 0; c < my_selection.length; c++){
         if(my_selection[c].associatedXMLElement.xmlAttributes.itemByName("type").value != "house"){
              my_selection[c].appliedCellStyle = doc.cellStyles.itemByName("column");
              my_selection[c].clearCellStyleOverrides(true);
    This will run once the table is placed through XML import
    I need to check the "type" XML attribute value for every XML cell, that's why I'm performing that if statement.
    Basically if a cell's XML element has a "type" attribute with "house" value the script will not apply the "column" style.
    The problem is that
    my_selection[c].associatedXMLElement
    always return null.
    The XML data structure is:
    <List><Category><Table><Cell/><Cell/>....</Table></Category></List>
    So I have a simple table inside a textFrame.
    I know what I'm doing could sound weird, but I experienced it's the most quick way to handle a big table within ID.
    Here's the background story
    Thanks again.

  • SAX, incor. data for XML element, XML 1.1 doc (1.0 ok) in JRE 6 (JRE 5 ok)

    Hello,
    for some reason, the test case below fails when driven with Java 6. Looks like, when long string data is stored in a XML element, DocumentHandler's characters() method will be provided with incorrect data.
    With XML 1.0, parsing works fine in all my tests, Apache Xerces, JRE 5, JRE 6.
    With XML 1.1., parsing works fine with Apache Xerces, JRE5 but not with JRE6.
    I've checked it with latest JRE 6 update 4.
    Anyone else xperiencing such problems with XML1.1 parsing when using JAXP bundled with Java 6?
    I've tried to file a bug at bugdatabase, but for some reason I got no response for my issue - so I'm trying the forum now ;-)
    Thanx for comments
    Merten
    import java.io.StringReader;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.Attributes;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    import junit.framework.TestCase;
    import junit.framework.TestResult;
    import junit.framework.TestSuite;
    /** snippet to demonstrate problem in SAXParser */
    public class ProblemWithSAXParser extends TestCase
    public static void main(String[] args)
    TestResult result=junit.textui.TestRunner.run(suite());
    System.exit(result.wasSuccessful() ? 0 : 1);
    private static junit.framework.Test suite()
    final TestSuite ts=new TestSuite();
    ts.addTestSuite(ProblemWithSAXParser.class);
    return (ts);
    /** small DocumentHandler, just waiting for one and only XML element <c></c> */
    class MySAXDocumentHandler extends DefaultHandler
    boolean listening=false;
    public void startElement(final String uri, final String localName, final String qName, final Attributes attributes)
    throws SAXException
    System.out.println("startElement uri " + uri + " localName " + localName + " qName " + qName);
    if("c".equals(qName))
    listening=true;
    public void endElement(final String uri, final String localName, final String qName) throws SAXException
    System.out.println("endElement uri " + uri + " localName " + localName + " qName " + qName);
    if("c".equals(qName))
    listening=false;
    public void characters(final char ch[], final int start, final int length) throws SAXException
    if(listening)
    final String str=new String(ch, start, length);
    System.out.println("<c> element, start==" + start + " length==" + length + " ch.length==" + ch.length + " ch=="
    + str);
    sb.append(str);
    private final StringBuffer sb=new StringBuffer();
    /** return what I got for XML element <c></c> */
    public String toString()
    return (sb.toString());
    /** test an XML document with an element <c>, use XML 1.0 and XML 1.1 and some (more)
    * content in the XML element */
    public void testWithSunAndApache() throws Exception
    // test XML element content for <c> element
    final StringBuffer plain_str=new StringBuffer("");
    for(int i=0; i < 500; i++)
    plain_str.append("0123456789 This is some text ").append(i).append(". ");
    final String xml_orig=plain_str.toString();
    // SAX parsers, one Sun, one (original) Apache Xerces
    // accept that Apache Xerces is not in path ...
    final String prop_name="javax.xml.parsers.SAXParserFactory";
    final String prop_val_sun="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl";
    final String prop_val_apache="org.apache.xerces.jaxp.SAXParserFactoryImpl";
    System.setProperty(prop_name, prop_val_sun);
    final SAXParser sax_sun=SAXParserFactory.newInstance().newSAXParser();
    System.out.println("SaxParser Sun= " + sax_sun);
    assertTrue(("" + sax_sun).indexOf("com.sun.") >= 0);
    System.setProperty(prop_name, prop_val_apache);
    SAXParser sax_apache;
    try
    sax_apache=SAXParserFactory.newInstance().newSAXParser();
    catch(final Throwable t)
    System.err.println("no Apache Xerces in path? " + t);
    sax_apache=null;
    System.out.println("SaxParser Apache= " + sax_apache);
    assertTrue(sax_apache==null || ("" + sax_apache).startsWith("org.apache."));
    // i==0: XML 1.0, i==1: XML 1.1
    for(int i=0; i <= 1; i++)
    assert i == 0 || i == 1;
    final String xml_version=(i == 0 ? "1.0" : "1.1");
    final StringBuffer sb=new StringBuffer("<?xml version=\"" + xml_version + "\" encoding=\"UTF-8\"?><c>");
    sb.append(xml_orig);
    sb.append("</c>");
    final String xml=sb.toString();
    // parse it!
    final StringReader string_reader_sun, string_reader_apache;
    string_reader_sun=new StringReader(xml);
    final InputSource input_source_sun=new InputSource(string_reader_sun);
    string_reader_apache=new StringReader(xml);
    final InputSource input_source_apache=new InputSource(string_reader_apache);
    final MySAXDocumentHandler my_handler_sun, my_handler_apache;
    my_handler_sun=new MySAXDocumentHandler();
    my_handler_apache=new MySAXDocumentHandler();
    sax_sun.parse(input_source_sun, my_handler_sun);
    if(sax_apache!=null)
    sax_apache.parse(input_source_apache, my_handler_apache);
    final String xml_sun=my_handler_sun.toString();
    final String xml_apache=my_handler_apache.toString();
    assertNotNull(xml_sun);
    assertNotNull(xml_apache);
    System.out.println("xml version " + xml_version);
    System.out.println("xml " + xml);
    System.out.println("xml_orig " + xml_orig);
    System.out.println("xml_sun " + xml_sun);
    System.out.println("xml_apache " + xml_apache);
    // test the data returned from DocumentHandler
    if(sax_apache!=null)
    assertEquals(xml_orig, xml_apache);
    assertEquals(xml_orig.length(), xml_sun.length()); // length seems to be okay
    assertEquals(xml_orig, xml_sun); // content seems to be not okay for XML 1.1
    }

    thanx, DrClap, haven't seen the "code" button for some reason, code is attached again
    The output of my test is like this for JRE6 (truncated)
    xml_sun 456789 This is is some text 0. 0123456789 This is some text 1.
    xml_apache 0123456789 This is some text 0. 0123456789 This is some text 1.
    Notice, xml_sun not only starts wrong ("0123" missing) - for some reason, the text there is not "This is some text" but "This is is some text" - very interesting in a way. I guess there's an issue with repeated text chunks ...
    So, the data in my XML element is kind of changed, the length of the string is okay but the characters are "misplaced" or so :-) I thought about a problem with StringBuffer first, but the StringBuffer works fine for Apache ... so I really think there's an issue with JRE 6's parser for XML 1.1
    Merten
    import java.io.StringReader;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.Attributes;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    import junit.framework.TestCase;
    import junit.framework.TestResult;
    import junit.framework.TestSuite;
    /** snippet to demonstrate problem in SAXParser */
    public class ProblemWithSAXParser extends TestCase
    public static void main(String[] args)
      TestResult result=junit.textui.TestRunner.run(suite());
      System.exit(result.wasSuccessful() ? 0 : 1);
    private static junit.framework.Test suite()
      final TestSuite ts=new TestSuite();
      ts.addTestSuite(ProblemWithSAXParser.class);
      return (ts);
    /** small DocumentHandler, just waiting for one and only XML element <c></c> */
    class MySAXDocumentHandler extends DefaultHandler
      boolean listening=false;
      public void startElement(final String uri, final String localName, final String qName, final Attributes attributes)
        throws SAXException
       System.out.println("startElement uri " + uri + " localName " + localName + " qName " + qName);
       if("c".equals(qName))
        listening=true;
      public void endElement(final String uri, final String localName, final String qName) throws SAXException
       System.out.println("endElement uri " + uri + " localName " + localName + " qName " + qName);
       if("c".equals(qName))
        listening=false;
      public void characters(final char ch[], final int start, final int length) throws SAXException
       if(listening)
        final String str=new String(ch, start, length);
        System.out.println("<c> element, start==" + start + " length==" + length + " ch.length==" + ch.length + " ch=="
          + str);
        sb.append(str);
      private final StringBuffer sb=new StringBuffer();
      /** return what I got for XML element <c></c> */
      public String toString()
       return (sb.toString());
    /** test an XML document with an element <c>, use XML 1.0 and XML 1.1 and some (more)
      * content in the XML element */
    public void testWithSunAndApache() throws Exception
      // test XML element content for <c> element
      final StringBuffer plain_str=new StringBuffer("");
      for(int i=0; i < 500; i++)
       plain_str.append("0123456789 This is some text ").append(i).append(". ");
      final String xml_orig=plain_str.toString();
      // SAX parsers, one Sun, one (original) Apache Xerces
      // accept that Apache Xerces is not in path ...
      final String prop_name="javax.xml.parsers.SAXParserFactory";
      final String prop_val_sun="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl";
      final String prop_val_apache="org.apache.xerces.jaxp.SAXParserFactoryImpl";
      System.setProperty(prop_name, prop_val_sun);
      final SAXParser sax_sun=SAXParserFactory.newInstance().newSAXParser();
      System.out.println("SaxParser Sun= " + sax_sun);
      assertTrue(("" + sax_sun).indexOf("com.sun.") >= 0);
      System.setProperty(prop_name, prop_val_apache);
      SAXParser sax_apache;
      try
       sax_apache=SAXParserFactory.newInstance().newSAXParser();
      catch(final Throwable t)
       System.err.println("no Apache Xerces in path? " + t);
       sax_apache=null;
      System.out.println("SaxParser Apache= " + sax_apache);
      assertTrue(sax_apache==null || ("" + sax_apache).startsWith("org.apache."));
      // i==0: XML 1.0, i==1: XML 1.1
      for(int i=0; i <= 1; i++)
       assert i == 0 || i == 1;
       final String xml_version=(i == 0 ? "1.0" : "1.1");
       final StringBuffer sb=new StringBuffer("<?xml version=\"" + xml_version + "\" encoding=\"UTF-8\"?><c>");
       sb.append(xml_orig);
       sb.append("</c>");
       final String xml=sb.toString();
       // parse it!
       final StringReader string_reader_sun, string_reader_apache;
       string_reader_sun=new StringReader(xml);
       final InputSource input_source_sun=new InputSource(string_reader_sun);
       string_reader_apache=new StringReader(xml);
       final InputSource input_source_apache=new InputSource(string_reader_apache);
       final MySAXDocumentHandler my_handler_sun, my_handler_apache;
       my_handler_sun=new MySAXDocumentHandler();
       my_handler_apache=new MySAXDocumentHandler();
       sax_sun.parse(input_source_sun, my_handler_sun);
       if(sax_apache!=null)
        sax_apache.parse(input_source_apache, my_handler_apache);
       final String xml_sun=my_handler_sun.toString();
       final String xml_apache=my_handler_apache.toString();
       assertNotNull(xml_sun);
       assertNotNull(xml_apache);
       System.out.println("xml version " + xml_version);
       System.out.println("xml        " + xml);
       System.out.println("xml_orig   " + xml_orig);
       System.out.println("xml_sun    " + xml_sun);
       System.out.println("xml_apache " + xml_apache);
       // test the data returned from DocumentHandler
       if(sax_apache!=null)
        assertEquals(xml_orig, xml_apache);
       assertEquals(xml_orig.length(), xml_sun.length()); // length seems to be okay
       assertEquals(xml_orig, xml_sun); // content seems to be not okay for XML 1.1
    }

Maybe you are looking for

  • TKPROF report, performance issue

    Part of the tkprof listed: UPDATE JS_CM_TP tp SET (tp.crs_emlkey, tp.tp_crs_conn_aid, tp.tp_crs_conn_type) = ( SELECT crs_emlkey, crs.crs_to_tp_aid, crs.crs_xctype FROM JS_CM_CRS crs WHERE (crs.ne_id = tp.ne_id) AND ( tp.tp_id = crs.crs_from_tp_id) A

  • Need suggestion on career in solman

    Hi, Intially, I was an ABAPer with exposure to Business Workflow. Then, i moved to ChaRM in solman. I have 3 yrs of experience in Change Managment in Solution Manager. I am having doubt over market demand of ChaRM experts. Please let me know if it wi

  • Merging seperate date and time fields into a unique text field.

    I have a dropdown Calendar Date field and a dropdown Time Field in a form and I want to create an additional Text Field that displays the combination of these two fields as a unique form field that would look like this... Arrival Date: 1/27/2009 Arri

  • Playlists on EA4500 Media Server

    Does anybody know how to get playists to work on the EA4500 Media Server? I have the Music folder share working with a Roku Soundbridge, so now would like to copy my iTunes playlists to this folder as well. I've tried creating a .m3u file in the Musi

  • Change Headings in Excell sheet in BSP Layout

    Hi, How to Change Headings in Excell sheet in BSP Layout? Thanks Srinivas