Un-nest XML with single child element

I'm trying to write a generic function for un-nesting child nodes where nesting is deemed unnecessary. Typically when the element only has one child element.
For example, given the following source....
<ROOT>
  <ITEM>
    <DESCRIPTION>TEST1</DESCRIPTION>
  </ITEM>
  <ITEM>
    <DESCRIPTION>TEST2</DESCRIPTION>
  </ITEM>
</ROOT>I actually want.....
<ROOT>
  <DESCRIPTION>TEST1</DESCRIPTION>
  <DESCRIPTION>TEST2</DESCRIPTION>
</ROOT>because we think ITEM isn't really required before we deliver XML data.
I've been trying to achieve this with a function, where I pass in the XPath to the node I want flattening, something like
function UnNest(pXMLData XMLType, pXPath varchar2) return XMLType...Called like the following...
declare
begin
  vXMLData := UnNest(SomeXMLData, '/ROOT/ITEM')
end;I tried using XQuery Update (11gR2), as follows,
select /*+ no_xml_query_rewrite */
  xmlquery('
    copy $d := .
     modify (
        for $i in $d/ROOT/ITEM
        return
          replace node $i with $i/child::node()  
     return $d'
  passing xmltype(
'<ROOT>
  <ITEM>
    <DESCRIPTION>TEST1</DESCRIPTION>
  </ITEM>
  <ITEM>
    <DESCRIPTION>TEST2</DESCRIPTION>
  </ITEM>
</ROOT>'
  returning content) XML
from dual.... which works, but when I try to pass in a path variable, it doesn't.
select /*+ no_xml_query_rewrite */
  xmlquery('
    copy $d := .
     modify (
        for $i in $d/$Unnestpath
        return
          replace node $i with $i/child::node()  
     return $d'
  passing xmltype(
'<ROOT>
  <ITEM>
    <DESCRIPTION>TEST1</DESCRIPTION>
  </ITEM>
  <ITEM>
    <DESCRIPTION>TEST2</DESCRIPTION>
  </ITEM>
</ROOT>'
  'ROWSET/ROW' as "Unnestpath"
  returning content) XML
from dual
ORA-19112: error raised during evaluation:
XVM-01020: [XPTY0020] The path step context item is not a node
6             replace node $i with $i/child::node()  
-                                   ^Am I missing something obvious?
My destination platform is 11gR2 64 bit but going forward I may need a solution for 10gR2 too. Perhaps there is another way without using XQuery Update? Any advice would be greatly appreciated.

paul zip wrote:
when I try to pass in a path variable, it doesn't.Yes, paths are not variables, they have to be static. However, you can make the whole query dynamic.
Another option is XSLT, which will work on both releases, or a combination of extract/updatexml calls.
SQL> create or replace function UnNest(pXMLData XMLType, pXPath varchar2)
  2  return XMLType
  3  is
  4    result          XMLType;
  5    xsl_template    varchar2(2000) :=
  6    '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  7    <xsl:template match="@*|node()">
  8      <xsl:copy>
  9        <xsl:apply-templates select="@*|node()"/>
10      </xsl:copy>
11    </xsl:template>
12    <xsl:template match="#TARGET_XPATH#">
13      <xsl:apply-templates select="node()"/>
14    </xsl:template>
15  </xsl:stylesheet>';
16 
17  begin
18 
19    select xmltransform(
20             pXMLData
21           , xmlparse(document replace(xsl_template, '#TARGET_XPATH#', pXPath))
22           )
23    into result
24    from dual ;
25 
26    return result;
27 
28  end;
29  /
Function created
SQL> set long 5000
SQL>
SQL> select unnest(
  2  xmltype(
  3  '<ROOT>
  4    <ITEM>
  5      <DESCRIPTION>TEST1</DESCRIPTION>
  6    </ITEM>
  7    <ITEM>
  8      <DESCRIPTION>TEST2</DESCRIPTION>
  9    </ITEM>
10  </ROOT>'),
11  '/ROOT/ITEM'
12  )
13  from dual;
UNNEST(XMLTYPE('<ROOT><ITEM><D
<ROOT>
<DESCRIPTION>TEST1</DESCRIPTION>
<DESCRIPTION>TEST2</DESCRIPTION>
</ROOT>
Typically when the element only has one child element.If it's a general rule to apply, XSLT can do it very easily on every node that satisfies this condition.
Edited by: odie_63 on 21 mai 2013 12:38

Similar Messages

  • Nested XML with XSU

    I have data in an Oracle8i-database and will use Java to export
    it to XML. I&#8217;m trying to use XML Developer&#8217;s Kit&#8217;s (XDK&#8217;s) XML
    SQL Utility&#8217;s (XSU&#8217;s) OracleXMLQuery class. But I&#8217;ve problems to
    get the nested XML-structure I need!
    Oracle says there&#8217;s two good ways to do this:
    &#8220;Source Customization
    This category incompases customizations done by altering the
    query or the database schema. Among the simplest and the most
    powerful source customizations are:
    * over the database schema, create an object-relational view
    which maps to the desired XML document structure.
    * in your query, use cursor subqueries, or cast-multiset
    constructs to get nesting in the XML document which comes from a
    flat schema.&#8221;
    They then have an example how to create an object-relational
    view. But this is done with an empty database, and I already
    have tables with data so I don&#8217;t know how to do this.
    I&#8217;ve tried with some simple subqueris like
    SELECT name, id,
    (SELECT COUNT(*) FROM order o WHERE c.id = o.id) AS
    NumOfOrders
    FROM cust c
    But it adds just another colum.
    Could somebody help me or direct me to some resource, please?
    Thanks!

    I have data in an Oracle8i-database and will use Java to export
    it to XML. I&#8217;m trying to use XML Developer&#8217;s Kit&#8217;s (XDK&#8217;s) XML
    SQL Utility&#8217;s (XSU&#8217;s) OracleXMLQuery class. But I&#8217;ve problems to
    get the nested XML-structure I need!
    Oracle says there&#8217;s two good ways to do this:
    &#8220;Source Customization
    This category incompases customizations done by altering the
    query or the database schema. Among the simplest and the most
    powerful source customizations are:
    * over the database schema, create an object-relational view
    which maps to the desired XML document structure.
    * in your query, use cursor subqueries, or cast-multiset
    constructs to get nesting in the XML document which comes from a
    flat schema.&#8221;
    They then have an example how to create an object-relational
    view. But this is done with an empty database, and I already
    have tables with data so I don&#8217;t know how to do this.
    I&#8217;ve tried with some simple subqueris like
    SELECT name, id,
    (SELECT COUNT(*) FROM order o WHERE c.id = o.id) AS
    NumOfOrders
    FROM cust c
    But it adds just another colum.
    Could somebody help me or direct me to some resource, please?
    Thanks!

  • Generating nested XML with XSU

    Hi,
    I have been trying to generate a nested XML document with the
    XSU Utility (Rdbms 9.0.1) by setting up an nested table (see below)
    and the using the command line utiliy as:
    c:\>java OracleXML getXML -user "scott/tiger" "SELECT * from dept_type_tab
    The result is nested all right, but all texts seem to be in Hex representation:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <DEPT>
    <DNAME>0x5245534541524348</DNAME>
    <EMP>
    <ENAME>0x534D495448</ENAME>
    </EMP>
    </DEPT>
    </ROW>
    Can anyone point out to me, where I went wrong? ;-(
    Thanx for any input
    Jan-Peter
    create type emp_type as object
    ename varchar2(10)
    create type dept_type as object
    dname varchar2(14),
    emp emp_type
    create view tmp_jpm2 as
    select dept_type(dept.dname,
    emp_type(emp.ename)
    ) dept
    from dept, emp WHERE (dept.deptno = emp.deptno);
    create table dept_type_tab ( dept dept_type);
    insert into dept_type_tab (dept) select dept from tmp_jpm2;

    Hi,
    I have been trying to generate a nested XML document with the
    XSU Utility (Rdbms 9.0.1) by setting up an nested table (see below)
    and the using the command line utiliy as:
    c:\>java OracleXML getXML -user "scott/tiger" "SELECT * from dept_type_tab
    The result is nested all right, but all texts seem to be in Hex representation:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <DEPT>
    <DNAME>0x5245534541524348</DNAME>
    <EMP>
    <ENAME>0x534D495448</ENAME>
    </EMP>
    </DEPT>
    </ROW>
    Can anyone point out to me, where I went wrong? ;-(
    Thanx for any input
    Jan-Peter
    create type emp_type as object
    ename varchar2(10)
    create type dept_type as object
    dname varchar2(14),
    emp emp_type
    create view tmp_jpm2 as
    select dept_type(dept.dname,
    emp_type(emp.ename)
    ) dept
    from dept, emp WHERE (dept.deptno = emp.deptno);
    create table dept_type_tab ( dept dept_type);
    insert into dept_type_tab (dept) select dept from tmp_jpm2;

  • Producing nested xml with querying attributes from a nested table

    How can one produce nested xml querying columns from a nested table? Looking at the object documentation, I can readily unnest the tables. Using your examples in the book, unnesting is select po.pono, ..., l.* from purchaseorder_objtab po, table (po.lineitemlist_ntab) l where l.quantity = 2;
    what if I don't want to unnest and don't want a cursor. I would like to produce nested xml.

    Gail,
    Although you can use XSU (XML-SQL Util) in 8.1.7, I would recommend that you upgrade to 9i for much better support (both in functionality and performance) of XML in the database. For example, in Oracle9i there are:
    - a new datatype - XMLType for storing and retrieving XML documents
    - DBMS_XMLGEN package and SYS_XMLGEN, SYS_XMLAGG functions for generating XML document from complex SQL queries
    - A pipelined table function to break down large XML documents into rows.
    You can check out some examples using SYS_XMLGEN and DBMS_XMLGEN for your specific needs at http://download-west.oracle.com/otndoc/oracle9i/901_doc/appdev.901/a88894/adx05xml.htm#1017141
    Regards,
    Geoff

  • How to load xml with large base64 element using sqlldr

    Hi,
    I am trying to load xml data onto Oracle 10gR2. I want to use standard sqlldr tool if possible.
    1) I have registered my schema with succes:
    - Put the 6kbytes schema into a table
    - and
    DECLARE
    schema_txt CLOB;
    BEGIN
    SELECT text INTO schema_txt FROM schemas;
    DBMS_XMLSCHEMA.registerschema ('uddkort.xsd', schema_txt);
    END;
    - Succes: I can create table like:
    CREATE TABLE XmlTest OF XMLTYPE
    XMLSCHEMA "uddkort.xsd"
    ELEMENT "profil"
    - USER_XML_TABLES shows:
    TABLE_NAME,XMLSCHEMA,SCHEMA_OWNER,ELEMENT_NAME,STORAGE_TYPE
    "XMLTEST","uddkort.xsd","THISE","profil","OBJECT-RELATIONAL"
    2) How can I load XML data into this?
    - One element of the schema is <xs:element name="billede" type="xs:base64Binary" minOccurs="0"/>
    - This field in data can be 10kbytes or more
    I have tried many control files - searching the net, but no luck so far.
    Any suggestions?
    /Claus, DK

    - One element of the schema is <xs:element name="billede" type="xs:base64Binary" minOccurs="0"/>
    - This field in data can be 10kbytes or moreThe default mapping in Oracle for this type is RAW(2000), so not sufficient to hold 10kB+ of data.
    You'll have to annotate the schema in order to specify a mapping to BLOB datatype.
    Something along those lines :
    <?xml version="1.0"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb">
    <xs:element name="image" xdb:defaultTable="IMAGES_TABLE">
      <xs:complexType>
        <xs:sequence>
          <xs:element name="name" type="xs:string"/>
          <xs:element name="content" type="xs:base64Binary" xdb:SQLType="BLOB"/>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    </xs:schema>http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb05sto.htm#sthref831
    Then :
    SQL> begin
      2   dbms_xmlschema.registerSchema(
      3   schemaURL => 'image.xsd',
      4   schemaDoc => '<?xml version="1.0"?>
      5  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb">
      6  <xs:element name="image" xdb:defaultTable="IMAGES_TABLE">
      7    <xs:complexType>
      8      <xs:sequence>
      9        <xs:element name="name" type="xs:string"/>
    10        <xs:element name="content" type="xs:base64Binary" xdb:SQLType="BLOB"/>
    11      </xs:sequence>
    12    </xs:complexType>
    13  </xs:element>
    14  </xs:schema>',
    15   local => true,
    16   genTypes => true,
    17   genTables => true,
    18   enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_NONE
    19   );
    20  end;
    21  /
    PL/SQL procedure successfully completed
    SQL> insert into images_table
      2  values(
      3    xmltype(bfilename('TEST_DIR', 'sample-b64.xml'), nls_charset_id('AL32UTF8'))
      4  );
    1 row inserted
    where "sample-b64.xml" looks like :
    <?xml version="1.0" encoding="UTF-8"?>
    <image>
    <name>Collines.jpg</name>
    <content>/9j/4AAQSkZJRgABAgEBLAEsAAD/7QlMUGhvdG9zaG9wIDMuMAA4QklNA+0KUmVzb2x1dGlvbgAA
    AAAQASwAAAABAAEBLAAAAAEAAThCSU0EDRhGWCBHbG9iYWwgTGlnaHRpbmcgQW5nbGUAAAAABAAA
    AHg4QklNBBkSRlggR2xvYmFsIEFsdGl0dWRlAAAAAAQAAAAeOEJJTQPzC1ByaW50IEZsYWdzAAAA
    O9r8FHXdH4LDSSUHoImAmcIcQPwWAkkh3ogKI404WGkkkO8Po/EpmmCYWEkkru7z/FJg9sRqsFJJ
    XR3iPZMJN1HmsFJJXT6u+3UQdJUJj7lhpJKHV32dh96i3Qx8lhJJK7u9w4jw7p+SCsBJJDukQ7Tu
    VM6Ln0klHo7rjEeak0rASST0f//Z</content>
    </image>BTW, open question to everyone...
    XMLTable or XMLQuery don't seem to work to extract the data as BLOB :
    SQL> select x.image
      2  from images_table t
      3     , xmltable('/image' passing t.object_value
      4         columns image blob path 'content'
      5       ) x
      6  ;
    ERROR:
    ORA-01486: size of array element is too large
    no rows selectedhowever this is OK :
    SQL> select extractvalue(t.object_value, '/image/content') from images_table t;
    EXTRACTVALUE(T.OBJECT_VALUE,'/IMAGE/CONTENT')
    FFD8FFE000104A46494600010201012C012C0000FFED094C50686F746F73686F7020332E30003842
    494D03ED0A5265736F6C7574696F6E0000000010012C000000010001012C0000000100013842494DIs there a known restriction when dealing with LOB types?
    Edited by: odie_63 on 17 nov. 2011 19:27

  • Parsing XML with binary (Base64) elements

    Can someone give me an example or point me towards some resources that discuss parsing, and rendering binary elements (.gif images, specifically) from XML to HTML? Is this a standard function of most parsers?
    THANKS
    ben

    XML is a text format so of course it can't include binary data such as GIFs. But then so is HTML, so there doesn't seem to be much point in doing this. Your HTML would have to include a link to the GIF, rather than the GIF itself in any format, binary or otherwise. And therefore so should the XML. Given all that, it follows that parsers don't deal with whatever it is you are attempting.

  • Help on creating and deleting xml child elements using Toplink please.

    Hi there,
    I am trying to build a toplink xml demo illustrating toplink acting as the layer between my java code and an xml datasource.
    After pulling my custom schema into toplink and following the steps in http://www.oracle.com/technology/products/ias/toplink/preview/10.1.3dp3/howto/jaxb/index.htm related to
    Click on Mapping Workbench Project...Click on From XML Schema (JAXB)...
    I am able to set up java code which can run get and sets against my xml datasource. However, I want to also be able create and delete elements within the xml data for child elements.
    i.e. in a simple scenario I have a xsd for departments which has an unbounded element of type employee. How does toplink allow me to add and or remove employees in a department on the marshalled xml data source? Only gets and sets for the elements seem accessible.
    In my experience with database schema based toplink demos I have seen methods such as:
    public void setEmployeesCollection(Collection EmployeesCollection) {
         this.employeesCollection = employeesCollection;
    Is this functionality available for xml backended toplink projects?
    cheers
    Nick

    Hi Nick,
    Below I'll give an example of using the generated JAXB object model to remove and add a new node. The available APIs are defined in the JAXB spec. TopLink also supports mapping your own objects to XML, your own objects could contain more convenient APIs for adding or removing collection members
    Example Schema
    The following XML Schema will be used to generate a JAXB model.
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:element name="department">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="employee" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="employee">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>---
    Example Input
    The following document will be used as input. For the purpose of this example this XML document is saved in a file called "employee-data.xml".
    <department>
         <employee>
              <name>Anne</name>
         </employee>
         <employee>
              <name>Bob</name>
         </employee>
    </department>---
    Example Code
    The following code demonstrates how to use the JAXB APIs to remove the object representing the first employee node, and to add a new Employee (with name = "Carol").
    JAXBContext jaxbContext = JAXBContext.newInstance("your_context_path");
    Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
    File file = new File("employee-data.xml");
    Department department = (Department) unmarshaller.unmarshal(file);
    // Remove the first employee in the list
    department.getEmployee().remove(0);
    // Add a new employee
    ObjectFactory objectFactory = new ObjectFactory();
    Employee newEmployee = objectFactory.createEmployee();
    newEmployee.setName("Carol");
    department.getEmployee().add(newEmployee);
    Marshaller marshaller = jaxbContext.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
    marshaller.marshal(department, System.out);---
    Example Output
    The following is the result of running the example code.
    <department>
         <employee>
              <name>Bob</name>
         </employee>
         <employee>
              <name>Carol</name>
         </employee>
    </department>

  • How to query from the xml table a single, specified element.

    I'm quite new in Xml Db. Pleas, can anybody tell me how to query from the xml table below a single element (i.e. the element 'rapportoparentela = NIPOTE' related to the element 'codicefiscale = CRRVNC76R52G337R', or the element 'rapportoparentela = FIGLIO' related to the element 'codicefiscale = CRRRNT51L23G337Q')?
    - <dati xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <codiceinterno />
    <codicefiscaleassistito>CRRMNL81R31G337H</codicefiscaleassistito>
    - <famigliare>
    <codicefiscale>CRRVNC76R52G337R</codicefiscale>
    <rapportoparentela>NIPOTE</rapportoparentela>
    </famigliare>
    - <famigliare>
    <codicefiscale>CRRRNT51L23G337Q</codicefiscale>
    <rapportoparentela>FIGLIO</rapportoparentela>
    </famigliare>
    - <famigliare>
    <codicefiscale>CBRPRN15S65E080W</codicefiscale>
    <rapportoparentela>I.S.</rapportoparentela>
    </famigliare>
    - <famigliare>
    <codicefiscale>CRRMNL81R31G337H</codicefiscale>
    <rapportoparentela>NIPOTE</rapportoparentela>
    </famigliare>
    - <famigliare>
    <codicefiscale>BCCCML54C50I845G</codicefiscale>
    <rapportoparentela>NUORA</rapportoparentela>
    </famigliare>
    </dati>
    Using SELECT extractValue(value(t),'/rapportoparentela') into result FROM NF_XMLT X,
    TABLE ( xmlsequence (extract(value(X),'/dati/famigliare/rapportoparentela'))) t
    I get all the elements 'rapportoparentela' and I want to get only one specified.
    Regards.
    Piero

    Piero,
    you can add the condition "CRRVNC76R52G337R" to your xpath-expression like:
    SELECT extractValue(value(t),'/rapportoparentela')
    FROM NF_XMLT x
    ,TABLE ( xmlsequence (extract(value(X),'/dati/famigliare[rapportoparentela="CRRVNC76R52G337R"]'))) tto select only those famigliare-elements that have a child-element rapportoparentela with value "CRRVNC76R52G337R".
    When you stored your XML in an XMLType column in the table, i think the following queries are better:
    SELECT extractValue(x.your_XMLType_column,'/dati/famigliare/rapportoparentela')
    FROM NF_XMLT x
    WHERE extractValue(x.your_XMLType_column,'/dati/famigliare/codicefiscale')
    = 'CRRVNC76R52G337R'or
    SELECT extractValue(x.your_XMLType_column,'/dati/famigliare/rapportoparentela')
    FROM NF_XMLT x
    WHERE existsNode(x.your_XMLType_column,'/dati/famigliare[codicefiscale="CRRVNC76R52G337R"]')
    != 0

  • How to read the child elements in single query

    Hi
    How to read the child elements under 'alternateIdentifiers' and 'matchEntityBasic' in a single query followiing xml content.xml content is of xmltype
    I/p doc
    <UPDATES>
    <matchEntity>
    <sourceUpdateId>SAMSUNG</sourceUpdateId>
    <matchEntityId>861873</matchEntityId>
    <alternateIdentifiers>
    <sourceUpdateId>SAMSUNG</sourceUpdateId>
    <schemeCode>SMG</schemeCode>
    <effectiveDate>2012-01-16</effectiveDate>
    </alternateIdentifiers>
    <alternateIdentifiers>
    <sourceUpdateId>SAMSUNG</sourceUpdateId>
    <schemeCode>TEBBGL</schemeCode>
    <effectiveDate>2012-01-16</effectiveDate>
    </alternateIdentifiers>
    <matchEntityBasic>
    <sourceUpdateId>SAMSUNG</sourceUpdateId>
    <marketExchangeCode>XASE</marketExchangeCode>
    </matchEntityBasic>
    </matchEntity>
    </UPDATES>
    o/p
    sourceUpdateId schemeCode effectiveDate marketExchangeCode
    SAMSUNG SMG 2012-01-16 XASE
    SAMSUNG TEBBGL 2012-01-16
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    i tried the query but not working
    SELECT sourceUpdateId ,schemeCode ,effectiveDate ,marketExchangeCode FROM message pl,XMLTABLE ('/UPDATES/matchEntity/alternateIdentifiers'
                   PASSING pl.messagetext
                   COLUMNS sourceUpdateId VARCHAR2 (20) PATH sourceUpdateId,
                   schemeCode VARCHAR2 (20) PATH 'schemeCode',
              effectiveDate DATE PATH 'effectiveDate',
    marketExchangeCode VARCHAR2 (20) PATH './matchEntityBasic/marketExchangeCode'
    ) x
    iam not retriving marketExchangeCode with the following query
    marketExchangeCode VARCHAR2 (20) PATH './matchEntityBasic/marketExchangeCode'
    thanks

    The problem is that "matchEntityBasic" is not a child of "alternateIdentifiers", so this :
    ./matchEntityBasic/marketExchangeCodepoints to nothing.
    To display both values in the same query, you'll need a two-level approach.
    For example :
    SQL> SELECT x2.sourceUpdateId
      2       , x2.schemeCode
      3       , x2.effectiveDate
      4       , x1.marketExchangeCode
      5  FROM message pl
      6     , XMLTable(
      7         '/UPDATES/matchEntity'
      8         passing pl.messagetext
      9         columns marketExchangeCode   VARCHAR2(20) PATH 'matchEntityBasic/marketExchangeCode'
    10               , alternateIds         XMLType      PATH 'alternateIdentifiers'
    11       ) x1
    12     , XMLTable(
    13         '/alternateIdentifiers'
    14         passing x1.alternateIds
    15         columns sourceUpdateId     VARCHAR2(20) PATH 'sourceUpdateId'
    16               , schemeCode         VARCHAR2(20) PATH 'schemeCode'
    17               , effectiveDate      DATE         PATH 'effectiveDate'
    18       ) x2
    19  ;
    SOURCEUPDATEID       SCHEMECODE           EFFECTIVEDATE MARKETEXCHANGECODE
    SAMSUNG              SMG                  16/01/2012    XASE
    SAMSUNG              TEBBGL               16/01/2012    XASE
    Or the shorter version :
    SQL> SELECT x.sourceUpdateId
      2       , x.schemeCode
      3       , x.effectiveDate
      4       , x.marketExchangeCode
      5  FROM message pl
      6     , XMLTable(
      7         'for $i in /UPDATES/matchEntity
      8          return
      9            for $j in $i/alternateIdentifiers
    10            return element r { $j/child::*, $i/matchEntityBasic/marketExchangeCode }'
    11         passing pl.messagetext
    12         columns sourceUpdateId     VARCHAR2(20) PATH 'sourceUpdateId'
    13               , schemeCode         VARCHAR2(20) PATH 'schemeCode'
    14               , effectiveDate      DATE         PATH 'effectiveDate'
    15               , marketExchangeCode VARCHAR2(20) PATH 'marketExchangeCode'
    16       ) x
    17  ;
    SOURCEUPDATEID       SCHEMECODE           EFFECTIVEDATE MARKETEXCHANGECODE
    SAMSUNG              SMG                  16/01/2012    XASE
    SAMSUNG              TEBBGL               16/01/2012    XASE

  • How get all child elements from XML

    Hi
    I have one xml i tried to parse that xml using dom parser and i need to get some child elements using java
    <Group>
    <NAME>ABC</NAME>
    <Age>24</AgeC>
    ---------some data here......
    <Group1>
    <group1Category>
    <NAME>ABCTest</NAME>
    <age>27</Age>
    ----Some data here
    <group1subcategory>
    <subcategory>
    <NAME>ABCDEF</NAME>
    <age>28</Age>
    my intention was
    get group name (here ABC) i need all other name value from group1category ,group1 subcategory but pblm that
    my xml contains any number of Group nodes...but only i want name contains ABC
    i wriiten code like this
    DocumentBuilderFactory factory = DocumentBuilderFactory
    .newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(xmlFile);
    NodeList nodeList = document.getElementsByTagName("*");
    for (int i = 0; i < nodeList.getLength(); i++)
    Element element = (Element) nodeList.item(i);
    what is next step i need to do..please help

    964749 wrote:
    Sorry for inconvenience caused..i only asked if any ideas i not ask any body to spent time for me...
    This is simple code developed using xpath..i not know how i proceed further
    public class Demo {
    public static void main(String[] args) {
    DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
    try {
    DocumentBuilder builder = domFactory.newDocumentBuilder();
    Document dDoc = builder.parse("hello.xml");
    XPath xpath = XPathFactory.newInstance().newXPath();
    javax.xml.xpath.XPathExpression expr = xpath.compile("//Group/NAME");
    Object Name= expr.evaluate(dDoc, XPathConstants.STRING);
    System.out.println(Name);
    } catch (Exception e) {
    e.printStackTrace();
    i need get group name (here ABC) i need all other name value from group1category ,group1 subcategory but pblm that
    ..how i done in XPATH and also do manipulation of remining result...
    i also try with DOM like
    NodeList nodeList = document.getElementsByTagName("GROUP");
    for (int i = 0; i < nodeList.getLength(); i++)
    Element element = (Element) nodeList.item(i);
    if (element.getNodeName().matches("ECUC-MODULE-DEF"))
    String str=((Element) nodeList.item(i)).getElementsByTagName("NAME").item(0).getFirstChild().getNodeValue();
    if(str.equalsIgnoreCase("abc")){
    NodeList children = element.getChildNodes();
    for (int k = 0; k < children.getLength(); k++) {
    Node child = children.item(k);
    System.out.println("children"+children.getLength());
    if (child.getNodeType() != Node.TEXT_NODE) {
    if(child.getNodeName().equalsIgnoreCase("Group1"))
    how iterate for particular ABC name to group1 and subcategoryFew things
    1. Use code tags to format code
    2. Explain the problem statement clearly. Take time to formulate your question. Explain what you expect from your code and what you are getting along with any exceptions that are being thrown

  • Org.xml.sax.SAXException:SimpleDeserializer encountered a child element..

    Hi All,
    I created a following program using "GetReportDefintion" method provided by BI Publisher Web Services
    package bip_webservices;
    import com.oracle.xmlns.oxp.service.PublicReportService.ItemData;
    import com.oracle.xmlns.oxp.service.PublicReportService.ReportRequest;
    import com.oracle.xmlns.oxp.service.PublicReportService.ReportResponse;
    import com.oracle.xmlns.oxp.service.PublicReportService.ParamNameValue;
    import com.oracle.xmlns.oxp.service.PublicReportService.ReportDefinition;
    import com.oracle.xmlns.oxp.service.PublicReportService.ScheduleRequest;
    import com.oracle.xmlns.oxp.service.PublicReportService.DeliveryRequest;
    import com.oracle.xmlns.oxp.service.PublicReportService.EMailDeliveryOption;
    import  java.io.FileOutputStream;
    import  java.io.OutputStream;
    import java.net.MalformedURLException;
    import java.rmi.RemoteException;
    import  java.util.Calendar;
    import javax.xml.rpc.ServiceException;
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import org.apache.axis.encoding.XMLType;
    import org.apache.axis.encoding.ser.BeanDeserializerFactory;
    import org.apache.axis.encoding.ser.BeanSerializerFactory;
    import  javax.xml.namespace.QName;
    import  javax.xml.rpc.ParameterMode;
    import  java.net.URL;
    public class BIP_GetReportDefinition {
        public static void main(String[] args) throws ServiceException, MalformedURLException, RemoteException{
         try{
            final String bipEndpoint = "http://localhost:9704/xmlpserver/services/PublicReportService?wsdl";
            final String bipNamespace = "http://xmlns.oracle.com/oxp/service/PublicReportService";
            final String xdofile = "/MyReports/SummaryCustomerReport/SummaryCustomerReport.xdo";
            Service service = new Service();
            Call call = (Call) service.createCall();
            call.setTargetEndpointAddress(new URL(bipEndpoint));
           System.out.println("BEGIN TESTING getReportDefinition");
            // register the ReportDefinition class
            QName reportDef = new QName(bipNamespace, "ReportDefinition");
            call.registerTypeMapping(ReportDefinition.class, reportDef,
                            BeanSerializerFactory.class, BeanDeserializerFactory.class);
            // register the ParamNameValue class
            QName nmvals = new QName(bipNamespace, "ParamNameValue");
            call.registerTypeMapping(ParamNameValue.class, nmvals, BeanSerializerFactory.class, BeanDeserializerFactory.class);
            call.setOperationName(new QName(bipNamespace, "getReportDefinition"));
            call.addParameter("reportAbsolutePath", XMLType.XSD_STRING, ParameterMode.IN);
            call.addParameter("userID", XMLType.XSD_STRING, ParameterMode.IN);
            call.addParameter("password", XMLType.XSD_STRING, ParameterMode.IN);
            call.setReturnClass(ReportDefinition.class);
            // issue the request
            ReportDefinition reportDefn = (ReportDefinition) call.invoke(
                new Object[] { xdofile, "Administrator", "Administrator"});
            System.out.println("Report Definition Returns with \n Default Output Format = " + reportDefn.getDefaultOutputFormat());
            ParamNameValue params [] = reportDefn.getReportParameterNameValues();
            if (params != null) {
                for (int i = 0; i < params.length; i++) {
                    System.out.print("Parameter " + params.getName() + ":");
    if (params[i].getValues() != null) {
    for (int j = 0; j < params[i].getValues().length; j++)
    System.out.print(" " + params[i].getValues()[j]);
    } else
    System.out.print(" null");
    System.out.println(" - multiple values? " + params[i].isMultiValuesAllowed());
    System.out.println("END TESTING getReportDefinition");
    }catch(Exception e){
    e.printStackTrace();
    I am getting following exception message. Anyone has any ideas what could be the mistake ?
    SEVERE: Exception:
    org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
            at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
            at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
            at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
            at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
            at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
            at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
            at org.apache.axis.client.Call.invoke(Call.java:2467)
            at org.apache.axis.client.Call.invoke(Call.java:2366)
            at org.apache.axis.client.Call.invoke(Call.java:1812)
            at bip_webservices.BIP_GetReportDefinition.main(BIP_GetReportDefinition.java:67)
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
    faultActor:
    faultNode:
    faultDetail:
            {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
            at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
            at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
            at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
            at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
            at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
            at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
            at org.apache.axis.client.Call.invoke(Call.java:2467)
            at org.apache.axis.client.Call.invoke(Call.java:2366)
            at org.apache.axis.client.Call.invoke(Call.java:1812)
            at bip_webservices.BIP_GetReportDefinition.main(BIP_GetReportDefinition.java:67)
            {http://xml.apache.org/axis/}hostname:mildh0228
    org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
            at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
            at org.apache.axis.client.Call.invoke(Call.java:2470)
            at org.apache.axis.client.Call.invoke(Call.java:2366)
            at org.apache.axis.client.Call.invoke(Call.java:1812)
            at bip_webservices.BIP_GetReportDefinition.main(BIP_GetReportDefinition.java:67)
    Caused by: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
            at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
            at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
            at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
            at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
            at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
            at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
            at org.apache.axis.client.Call.invoke(Call.java:2467)
            ... 3 moreThanks for giving this problem a look.
    -Sookie

    Hi Sookie,
    I found the problem is with couple of child parameters are not registered the deserializer. There're couple of additional classes needs to be registerd.
    // register the TemplateLabelValue class
    QName templateval = new QName(bipNamespace, "TemplateFormatLabelValue");
    Class cls = TemplateFormatLabelValue.class;
    call.registerTypeMapping(cls, templateval, BeanSerializerFactory.class, BeanDeserializerFactory.class);
    // register the TemplateLabelValues class
    QName templatevals = new QName(bipNamespace, "TemplateFormatsLabelValues");
    cls = TemplateFormatsLabelValues.class;
    call.registerTypeMapping(cls, templatevals, BeanSerializerFactory.class, BeanDeserializerFactory.class);
    Could you please give it a try?
    Thanks.
    Yang

  • How do I change alphabetical element listing in xml to nested xml using xslt?

    Have an 'Bus Card Request' indd form exported to fillable form pdf (reader enabled etc). Have 'Bus Card Template' indd to receive the BC data from the returned filled pdf form.
    The tags & structure are identical on both indd docs.
    The xml exported from the pdf discards the structure (nesting) and provides all the elements in alphabetical order.
    I am a novice learning how to make an xslt that will transform the alphabetical listing back to the nested structure.
    I want to turn this:
    <?xml version="1.0" encoding="UTF-8"?>
    <fields xmlns:xfdf="http://ns.adobe.com/xfdf-transition/">
    <Address>1234 Take Wing</Address>
    <Cell_Number>619.321.6878</Cell_Number>
    <City>San Diego</City>
    <Clin_Sup_Lic_Number>SL00267</Clin_Sup_Lic_Number>
    <Clinical_Supervisor_Name>Jarmal Hincks</Clinical_Supervisor_Name>
    <ComboBox2 xfdf:original="Combo Box 2">sdyouthservices.org</ComboBox2>
    <Date_Signed_Loc_Dir>9/29/2014a</Date_Signed_Loc_Dir>
    <Date_Signed_Orig>9/29/2014</Date_Signed_Orig>
    <Degree>MA</Degree>
    <Email_Address>s.reeves</Email_Address>
    <Extension>1234</Extension>
    <Fax_Number>619.123.9876</Fax_Number>
    <Intern_Number>XX20</Intern_Number>
    <License_Number>YY20</License_Number>
    <Location>Point Loma Campus</Location>
    <Name>Steve Reeves</Name>
    <Notes_and_Comments>Make it a super duper bus card</Notes_and_Comments>
    <Program>Learning Curve</Program>
    <State>CA</State>
    <Telephone_Number>619.123.4567</Telephone_Number>
    <TextField27 xfdf:original="Text Field 27">www.sdyouthservices.org</TextField27>
    <Title>Superman</Title>
    <Zip>99999</Zip>
    </fields>
    into this:
    <BC_Order>
    <Group_Name>
       <Name></Name>
       <Degree></Degree>
       
<Title></Title>
       <Intern_Number></Intern_Number>
       <License_Number></License_Number>
    </Group_Name>
    <Group_Location>
       <Location></Location>
      
<Program></Program>
      
<Address></Address>

      <City></City>
      <State></State>
      <Zip></Zip>
    </Group_Location>
    <Group_Phone>
      <Telephone_Number></Telephone_Number>
      <Extension></Extension>

      <Fax_Number></Fax_Number>
      <Cell_Number></Cell_Number>
    </Group_Phone>
    <Group_Email-WS>
      <Email_Address></Email_Address>
      <eMail_Host></eMail_Host>

      <Website></Website>

      <Clinical_Supervisor_Name></Clinical_Supervisor_Name>
      <Clin_Sup_Lic_Number></Clin_Sup_Lic_Number>
    </Group_Email-WS>
    </BC_Order>
    Is this xslt code on the right track?
    (i've left out the usual header stuff)
    <BC_Order>
    <Group_Name>
    <Name><xsl:value-of select="Name"/></Name>
    <Degree><xsl:value-of select="Degree"/></Degree>
    <Title><xsl:value-of select="Title"/></Title>
    <Intern_Number><xsl:value-of select="Intern_Number"/></Intern_Number>
    <License_Number><xsl:value-of select="License_Number"/></License_Number>
    </Group_Name>
    </BC_Order>
    I'm just trying to figure out what the words are to make nesting occur in the resultant xml so it will match the nesting order in the Bus Card input template.
    Thanks!
    Paul

    Hi Paul,
    Is this xslt code on the right track?
    Yes, no...
    The root element in the XML from the form is "fields" without the quote marks. So the XSL needs the full path to the elements to include the "fields" root element. The select would therefore be "<xsl:value-of select="fields/Name" />"
    Note that because I like seeing the XML with line breaks, the "<xsl:text>&#xA;</xsl:text>" precedes each line. Without that, one gets a long string. But it isn't really needed and there are other means of accomplishing it.
    I think the below will do what you need.
    Take care, Mike
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <xsl:text>&#xA;</xsl:text><BC_Order>
    <xsl:text>&#xA;</xsl:text><Group_Name>
    <xsl:text>&#xA;</xsl:text><Name><xsl:value-of select="fields/Name" /></Name>
    <xsl:text>&#xA;</xsl:text><Degree><xsl:value-of select="fields/Degree" /></Degree>
    <xsl:text>&#xA;</xsl:text><Title><xsl:value-of select="fields/Title" /></Title>
    <xsl:text>&#xA;</xsl:text><Intern_Number><xsl:value-of select="fields/Intern_Number" /></Intern_Number>
    <xsl:text>&#xA;</xsl:text><License_Number><xsl:value-of select="fields/License_Number" /></License_Number>
    <xsl:text>&#xA;</xsl:text></Group_Name>
    <xsl:text>&#xA;</xsl:text><Group_Location>
    <xsl:text>&#xA;</xsl:text><Location><xsl:value-of select="fields/Location" /></Location>
    <xsl:text>&#xA;</xsl:text><Program><xsl:value-of select="fields/Program" /></Program>
    <xsl:text>&#xA;</xsl:text><Address><xsl:value-of select="fields/Address" /></Address>
    <xsl:text>&#xA;</xsl:text><City><xsl:value-of select="fields/City" /></City>
    <xsl:text>&#xA;</xsl:text><State><xsl:value-of select="fields/State" /></State>
    <xsl:text>&#xA;</xsl:text><Zip><xsl:value-of select="fields/Zip" /></Zip>
    <xsl:text>&#xA;</xsl:text></Group_Location>
    <xsl:text>&#xA;</xsl:text><Group_Phone>
    <xsl:text>&#xA;</xsl:text><Telephone_Number><xsl:value-of select="fields/Telephone_Number" /></Telephone_Number>
    <xsl:text>&#xA;</xsl:text><Extension><xsl:value-of select="fields/Extension" /></Extension>
    <xsl:text>&#xA;</xsl:text><Fax_Number><xsl:value-of select="fields/Fax_Number" /></Fax_Number>
    <xsl:text>&#xA;</xsl:text><Cell_Number><xsl:value-of select="fields/Cell_Number" /></Cell_Number>
    <xsl:text>&#xA;</xsl:text></Group_Phone>
    <xsl:text>&#xA;</xsl:text><Group_Email-WS>
    <xsl:text>&#xA;</xsl:text><Email_Address><xsl:value-of select="fields/Email_Address" /></Email_Address>
    <xsl:text>&#xA;</xsl:text><eMail_Host><xsl:value-of select="fields/ComboBox2" /></eMail_Host>
    <xsl:text>&#xA;</xsl:text><Website><xsl:value-of select="fields/TextField27" /></Website>
    <xsl:text>&#xA;</xsl:text><Clinical_Supervisor_Name><xsl:value-of select="fields/Clinical_Supervisor_Name" /></Clinical_Supervisor_Name>
    <xsl:text>&#xA;</xsl:text><Clin_Sup_Lic_Number><xsl:value-of select="fields/Clin_Sup_Lic_Number" /></Clin_Sup_Lic_Number>
    <xsl:text>&#xA;</xsl:text></Group_Email-WS>
    <xsl:text>&#xA;</xsl:text></BC_Order>
    </xsl:template>
    </xsl:stylesheet>

  • Working With Nested XML Data

    Hello,
    I'm doing my best to create a page in Dreamweaver CS4 utilizing Spry datasets and, I hope, a valid nested XML file. What I want to do is use one XML file that provides the content for my nav div and my content div. It would, in essence, display as an outline. When a user clicks on an item in the nav div the content would be displayed. What I'm guessing would work for the XML file would be this format:
    <content>
      <topic name="Elements">   //--this would serve as the nav element and trigger
        <header>Non-editable</header>   //--this would serve as a header in the content area
        <info>
          <detail id="1">CSS, javascript</detail>   //--this would serve as detail under the headers in the content area.
          <detail id="2">Headers</detail>
          <detail id="3">Footers</detail>
          <detail id="4">Areas within navigation panel</detail>
        </info>
      </topic>
    </content>
    I got the idea from this page in Live Docs: Create a Spry nested data set. Also from a Labs page called Nested XML Data Sample. I've been able to make various parts of the page work but I don't know what is broken. My issues are this:
    I once saw but can no longer find a method for preventing redundant display of data. In this case, the nav elements which are attributes in my XML file.
    The details are showing up in my content area. I must be doing the code for the nesting incorrectly.
    I want to then use the details in the content area to trigger spry tooltips, the content for whih would be genereated from an XML file or HTML frags.
    Here is my latest, ill-fated attempt:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Menu - Content Example</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryNestedXMLDataSet.js" type="text/javascript"></script>
    <script src="SpryAssets/xpath.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryStackedContainers.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
    <!--
    var dsContent5 = new Spry.Data.XMLDataSet("navigation/content5.xml", "content/topic", {useCache: false});
    var dsInfo = new Spry.Data.NestedXMLDataSet(dsContent5, "info/detail");
    //-->
    </script>
    </head>
    <body>
    <div id="wrapper">
      <div id="header">
        <h1>CSU Website Clinic</h1>
        <h3>Bill Milhoan, IS&amp;T Technical Trainer</h3>
      </div>
      <div id="content" spry:region="dsInfo">
        <ul spry:repeatchildren="dsInfo">
          <li>{dsContent5::info}</li>
        </ul>
      </div>
      <div class="nav" spry:region="dsContent5">
        <ul spry:repeatchildren="dsContent5" spry:choose="">
          <li spry:when="{dsContent5::ds_CurrentRowID} == {dsContent5::ds_RowID}" spry:setrow="dsContent5" spry:select="select" spry:hover="hover" spry:selected="">{dsContent5::@name}</li>
          <li spry:default="" spry:setrow="dsContent5" spry:select="select" spry:hover="hover">{dsContent5::@name}</li>
        </ul>
      </div>
    </div>
    </body>
    </html>
    Thoughts? My hope is to distill this process so I can teach others how to do it in the hopes that they will find it easier to keep their department/program websites up-to-date.
    Thanks for the help.
    Bill Milhoan
    Cleveland State University

    I apologize, im using Spry XML Data Set. i guess the best way to describe what im trying to do is, i want to use the Non-desctructive filter sample with the Spry Nested XML Data sample. So with my sample xml on my first post and with the same code non-destructive filter is using, im having trouble trying to search repeating nodes, for some reason it only searches the last node of the repeating nodes. Does that make sense? let me know.
    thank you Arnout!

  • Com.bea.xml.XmlException error for "could not create child element"

    In Workshop 9.2, after I created a project with XMLBeans Builder Builder against the xsd's and created a web service control against a wsdl, I inserted the control in a client project for consumption. However, when calling into a method of the control, I got a com.bea.xml.XmlException, saying "could not create child element" for an object parameter passed in the call to the method. The relevant info in the server console looks like this:
    Caused by: com.bea.xml.XmlException: could not create child element 'wirelessPhoneNumber' for Wrapped XMLBean operation on '<?xml version="1.0" encoding="UTF-8
    "?><m:sendSMSMessage xmlns:m="http://service.xyz.com/provider/mobile/abc/sendSMSMessage/200701/"><ns:behaviorVersion xmlns:ns="http://service.xyz.com/entity/message/2003/">0</ns:behaviorVersion><ns:custNbr xmlns:ns="http
    ://service.xyz.com/entity/party/2003/">Hello</ns:custNbr></m:sendSMSMessage>'
    Does any have an idea what this is trying to tell me?
    Thanks in advance for any help,
    Jason

    Looking into it further, I think it's the parameter wirelessPhoneNumber, which is a complex type from xsd and a java object passed to the call sendSMSMessage, that is having a namespace problem, or other problem.
    This parameter object was from XMLBeans java binding. I created and set it up like this before passing it to the call:
    PhoneNumberType phoneNumberType = phoneNumberType.Factory.newInstance();
    phoneNumberType.setFormat(PhoneNumberFormatEnum.FREEFORM);
    phoneNumberType.setFullNumber(phoneNumber);
    Obviously, com.bea.xbeanmarshal.buildtime.internal.util.XmlBeanUtil.createWrappedXBeanTopElement of XmlBeanUtil.java had a problem creating a wrapper element for it.
    Any clue from anyone?
    Jason

  • Dynamically rename the root node of XML based on the child elements

    Hi Gurus,
    Is there any way to rename the root node of the resultant XML after a mapping based on the child elements.
    For ex:
    consider the following resultant XML after mapping
    <result>
    <element1> </element1>
    <result>
    if the element1 is <type> then the output should be
    <category>
    <type> </type>
    </category>
    elseif the element1 is <character> then the output should be
    <property>
    <character> </character>
    </property>
    Let me know how to do this, either in XSLT or in Graphical mapping.
    Thanks,
    Prabu

    Hi, Prabu:
    In this case, I am suggest you have Src and Tar Message.
    I am suggesting you create another type of message using key / value pair as I suggested, e.g. called Mid Message.
    My solution for you is to have two message mappings:
    1. Src -> Mid
    2. Mid -> Tar.
    In first mapping, you have no control of the structure, but you can map it to Mid structure:
    e.g.
      if Type node Exist, then map 'Type' to Key, as Key/Value can be creatd under a parent node with 0:1 Occurrence.
      saying item.
       in this case, a new item created.
    If you think of this way, any xml file can be represted in this way:
       <Employee>
          <Fname>David</Fname>
          <Lname>Miller</Lname>
       </Employee>  
       <Employee>
          <Fname>Steve</Fname>
          <Lname>Mai</Lname>
       </Employee>   
    Can be interpretd as this way:
       <Employee>
          <Element>
             <key>Fname</Key>
             <value>David</Value>
          </Element>
          <Element>
             <key>Lname</Key>
             <value>Miller</Value>
          </Element>
       </Employee>  
       <Employee>
          <Element>
             <key>Fname</Key>
             <value>Steve</Value>
          </Element>
          <Element>
             <key>Lname</Key>
             <value>Mai</Value>
          </Element>
       </Employee> 
    Now you should understand what I mean.
    In your case target structure have to desgined as following way:
    You need to put Category and Property together with their sub-structure in parallel, make occurence to 0:1
    In your second mapping, you can check the key value is "Type" or "Character", based on which one is true,
    you create corresponding structure: either Categary or Property.
    Regards
    Liang
    Edited by: Liang Ji on Oct 22, 2010 8:31 PM
    Edited by: Liang Ji on Oct 22, 2010 8:35 PM

Maybe you are looking for

  • GL Balance Report output not Matching with Material Stock

    Hi, Can we Match Reports MB5B (Stock on Posting Date)  and S_ALR_87012301 (G/L Account Balance)??? Till March these reports are matching but from April 11, data not matching.. In tcode MB5B, we are looking Valuated Stock of Materials and in tcode s_a

  • Weblogic 10.3.0 on Solaris 10 Sparc

    Hello, Need Help!!!! I have installed WL 10.3.0 on Solaris 10 Sparc 64bits and i have this Error: <May 31, 2010 6:51:56 PM WEST> <Warning> <Socket> <BEA-000444> <Could not load the performance pack that can take advantage of /dev/(e )poll device due

  • Device no longer syncs with Outlook after changing to new Outlook database/p​rofile

    My Outlook 2007 crashed so Microsoft took control of my system via internet. Problem was diagnosed as corrupted database, so tech created new database to copy all data to. Outlook works well now, but I cannot get my calendar, contacts, tasks, etc to

  • TS1702 There was an error in the App Store. Please try again later. (100)

    I was trying to purchase imovie for the wife for her classes. I was able to purchase and install Garageband and iphoto. But I keep getting the App Store error in the subject line and directed to For assistance, contact iTunes Support at www.apple.com

  • Has anyone else noticed websites automatically opening App Store?

    I don't know if this is a vulnerability opened up in IOS 7 (when I firs noticed it) or if it's just something unscrupulous web vultures have recently discovered, but I've noticed I'll be on a website (usually one of those websites with lists, or pict