XMLType.Transform () / namespace

Hello

My server is Oracle9i Enterprise Edition Release 9.2.0.6.0.

I'm transforming an XML fragment of entry into a fragment of XML output using XMLType.Transform ().
This works well when no namespace attribute is present in the input XML code.

For example:

< < < code > > >
DECLARE
LXML XMLTYPE: = XMLTYPE ("< movement >
< NOTF_ID > 1022914300 < / NOTF_ID >
< SNUN_CDE > BE40309029-0101 < / SNUN_CDE >
< ANML_REF_NBR > 6 43301900 < / ANML_REF_NBR >
< NOTP_CDE > MMDPR < / NOTP_CDE >
< OCR_DTE > 2008 - 11 - 05T 00: 00:00 < / OCR_DTE >
(< / movement > ');

lxsl XMLTYPE: = XMLTYPE ("< xsl: stylesheet version ="1.0"xmlns: xsl =" http://www.w3.org/1999/XSL/Transform">)
< xsl: output method = "xml" / >
< xsl: template match = "Movement" >
< movement >
< xsl: Copy - of select="./NOTF_ID"/ >
< xsl: Copy - of select="./ANML_REF_NBR"/ >
< xsl: Copy - of select="./OCR_DTE"/ >
< / movement >
< / xsl: template >
(< / xsl: stylesheet > ');
lstr VARCHAR2 (4000);
BEGIN
LXML: = lxml. Transform (lxsl);

-show the result
lstr: = lxml.getStringVal ();
IN all, LENGTH (lstr) > 0
LOOP
DBMS_OUTPUT. Put_line (substr (lstr, 1, 255));
lstr: = SUBSTR(lstr,256);
END LOOP;
END;
/
< < < code > > >

The result is exactly what I want it to be:

< < < output > > >
< movement >
< NOTF_ID > 1022914300 < / NOTF_ID >
< ANML_REF_NBR > 6 43301900 < / ANML_REF_NBR >
< OCR_DTE > 2008 - 11 - 05T 00: 00:00 < / OCR_DTE >
< / movement >
< < < output > > >

However, when a namespace attribute is present on the element root entry XML, the result of the transformation, not what want to:

< < < code > > >
DECLARE
LXML XMLTYPE: = XMLTYPE ("< movement xmlns =" http://some_url">)
< NOTF_ID > 1022914300 < / NOTF_ID >
< SNUN_CDE > BE40309029-0101 < / SNUN_CDE >
< ANML_REF_NBR > 6 43301900 < / ANML_REF_NBR >
< NOTP_CDE > MMDPR < / NOTP_CDE >
< OCR_DTE > 2008 - 11 - 05T 00: 00:00 < / OCR_DTE >
(< / movement > ');

lxsl XMLTYPE: = XMLTYPE ("< xsl: stylesheet version ="1.0"xmlns: xsl =" http://www.w3.org/1999/XSL/Transform">)
< xsl: output method = "xml" / >
< xsl: template match = "Movement" >
< movement >
< xsl: Copy - of select="./NOTF_ID"/ >
< xsl: Copy - of select="./ANML_REF_NBR"/ >
< xsl: Copy - of select="./OCR_DTE"/ >
< / movement >
< / xsl: template >
(< / xsl: stylesheet > ');
lstr VARCHAR2 (4000);
BEGIN
LXML: = lxml. Transform (lxsl);

-show the result
lstr: = lxml.getStringVal ();
IN all, LENGTH (lstr) > 0
LOOP
DBMS_OUTPUT. Put_line (substr (lstr, 1, 255));
lstr: = SUBSTR(lstr,256);
END LOOP;
END;
/
< < < code > > >

This translates to the concatenation of all the item values in the input XML code:

< < < output > > >
43301900MMDPR2008 1022914300BE40309029-0101BE 6-11 - 05T 00: 00:00
< < < output > > >

My question is: how to make the style sheet so that the attribute for namespace in the XML of entry is either ignored or simply copied in the XML output?

Any suggestions?

Thank you
Jaap Kool

I knew that my first reaction was made of namespace on the elements copied over but he did show you how to use namespaces and you allowed to go further along your solution. Here's a way (others may exist) to remove the copy of empty items above



     
     
          
               
                    
                         
                    
               
               
                    
               
               
                    
               
          
     

The reason behind using text() is therefore that would not result in the empty element in your XML output file.

Hope that helps.

Tags: Oracle Development

Similar Questions

  • An unescaped ampersand still causes LPX-00242 in xmltype.transform

    Running Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production

    Collect web form and recovery through SQLX functions then transformed into html and plain text documents. If the '&' entered... functions SQLX is not immune to "& amp;"... but the LPX-00242 error is always triggered when sending to xmltype.transform.

    A simple test case:
    set define off;
    declare
    l_xsl xmltype;
    l_xml xmltype;
    begin
    
    l_xsl := xmltype('<?xml version="1.0"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="text"/>
    
    <xsl:template match="/">
    
    Hello <xsl:value-of select="//name"/>
    
    </xsl:template>
    </xsl:stylesheet>');
    
    l_xml := xmltype('<test><name>Jane&amp;John Doe</name></test>');
    
    dbms_output.put_line(l_xml.transform
                                        (l_xsl
                                        ).getclobval ());
    end;
    the code above throws this exception:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00241: entity reference is not well formed
    Error at line 3
    ORA-06512: at "SYS.XMLTYPE", line 138
    ORA-06512: at line 20
    If I restart the block above... but change the string xml < test > < name > Jane & amp; amp; John Doe < / name > < / test >

    Now, I get the following exception:
    Error at line 2
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00242: invalid use of ampersand ('&') character (use &amp;)
    Error at line 3
    ORA-06512: at "SYS.XMLTYPE", line 138
    ORA-06512: at line 20
    If I change the xml < test > < name > string Jane & amp; amp; amp; John Doe < / name > < / test >... no exception and displays the following text:

    Hello Jane & amp; amp; John Doe

    any reason why the SQLX function escape is not enough and I need to double-escape it? The working version ideal, since I now have to decode the reference entity to him is not character, otherwise the code entity reference appears in the content.

    Published by: pl_sequel on 7 Sep 2011 14:12

    [4] all that requires the double escapement in a part of the xml, but not the other is suspect.

    Okay, but see my example again (tested in 11.2.0.1), no double-escaping used, and the output is correct.

    The tip of the double escapement is just what OP found as a workaround for his code, but then it is equivalent to the method = "xml" in the first place (as you showed some post after).

  • Problem with extracted xmltype and namespace

    I have this code
    SET SERVEROUTPUT ON
    DECLARE
      
      id_error VARCHAR2(4000);
    
      docResp varchar2(32767);
      resp sys.xmltype:= null;
      docClob CLOB;
      docDom xmldom.DOMDocument;
      in_xml sys.xmltype;
    
      lista xmldom.DOMNodeList;
      nodo  xmldom.DOMNode;
    
      totmp varchar2(4000);
      texto varchar2(4000);
    
    
      -- Parse ------------------------------------------------------------------
      FUNCTION Parse( xml_clob CLOB ) RETURN xmldom.DOMDocument IS
        retDoc    xmldom.DOMDocument;
        parseador xmlparser.parser;
      BEGIN
        parseador := xmlparser.newParser;
        xmlparser.parseClob( parseador, xml_clob );
        retDoc := xmlParser.getDocument( parseador );
        xmlparser.freeParser( parseador );
        RETURN retDoc;
      END Parse;
    
    BEGIN
    dbms_Output.enable(10000);
      docResp := 
        '<SOAP-ENV:Envelope xmlns:SOAP-ENV = "http://schemas.xmlsoap.org/soap/envelope/">
        <SOAP-ENV:Body>
            <SOAP-ENV:Fault>
                <faultcode>A</faultcode>
                <faultstring>B</faultstring>
                <detail>
                    <siebelf:errorstack xmlns:siebelf = "http://www.siebel.com/ws/fault">
                        <siebelf:error>
                            <siebelf:errorsymbol>E</siebelf:errorsymbol>
                            <siebelf:errormsg>C</siebelf:errormsg>
                        </siebelf:error>
                    </siebelf:errorstack>
                </detail>
            </SOAP-ENV:Fault>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>';
    
      in_xml := sys.xmltype.createxml(docResp);
      resp := xmltype.createxml(docResp);
      docClob := resp.getClobVal();
      docDom := Parse(docClob);
    
    
      -- Recupero la lista de nodos
      lista := xmldom.getElementsByTagName( docDom, 'errorsymbol' );
      nodo := ( xmldom.item( lista, 0 ) );
    
      xmldom.writeToBuffer(nodo, totmp);
      dbms_Output.put_line('VALUE: '||totmp);
      texto :=
      sys.xmltype.
      createxml(totmp).extract('//text()').getStringVal();
      dbms_Output.put_line('FINAL: '||texto);
    END;
    /
    If try run in Oracle9i Enterprise Edition Release 9.2.0.6.0, result:
    VALUE: <siebelf:errorsymbol xmlns:siebelf="http://www.siebel.com/ws/fault">E</siebelf:errorsymbol>
    FINAL: E
    If try in Oracle Database 10g Enterprise Edition Release 10.2.0.4.0, result
    VALUE: <siebelf:errorsymbol>E</siebelf:errorsymbol>
    DECLARE
    *
    ERROR en línea 1:
    ORA-31011: fallo en el análisis de XML
    ORA-19202: Se ha producido un error en el procesamiento
    LPX-00234: el prefijo de espacio de nombres "siebelf" no se ha declarado
    Error at line 1
    de XML
    ORA-06512: en "SYS.XMLTYPE", línea 60
    ORA-06512: en línea 62
    Why?

    Published by: jortri on June 25, 2010 11:37

    The differences are due to the fact that Oracle 10 g went in accordance with W3C.
    If the XMLType constructor complains about a missing namespace declaration, which is XML not valid according to the W3C.

    That being said, you can greatly simplify the code:

    DECLARE
    
      docResp varchar2(32767);
      resp    xmltype;
      error   xmltype;
    
    BEGIN
    
      docResp :=
        '
        
            
                A
                B
                
                    
                        
                            E
                            C
                        
                    
                
            
        
    ';
    
      resp := xmltype(docResp);
      error := resp.extract('//siebelf:errorsymbol', 'xmlns:siebelf="http://www.siebel.com/ws/fault"');
    
      dbms_output.put_line('VALUE: '||error.getStringVal());
      dbms_output.put_line('VALUE: '||error.extract('//text()').getStringVal());
    
    END;
    
  • Transform XMLTYPE works differently in Oracle 10.1 and 11.2

    We are migrating our applications to Oracle 10.1 g to 11.2 g. We have a number of routines of PL/SQL that transform the incoming/outgoing XML using the XMLType Transform method. XSLT transformations that we use doesn't seem to work at 11.2. For example, the code below is a simplification of what we do. This code example uses the coded entrance to irreversibly and xslt to illustrate this point. The same code has very different results when operating in 10.1 and 11.2. In 10.1, the work of transformation. He was also using files in an xml tool. 11.2, none of the input XML is transformed. The only exit is the extra < sd:StandardBusinessDocument... which is hard-coded in the xslt as a wrapper.

    For example

    {code}

    declare

    out_sbd xmltype: = xmltype ("< OT_SBD_HEADER >

    < HEADER_VERSION > 1.0 < / HEADER_VERSION >

    SENDERS <>

    < OT_SENDER_RECEIVER >

    COGSD < ID > < / IDENTIFIER >

    < IDENTIFIER_AUTHORITY > urn:olgr.qld.gov.au:cogs < / IDENTIFIER_AUTHORITY >

    < / OT_SENDER_RECEIVER >

    < / SENDERS >

    <>RECEIVERS

    < OT_SENDER_RECEIVER >

    PORTAL of < ID > < / IDENTIFIER >

    < IDENTIFIER_AUTHORITY > urn:olgr.qld.gov.au: portal < / IDENTIFIER_AUTHORITY >

    < / OT_SENDER_RECEIVER >

    < / RECEIVERS >

    < DOCUMENT_INDENTIFICATION >

    urn:olgr.qld.gov.au < STANDARD > < / STANDARD >

    < TYPE_VERSION > 1.1 < / TYPE_VERSION >

    < INSTANCE_IDENTIFIER > c11ab0c6-22e7-4132-88f8-f81e88cde75c < / INSTANCE_IDENTIFIER >

    licenceInformation < TYPE > < / TYPE >

    < CREATION_DATE > 2012-05-30T 13: 55:41.167125 + 10:00 < / CREATION_DATE >

    < / DOCUMENT_INDENTIFICATION >

    < BUSINESS_SCOPE >

    < OT_SBD_HEADER_SCOPE >

    get < SCOPE_TYPE > < / SCOPE_TYPE >

    < SCOPE_INSTANCE_IDENTIFIER > GET_GAMING_STATISTICS_DATA < / SCOPE_INSTANCE_IDENTIFIER >

    < / OT_SBD_HEADER_SCOPE >

    < / BUSINESS_SCOPE >

    (< / OT_SBD_HEADER > ');

    --

    transformed_out_sbd xmltype.

    --

    sbd_header_out_xslt xmltype: = xmltype (' <? xml version = "1.0" encoding = "ISO-8859-1"? >)

    <!--

    This file was generated by Altova MapForce 2011r2sp1

    YOU MUST NOT CHANGE THIS FILE, BECAUSE IT WILL

    OVERWRITTEN WHEN YOU RE-RUN OF THE CODE GENERATION.

    See Altova MapForce Documentation for more details.

    http://www.Altova.com/MapForce

    ->

    " < xsl: stylesheet version ="1.0"xmlns: xsl = ' http://www.w3.org/1999/XSL/transform "" xmlns: XS = " " http://www.w3.org/2001/XMLSchema "exclude-result-prefixes ="xs"> "

    < xsl: output method = "xml" encoding = "UTF-8" Indent = "yes" / >

    < xsl: template match = "/" >

    " < sd:StandardBusinessDocument xsi: schemaLocation =" http://www.UNECE.org/CEFACT/namespaces/StandardBusinessDocumentHeader "' sbd.xsd ' xmlns:sd = ' http://www.UNECE.org/CEFACT/namespaces/StandardBusinessDocumentHeader "" xmlns: xsi = " " http://www.w3.org/2001/XMLSchema-instance ">

    < xsl: select = "* [local - name () = foreach & apos;" OT_SBD_HEADER & apos; and namespace - uri () = & apos; & apos;] ">

    < name of xsl: variable = "var1_DOCUMENTINDENTIFICATION" select = "* [local - name () = & apos;" DOCUMENT_INDENTIFICATION & apos; and namespace - uri () = & apos; & apos;] "/ >

    < name of xsl: variable = "var2_MANIFEST" select = "* [local - name () = & apos;" MANIFESTO & apos; and namespace - uri () = & apos; & apos;] "/ >

    < name of xsl: variable = "var3_resultof_cast" select = "string ($var1_DOCUMENTINDENTIFICATION / * [local - name () = & apos;)" MULTIPLE_TYPE & apos; and namespace - uri () = & apos; & ;]) "/ >

    < StandardBusinessDocumentHeader >

    < HeaderVersion >

    < xsl: value - of select = "string (HEADER_VERSION)" / >

    < / HeaderVersion >

    < xsl: for-each select = "SHIPPERS" >

    < name of xsl: variable = sΘlectionner "var4_OTSENDERRECEIVER" = "OT_SENDER_RECEIVER" / >

    sender <>

    <>identifier

    < xsl: attribute name = "Authority" >

    < xsl: value - of select = "string($var4_OTSENDERRECEIVER/IDENTIFIER_AUTHORITY)" / >

    < / xsl: attribute >

    < xsl: value - of select = "string($var4_OTSENDERRECEIVER/IDENTIFIER)" / >

    < / identifier >

    < / sender >

    < / xsl: foreach >

    < xsl: for-each select = 'RECEIVERS' >

    < name of xsl: variable = sΘlectionner "var5_OTSENDERRECEIVER" = "OT_SENDER_RECEIVER" / >

    < receiver >

    <>identifier

    < xsl: attribute name = "Authority" >

    < xsl: value - of select = "string($var5_OTSENDERRECEIVER/IDENTIFIER_AUTHORITY)" / >

    < / xsl: attribute >

    < xsl: value - of select = "string($var5_OTSENDERRECEIVER/IDENTIFIER)" / >

    < / identifier >

    < / receiver >

    < / xsl: foreach >

    < DocumentIdentification >

    < standard >

    < xsl: value - of select = "string($var1_DOCUMENTINDENTIFICATION/STANDARD)" / >

    < / standard >

    < TypeVersion >

    < xsl: value - of select = "string($var1_DOCUMENTINDENTIFICATION/TYPE_VERSION)" / >

    < / TypeVersion >

    < InstanceIdentifier >

    < xsl: value - of select = "string($var1_DOCUMENTINDENTIFICATION/INSTANCE_IDENTIFIER)" / >

    < / InstanceIdentifier >

    < type >

    < xsl: value - of select = "string($var1_DOCUMENTINDENTIFICATION/TYPE)" / >

    < / type >

    < MultipleType >

    < xsl: value-of select = "string (((normalize-space ($var3_resultof_cast) = & apos; true & apos ;) or (normalize-space ($var3_resultof_cast) = & apos; 1 & apos ;)))" / > ")))"

    < / MultipleType >

    < CreationDateAndTime >

    < xsl: value - of select = "string($var1_DOCUMENTINDENTIFICATION/CREATION_DATE)" / >

    < / CreationDateAndTime >

    < / DocumentIdentification >

    <>Manifesto

    < NumberOfItems >

    < xsl: value - of select = "string ((string($var2_MANIFEST/NUMBER_OF_ITEMS)))" / >

    < / NumberOfItems >

    < xsl: for-each select = "$var2_MANIFEST/MANIFEST_ITEMS" >

    < name of xsl: variable = sΘlectionner "var6_OTMANIFESTITEM" = "OT_MANIFEST_ITEM" / >

    < ManifestItem >

    < MimeTypeQualifierCode >

    < xsl: value - of select = "string($var6_OTMANIFESTITEM/MIME_TYPE)" / >

    < / MimeTypeQualifierCode >

    < UniformResourceIdentifier >

    < xsl: value - of select = "string($var6_OTMANIFESTITEM/RESOURCE_IDENTIFIER)" / >

    < / UniformResourceIdentifier >

    < description >

    < xsl: value - of select = "string($var6_OTMANIFESTITEM/DESCRIPTION)" / >

    < / description >

    < / ManifestItem >

    < / xsl: foreach >

    < / manifesto >

    < xsl: for-each select = "BUSINESS_SCOPE" >

    < name of xsl: variable = sΘlectionner "var7_OTSBDHEADERSCOPE" = "OT_SBD_HEADER_SCOPE" / >

    < BusinessScope >

    < scope >

    < type >

    < xsl: value - of select = "string($var7_OTSBDHEADERSCOPE/SCOPE_TYPE)" / >

    < / type >

    < InstanceIdentifier >

    < xsl: value - of select = "string($var7_OTSBDHEADERSCOPE/SCOPE_INSTANCE_IDENTIFIER)" / >

    < / InstanceIdentifier >

    <>identifier

    < xsl: value - of select = "string($var7_OTSBDHEADERSCOPE/SCOPE_IDENTIFIER)" / >

    < / identifier >

    < / scope >

    < / BusinessScope >

    < / xsl: foreach >

    < / StandardBusinessDocumentHeader >

    < / xsl: foreach >

    < / sd:StandardBusinessDocument >

    < / xsl: template >

    < / xsl: stylesheet >

    ');

    --

    --

    BEGIN

    transformed_out_sbd: = out_sbd.transform (sbd_header_out_xslt); -using the above hard coded XSLT to transform out_sbd

    --

    INSERT INTO z_clob_log (id, clob_name, clob_desc, clob_doc) - connect the output to a clob column in a table

    SELECT (select nvl (max (id), 0) + 1 _clob_log).

    TO_CHAR (sysdate, 'YYYYMMDD hh24:mi:ss') |' -CHANGED OUT_SBD',.

    transformed_out_sbd.getClobVal

    DOUBLE;

    COMMIT;

    END;

    {code}

    10.1, the output is as expected, the same thing that do the transformation using files in an xml tool.

    {code}

    " < sd:StandardBusinessDocument xsi: schemaLocation =" http://www.UNECE.org/CEFACT/namespaces/StandardBusinessDocumentHeader "' sbd.xsd ' xmlns:sd = ' http://www.UNECE.org/CEFACT/namespaces/StandardBusinessDocumentHeader "" xmlns: xsi = " " http://www.w3.org/2001/XMLSchema-instance ">

    < StandardBusinessDocumentHeader >

    < HeaderVersion > 1.0 < / HeaderVersion >

    sender <>

    < Authority = "identifier urn:olgr.qld.gov.au:cogs" > COGSD < / identifier >

    < / sender >

    < receiver >

    < Authority = "urn:olgr.qld.gov.au: portal identifier" > PORTAL < / identifier >

    < / receiver >

    < DocumentIdentification >

    urn:olgr.qld.gov.au < standard > < / Standard >

    < TypeVersion > 1.1 < / TypeVersion >

    < InstanceIdentifier > c11ab0c6-22e7-4132-88f8-f81e88cde75c < / InstanceIdentifier >

    licenceInformation < type > < / Type >

    < MultipleType > false < / MultipleType >

    < CreationDateAndTime > 2012-05-30T 13: 55:41.167125 + 10:00 < / CreationDateAndTime >

    < / DocumentIdentification >

    <>Manifesto

    < NumberOfItems / >

    < / manifesto >

    < BusinessScope >

    < scope >

    get < type > < / Type >

    < InstanceIdentifier > GET_GAMING_STATISTICS_DATA < / InstanceIdentifier >

    < identifier / >

    < / scope >

    < / BusinessScope >

    < / StandardBusinessDocumentHeader >

    < / sd:StandardBusinessDocument >

    {code}

    11.2, none of the original xml document is included in the output, only the < sd: StandardBusinessDocument... / >

    {code}

    " < sd:StandardBusinessDocument xsi: schemaLocation =" http://www.UNECE.org/CEFACT/namespaces/StandardBusinessDocumentHeader "' sbd.xsd ' xmlns:sd = ' http://www.UNECE.org/CEFACT/namespaces/StandardBusinessDocumentHeader "" xmlns: xsi = " " http://www.w3.org/2001/XMLSchema-instance "/>

    {code}

    The same happens using the SQL XMLTransform function, for example apply what follows with the above xml and xslt, except that it generates a separate closing tag < / sd:Standard... >

    Select xmltransform (out_sbd, sbd_header_out_xslt) in double transformed_out_sbd;

    Q: any ideas? Are there changes in 11g 11.2 requiring major changes to xslt?

    We have a lot of rewriting for this if we can't get this to work!

    Hi Eduardo,

    Report it as a bug to the Support of Oracle.

    The problem lies in the function namespace - uri (): comparison with an empty string is not resolved properly, so no node is still selected in the first xsl: for each.

    If you need a workaround solution, there are some that you can test:

    (1) if the entry documents are actually in no namespace (for example, in your example), delete all occurrences namespace - uri () of the style sheet.

    (2) in the opposite direction, you can give your document of entry a dummy namespace and now referenced in the style sheet. The namespace - uri () test will work in this case.

    (3) replace the occurrences of namespace - uri () by a somewhat more elaborate test that will handle namespace empty in particular, for example:

    (namespace-uri () = $nsuri or (not ($nsuri) and not (namespace - uri ()))

    Given that you work with generated style sheets, I understand that none of the options above are really satisfactory.

    If I had to work around the problem, I would probably go with the 2nd option which involves a smaller amount of refactoring.

  • Best practices to generate an output HTML to send by mail

    Hello

    In our 11g application we are generating a mail plaintext database plsql, with little data retrieved by a query.

    Now, mail is growing complex, so we´d like to put a little more shaped (an html table, I guess).

    I see a few solutions:

    1 crap: create html with concat string and a good ol' ' cursor for loop.

    2. get the result of the query in xml format and apply an xsl stylesheet to generate the html string. Cleaner, but it's worth? How can you get the HTML?

    Can you suggest me a good practice to achieve this? Any oracle package?

    We currently use the #2 option in one of our applications, and yes it is worth.

    This approach separates data layout and allows different formats to come from the same source, for example html, text, csv, and formats the same oox (.xlsx).

    Any oracle package?

    XMLTransform() function

    XMLType transform() method

    DBMS_XSLPROCESSOR

    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/xdb08tra.htm#ADXDB0900

  • Update (transform) xmltype

    It is a sequel to this discussion:

    updateXML to null value

    where it says towards the end:

    Question 2. If there are any xml function which can update the name of the tag. as in the example above I need to change the < home_address > as < permanant_address >

    No, not directly.

    XQuery Update Facility, which is implemented in the 11.2.0.3 version, can do.

    For lower versions, you will need to use XSLT or XQuery.

    I, too, use 11.1 and I'd like to know how to turn an xmltype stored in a table using XSLT or XQuery. I would be grateful if someone could give an example of one or both.

    Thank you

    Morgan

    4. so, I want to know how to do something like this (pseudocode);

    update books

    Set object_value =

    XMLTRANSFORM (object_value, xsl)

    where XMLExists ('/wrapper')

    Is this possible?

    What happens when you try?

    Yes, it is possible:

    SQL> var xsl clob
    SQL>
    SQL> begin
      2    :xsl := '
      3    
      4    
      5      
      6    
      7  ';
      8  end;
      9  /
    
    PL/SQL procedure successfully completed.
    
    SQL> update books
      2  set object_value =
      3      xmltransform(object_value, xmlparse(document :xsl))
      4  where xmlexists('/wrapper' passing object_value) ;
    
    2 rows updated.
    
    SQL> select count(*) from books where xmlexists('/book' passing object_value) ;
    
      COUNT(*)
    ----------
             4
    

    Although I would not want to use XSLT in this specific example, XQuery is easier and better optimized:

    SQL> roll
    Rollback complete.
    SQL>
    SQL> update books
      2  set object_value =
      3      xmlquery(
      4        '/wrapper/book'
      5        passing object_value
      6        returning content
      7      )
      8  where xmlexists('/wrapper' passing object_value);
    
    2 rows updated.
    
    SQL> select count(*) from books where xmlexists('/book' passing object_value) ;
    
      COUNT(*)
    ----------
             4
    

    Choose between XQuery and XSLT to transform an XML document really depends on the type of operations.

    For example, I tend to use XSLT when processing needs of recursion, such as the removal of one space names default or delete/insert some nodes "deeply" in the document (if I can't use XQuery Update of course).

  • Excerpt from XMLType problem with different namespaces

    Hello

    I need some advice on how to extract the child element to the XML fragment where the parent namespace differs child name space. I have done the broad research and I've tried several options but have had no success.

    This is fragment plsql sample

    vTheXML: = XMLType ("< GeneratedDocument xmlns ="http://tempuri.org/"> ")

    " < file_name xmlns =" http://services.DPM.com.au/intelledox/ "> Test.pdf < / Filename > .

    (< / GeneratedDocument > ');

    Below successfully returns a GeneratedDocument element (IE any fragment)

    vExtractXML: = vTheXML.extract ('/ GeneratedDocument ',' xmlns = "http://tempuri.org/"');

    But none of below works. They return null. I do not know how to represent the different namespaces in the function call retrieves XMLType

    vExtractXML: = vTheXML.extract ('/ GeneratedDocument/filename ',' xmlns = "http://services.dpm.com.au/intelledox/"');

    vExtractXML: = vTheXML.extract ('/ GeneratedDocument/filename ',' xmlns = "http://tempuri.org/"xmlns ="http://services.dpm.com.au/intelledox/"');

    vExtractXML: = vTheXML.extract ('/ GeneratedDocument/filename ',' xmlns = "http://tempuri.org/"');

    Below works, but would ideally use more precise criteria of XPath

    vExtractXML: = vTheXML.extract ("/ / filename ',' xmlns ="http://services.dpm.com.au/intelledox/"'");

    Thank you

    Hello

    Of course, you cannot declare two namespaces by default in the namespace mapping, use at least a prefix to distinguish them:

    vExtractXML: = vTheXML.extract ('/ GeneratedDocument / ns1:FileName ',' xmlns = "http://tempuri.org/" xmlns:ns1 = "http://services.dpm.com.au/intelledox/"');

    (NB: extract and extractvalue, etc. have been deprecated in 11.2)

  • How to add prefixes to namespace to XMLType created from object?

    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    

    I work with SOAP request the creation of a pattern of derived Types.

    Consider the following annotated schema registration (I wanted Oracle to create types for me, but with my own names):

    exec dbms_xmlschema.deleteSchema(schemaURL => 'Parameters4.xsd');
    
    declare
    v_xsd xmltype := xmltype('<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
               xmlns:oraxdb="http://xmlns.oracle.com/xdb"
               xmlns = "http://www.cognera.com"
               targetNamespace = "http://www.cognera.com">
      <xs:element name="Parameters" oraxdb:SQLName="Parameters" oraxdb:SQLType="Parameters">
        <xs:complexType oraxdb:SQLType="Parameters">
          <xs:sequence>
            <xs:element name="Param1" type="xs:string" oraxdb:SQLName="Param1" oraxdb:SQLType="VARCHAR2" />
            <xs:element name="NestedItems" oraxdb:SQLName="NestedItems" oraxdb:SQLType="NestedItemsType">
              <xs:complexType oraxdb:SQLType="NestedItemsType">
                <xs:sequence>
                  <xs:element name="NestedItem" type="NestedItemType" oraxdb:SQLName="NestedItem" oraxdb:SQLType="NestedItemType"/>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:complexType name="NestedItemType" oraxdb:SQLType="NestedItemType">
        <xs:sequence>
          <xs:element name="nParam1" type="xs:string" oraxdb:SQLName="nParam1" oraxdb:SQLType="VARCHAR2"/>
          <xs:element name="nParam2" type="xs:string" oraxdb:SQLName="nParam2" oraxdb:SQLType="VARCHAR2"/>
          <xs:element name="nParam3" type="xs:string" oraxdb:SQLName="nParam3" oraxdb:SQLType="VARCHAR2"/>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
    ');
    begin
      dbms_xmlschema.registerSchema(schemaURL => 'Parameters4.xsd', --this name is local to each ERS schema.                                 
                                          schemaDoc => v_xsd,
                                          local => TRUE,
                                          genTypes => TRUE, --only want the types
                                          genbean => FALSE,
                                          genTables => TRUE, --not sure if I need this
                                          force => TRUE,
                                          owner => user);
    end;
    /
    

    The types created were:

    CREATE OR REPLACE TYPE "NestedItemType" AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T","nParam1" VARCHAR2(4000 CHAR),"nParam2" VARCHAR2(4000 CHAR),"nParam3" VARCHAR2(4000 CHAR))NOT FINAL INSTANTIABLE
    /
    CREATE OR REPLACE TYPE "NestedItemsType" AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T","NestedItem" "NestedItemType")FINAL INSTANTIABLE
    /
    CREATE OR REPLACE TYPE "Parameters" AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T","Param1" VARCHAR2(4000 CHAR),"NestedItems" "NestedItemsType")FINAL INSTANTIABLE
    /
    

    I found that to build these types using constructors (to avoid the PLS-00306: wrong number or types of arguments in the call to 'NestedItemType'), that I needed to change these types (drop the xdb magic):

    CREATE OR REPLACE TYPE "NestedItemType" AS OBJECT ("nParam1" VARCHAR2(4000 CHAR),"nParam2" VARCHAR2(4000 CHAR),"nParam3" VARCHAR2(4000 CHAR))FINAL INSTANTIABLE
    /
    CREATE OR REPLACE TYPE "NestedItemsType" AS OBJECT ("NestedItem" "NestedItemType")FINAL INSTANTIABLE
    /
    CREATE OR REPLACE TYPE "Parameters" AS OBJECT ("Param1" VARCHAR2(4000 CHAR),"NestedItems" "NestedItemsType")FINAL INSTANTIABLE
    /
    

    I read on the forums of a hack to get a space of names added to the output:

    CREATE OR REPLACE TYPE "Parameters" AS OBJECT ("@xmlns" VARCHAR2(4000), -- namespace attribute HACK
                                                           "Param1" VARCHAR2(4000 CHAR),"NestedItems" "NestedItemsType")FINAL INSTANTIABLE
    /
    

    Putting it all together, I have:

    DECLARE
      v_Parameters    "Parameters";
      v_xml           xmltype;
      v_print_output  clob;      
    begin
      v_Parameters :=  "Parameters"('www.cognera.com',
                                    'hello',
                                  "NestedItemsType"("NestedItemType"('one',
                                                                 'two',
                                                                 'three'
                                                                )
                                                 )
                                 );
        
      v_xml := xmltype(xmlData => v_Parameters);
    
      select xmlserialize(document
                          xmlquery('declare namespace soap = "http://www.w3.org/2003/05/soap-envelope";                                                              
                                    declare namespace cognera = "http://www.cognera.com";
                                    <soap:Envelope>
                                       <soap:Header/>
                                       <soap:Body>
                                         {/}
                                       </soap:Body>
                                     </soap:Envelope>
                                   ' passing v_xml returning content) as clob
                          indent size=2
                         ) into v_print_output from dual;
      dbms_output.put_line(v_print_output);
    end;
    

    This generates:

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
      <soap:Header/>
      <soap:Body>
        <Parameters xmlns="www.cognera.com">
          <Param1>hello</Param1>
          <NestedItems>
            <NestedItem>
              <nParam1>one</nParam1>
              <nParam2>two</nParam2>
              <nParam3>three</nParam3>
            </NestedItem>
          </NestedItems>
        </Parameters>
      </soap:Body>
    </soap:Envelope>
    

    What I really want is:

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:c="www.cognera.com">
      <soap:Header/>
      <soap:Body>
        <c:Parameters>
          <c:Param1>hello</c:Param1>
          <c:NestedItems>
            <c:NestedItem>
              <c:nParam1>one</c:nParam1>
              <c:nParam2>two</c:nParam2>
              <c:nParam3>three</c:nParam3>
            </c:NestedItem>
          </c:NestedItems>
        </c:Parameters>
      </soap:Body>
    </soap:Envelope>
    

    How can I do this without having to add to the namespace using the custom XQuery function?

    Both outputs are semantically equivalent.

    Why do you need one?

  • extraction of xmltype and excluding all the tags of the namespace?

    Hi all
    I am trying to extract the xmltype column in another xmltype column in another table.

    Select xt.attachment_content, xt.attachment_type, xt.attachment_format
    OF document_version dva.
    XMLTABLE)
    XMLNamespaces ('http://oracle.com/test1/1.0'),
    "AttachmentList/attachment.

    PASSAGE document_content
    COLUMNS
    attachment_content path of xmltype "content."
    path of varchar2 (100) to attachment_type 'type,'
    XT attachment_format varchar2 (100) path 'format')

    This query returns results, BUT the content has tags and namespaces in the game too. I just want to return the content than ANY version of xml without xmlns: (xmlnamespaces) and etc.

    Please help me how to do this.

    OK, thanks for the effort, however, this is not a test case from work, by far...

    The input XML is not valid because you probably just copied the version without escape sequence and paste here.
    The cuts you made in the XML load make invalid too.

    The query is not true either, syntax XMLNamespaces is bad, but also the XPath expression.

    I understand that you want to present a simplified scenario based on but you are in fact wasting time by not giving something that we can run.

    Now, if I have a query document_attachments table content column displays the results, but with all the tags of the namespace and etc.

    As said, I doubt that the request you give will never recover anything, but that is a different problem.

    What I would like to know because my first answer is why namespaces are a problem for you? They are part of the document and it is easy to deal with them once we know how to do it.

    For example, this retrieve the value of the content as CLOB (plain text) and convert on the fly of XMLType:

    INSERT INTO document_attachments (doc_id, content, type, format)
    SELECT dva.doc_id
         , xmlparse(document xt.attachment_content) as content
         , xt.attachment_type as type
         , xt.attachment_format as format
    FROM document_version dva
       , XMLTable (
           XMLNamespaces(default 'http://optimal.com/SP/2/RandPCommon/DocumentStore/GatewayRequestStore/1.0')
         , 'AttachmentList/attachment'
           PASSING document_content
           COLUMNS
             attachment_content clob          path 'content'
           , attachment_type    varchar2(100) path 'type'
           , attachment_format  varchar2(100) path 'format'
         ) xt
    ;
    

    Now, the contents column is:

    
    
     
    6 6
    /1/2/28/8 /SSRF/Body/Location[@serial='USA:AF:LT:4341b33adc0442a']/Address[1]/@country Brownsville U TX /1/2/27/8 /SSRF/Body/Location[@serial='USA:AF:LT:7c5c3cef2cf74ef']/Address[1]/@country Brownsville U There is no successfully completed Engineering Analysis attached to this proposal. Please run an an There is no successfully completed Engineering Analysis attached to this proposal. Please run an analysis or provide a detailed justification for omitting it. Prepare & Submit Workflow Rules test

    Is this OK so far?

    What do you do next with the content column?
    Yet once there is no need to remove any namespace, or if he really exists, please explain what requirement business dictates who and how the attachment must be treated thereafter.

    Published by: odie_63 on May 26, 2012 19:07

  • XmlType extractValue with namespace throw exception "invalid token".

    Hello. I have XML stored as XMLTYPE and with content, such as:

    + < notificationEF > +.
    + < oos:id > 2812301 < / oos:id > +.

    When I try to run

    extractValue (XML_CLOB, ' notificationEF / oos:id ')

    I catch exception "LPX-00601: token not valid in:" notificationEF / oos:id' "."

    What's wrong? And how do I fix it?

    Thank you.

    Here's one way:

    SQL> var xmldoc varchar2(4000)
    SQL>
    SQL> begin
      2   :xmldoc :=
      3  '
      4  
      7   
      8    4711561
      9    4711561
     10   
     11  ';
     12  end;
     13  /
    
    PL/SQL procedure successfully completed
    
    SQL> SELECT x.id
      2  FROM XMLTable(
      3         XMLNamespaces(
      4           default 'http://example.ru/oos/export/1'
      5         , 'http://example.ru/oos/types/1' as "oos"
      6         )
      7       , '/export/contract/oos:id'
      8         passing xmltype(:xmldoc)
      9         columns id number path '.'
     10       ) x
     11  ;
    
            ID
    ----------
       4711561
       4711561
     
    
  • Schema validation fails on the transformed XML document

    OK, this is weird.

    I get XML files that are supposed to conform to a given XSD. There are dozens of different parties who send these files. To be more precise, I refer to the Ontario Energy Board (OEB) PIPE Documents.

    I found that at least one sender sends invalid files. I can't that fixes to the source, so I'm working around that.

    for example
    <?xml version="1.0" encoding="UTF-8"?>
    <PIPEDocument  xmlns="http://www.oeb.gov.on.ca" 
                              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                              xsi:schemaLocation="http://www.oeb.gov.on.ca/ PIPEDocument.xsd" 
                              Version="4.0" 
                              DocumentReferenceNumber="xxx" CreationDate="20110825100008000ES">
    <MarketParticipantDirectory>
    <Sender>
    ...
    Oracle is not like this:
    ORA-31154: invalid XML document
    ORA-19202: Error occurred in XML processing
    LSX-00344: namespace values "http://www.oeb.gov.on.ca" and "http://www.oeb.gov.on.ca/" differ
    OK, so to work around this problem, before schema validation, I apply an XSLT transformation to clean the top-level element:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.oeb.gov.on.ca">
    <xsl:output method="xml" indent="no"/>
    
    <xsl:template match="/">
        <xsl:copy>
          <xsl:apply-templates/>
        </xsl:copy>
    </xsl:template>
    
    <xsl:template match="*">
        <xsl:if test="local-name() = name()">
                <xsl:element name="{local-name()}">
                  <xsl:apply-templates select="@*|node()"/>
                </xsl:element>
        </xsl:if>
    </xsl:template>
    
    <xsl:template match="@*">
        <xsl:if test="local-name() = name()">
                <xsl:attribute name="{local-name()}">
                  <xsl:value-of select="."/>
                </xsl:attribute>
        </xsl:if>
    </xsl:template>
    </xsl:stylesheet>
    Nice: the fact that it is intended for:
    <?xml version="1.0" encoding="UTF-8"?>
    <PIPEDocument xmlns="http://www.oeb.gov.on.ca" 
                             Version="4.0" 
                             DocumentReferenceNumber="50520110825080908VA0001.EBT" 
                             CreationDate="20110825100008000ES">
    <MarketParticipantDirectory>
    <Sender>
    ...
    If I now the schema validate the above transformed XML, then it validates OK.

    Large? No, if I try to turn on the fly (i.e. without first transformation and followed by reading in the transformed data from the file), I get a strange error:
    declare
     v_xml xmltype := xmltype(bfilename('ERS_FILE_LOAD_308', 'DecryptedFile-30873604.xml'), 0).transform(XDBURIType('/ERS_TEST01/PIPE/XSLT/V1.0/pre_validate_XSLT.xsl').getXML());
     v_xsd_name varchar2(255) := 'PIPE/Power/V4.0/PIPEDocument.xsd'; 
    begin
    if v_xml.isSchemaValid(v_xsd_name) = 1 then 
           dbms_Output.put_line('valid');
        else
           dbms_Output.put_line('invalid');
           
           --in order to get specific error info for a non-schema message need to convert the XML to schema based
           
           v_xml := v_xml.createSchemaBasedXML(v_xsd_name);
          
           v_xml.schemaValidate();               
           
        end if;  
    end;
    /
    ORA-31043: Element '' not globally defined in schema ''
    Exsqueeze me? What element in the schema?

    The transformation itself works very well. Specifically, if I run the following:
    select xmltype(bfilename('ERS_FILE_LOAD_308', 'DecryptedFile-30873604.xml'), 0).transform(XDBURIType('/ERS_TEST01/PIPE/XSLT/V1.0/pre_validate_XSLT.xsl').getXML()).getclobval() from dual;
    ... I get the desired result. Of course, if I save the result file and validate the fact that it works:
    declare
     v_xml xmltype := xmltype(bfilename('ERS_FILE_LOAD_308', 'DecryptedFile-30873604_manually_saved.xml'), 0);
     v_xsd_name varchar2(255) := 'PIPE/Power/V4.0/PIPEDocument.xsd'; 
    begin
    if v_xml.isSchemaValid(v_xsd_name) = 1 then 
           dbms_Output.put_line('valid');
        else
           dbms_Output.put_line('invalid');
           
           --in order to get specific error info for a non-schema message need to convert the XML to schema based
           
           v_xml := v_xml.createSchemaBasedXML(v_xsd_name);
          
           v_xml.schemaValidate();               
           
        end if;  
    end;
    /
    I would like to join example XML file, but it contains customer data so I can't do that. I would fix the XSD but it is the nest of a rat of 50 XSD with includes and a 300 script online registration scheme, so I can't do that.

    What I'm missing here?

    Looks like an Oracle bug for me at this isSchemaValid binds to a beginning of the XML instance and not to the instance transformed.

    thoughts?

    (using database Oracle 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production under linux)

    Published by: Pollocks01 on October 18, 2011 16:11

    Hello

    Looks like an Oracle bug for me at this isSchemaValid binds to a beginning of the XML instance and not to the instance transformed.

    That wouldn't be surprising. There are "few" bugs on the XSL transformation.
    Here's a recently posted: {: identifier of the thread = 2245703}

    The solution was to serialize the output and analyze again.
    So, what you describe on 'reading of a works file' makes me think it's the same kind of problem.

    You can also view the contents of the variable just after that:

    v_xml := v_xml.createSchemaBasedXML(v_xsd_name);
    

    ?

  • Adding namespace to the XML output

    Hello

    I have a requirement to generate an XML document for the columns in the table. I use DBMS_XMLgen.getXML inside my procedure to get the XML document.

    The result I get after my procedure is:

    <? XML version = "1.0"? >
    < EMP >
    < EMPLOYEE_NO > 000017 < / EMPLOYEE_NO >
    ASSETS of < EMPLOYEE_STATUS > < / EMPLOYEE_STATUS >
    Mini < NAME_LAST > < / NAME_LAST >
    < NAME_FIRST / >
    < / EMP >

    But I also need to prefix and uri of namespace in the xml output. Is it possible to add the prefix and namespace uri to the xml output.

    So what I need, is something like below one:

    <? XML version = "1.0"? >
    < xs:EMP > xmlns: out = "http://xmlns:out="http:/example.org/ver1.0/ThisISTest#">
    < xs:EMPLOYEE_NO > 000017 < / xs:EMPLOYEE_NO >
    ACTIVE < xs:EMPLOYEE_STATUS > < / xs:EMPLOYEE_STATUS >
    Mini < xs:NAME_LAST > < / xs:NAME_LAST >
    < xs:NAME_FIRST / >
    < / xs:EMP >


    Any solutions or examples of code on it would be a great help.

    Thanks in advance.

    Strange...

    OK, back to the basics:

    What is your version of db (all four digits please)?

    The following gives the expected result?

    select xmltype('
    
    000017
    ACTIVE
    Mini
    
    ').transform(
     xmltype(
    '
    
    
    
    
    
    
    '
     )
    ).getClobVal()
    from dual;
    
  • Cannot open the schema of the source on the Transformation of the opening

    I get an error when I opened a transformation in my composite SOA in JDeveloper 12.1.3.0.0.

    The error indicates "can't open the source schema:" "WSDLException: faultCode = access to this wsdl file oramds:/apps/company/ABCS/wsdl/CRUD_Item_ABCS_prov.wsdl problem: CachedWSDLReader readWSDL WIthExtensionRegistry returned NULL definition in the WSDL analysis"»»


    I tried to restart JDeveloper and remove the directory with the same result .data.


    Thank you


    Tom

    Hi Tom,

    Check if the WSDL file is appropriately in the right schema locations and targetNamespace is correct.

    Suggest that you copy the WSDL file in the project folder and check to see if the problem still persists. It could be a problem with namespaces. It will be useful.

  • issue of extract XMLType column

    my xml looks like one below, I am able to get the value of @emp-type using as described below, but not able to get @depName

    declare

    xmlDoc xmltype: = XMLTYPE. CREATEXML ("<?") XML version = "1.0" encoding ="UTF - 8"? >

    < comp: emp - def xmlns:comp = "some.namespace.uri" >

    < comp: def >

    < comp: emp-spec type emp = 'Manager' >

    < comp: spec xsi: Nil = "true" xmlns:xsi="some.namespace.uri"/ >

    < / model: emp-spec >

    < comp: emp-att-spec >

    a model of < comp: cond > < / model: cond >

    < comp: emp - det depName 'BUY' = age rank = "8" = "" / >

    < / model: emp-att-spec >

    < / model: def >

    (< / model: emp - def > ');

    RES varchar2 (300);

    Start

    ("Select extractvalue (xmldoc,'/comp:emp-def/comp:def/comp:emp-spec/comp:emp-att-spec/comp:cond/comp:emp-det/ @depName xmlns:comp ="some.namespace.uri"," "")

    in res

    Double;

    dbms_output.put_line('res...');

    dbms_output.put_line (res);

    end;

    ExtractValue (and xmlsequence) are deprecated XML features.

    To retrieve XML using SQLX data use XMLTABLE or XMLQUERY with XQuery expressions, as...

    SQL > ed
    A written file afiedt.buf

    1 with t as (select XMLTYPE ('))
    2
    3
    4
    5
    6

    7
    8 dummy
    9
    10

    11

    12
    ') in the XML of the double)
    13-
    14. end of test data
    15-
    16. Select x.*
    17 t
    18, xmltable (xmlnamespaces (' ' a few .uri .namespace ' like 'comp'),)
    19 ' computer: emp - def / model: def'
    20 passage t.xml
    path of 21 columns emp_type varchar2 (10) '. / comp:emp-spec/@emp-type'
    22 road of varchar2 (10) cond '. / model: emp-att-spec / model: cond'
    23 road of varchar2 (10) of depName '. / comp:emp-att-spec/comp:emp-det/@depName'
    24, path number rank '. / comp:emp-att-spec/comp:emp-det/@grade'
    25 road number age '. / comp:emp-att-spec/comp:emp-det/@age'
    26*                ) x
    SQL > /.

    EMP_TYPE COND. DEPNAME AGE GRADE
    ---------- ---------- ---------- ---------- ----------
    dummy Manager PURCHASE 8

    Note: I assume this model: def is the repeating group in this example.  If that contains other repeating groups while he would need other XMLTABLE expressions with a passerby content repetition across groups to effectively create a Cartesian results product.

  • How to get a list of the methods and functions to use in the Transformation

    I am developing a transformation to apply the schema of a table in the relational model according to its type of classification. I was able to do this, but I have a doubt, in other words, how get the name of the first additional classification type, listed in the dropdown list of "Selected" of the "additional part" of the section "Types of Classification" of the table "Properties".

    This is the code that I'm working on:

    tables = model.getTableSet () .toArray ();

    for (var t = 0; t < tables.length; t ++) {}

    table = table [t];

    rating = table.getAdditionalClassificationTypes () .toArray ();

    SchemaName = ";

    {if (rating. Length = 0)}

    SchemaName = table.getClassificationType ();

    } else {}

    for (var s = 0; s < classif.length; s + +) {}

    {if (rating [s]! = table.getClassificationType ())}

    SchemaName = rating [s];

    }

    }

    }

    table.setSchema (schemaname);

    }

    The problem lies on the fact that I am able to get the ID of the Type of ranking, but not it's name...

    I was wondering if there is some document that lists the methods, functions, and namespaces that I could use in Data Modeler?

    Thanks in advance

    Wolf Goebel

    Wolf Hello,

    You can find the description of the API in the following directory:

    \datamodeler\datamodeler\xmlmetadata\doc

    Best regards

    Joop

Maybe you are looking for

  • My done printer a horrible, loud clicking noise when I click on print

    All-in-one printer, HP Deskjet F4480: my printer is a horrible, loud clicking (3-5 clicks) of noise, just at the time when I click on print.  Once it starts the print cycle, the noise disappears.  The paper version is fine.  There is no paper jam, an

  • Toshiba Satellite U500 overheating on Linux

    Hello. I just installed Fedora 15 on a Toshiba U500 and I noticed that it is very hot - the cpu temperature gets quickly to 80 C + and past often more than 90 c (then just pulled the fan in a few seconds).I installed lm-sensors and sensors - detect r

  • Guide: replace the HDD with SSD, Lenovo Y480

    LenovoThat's how I replaced my HDD with a SSD in my Lenovo Y480. I did it immediately, so there is no user file to consider. I used a key from Lenovo recovery. Read this guide in its entirety before starting. Execution time: about an hour. Items, you

  • drive CD/dvd 39 error

    I have a brand new HP 310-1125Y everything in a TouchSmart PC. Place a CD in the drive and nothing happens after loading. I went to Device Manager and it shows that the CD player is pilot error 39. I did a search of update and the system of all the d

  • XP Home Edition - Remote desktop

    I know that this isn't a feature with this particular operating system, but everyone was able to make it work? Use remote to access corporate internal terminal server desktop.  Do I have any options?