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;

Tags: Database

Similar Questions

  • The results in the debugger do not correspond with the result in the xml output is spent OPA


    Hello

    I use the OPM Version 10.4.6. I am facing a problem where I have a result field which is calculated by OPM in session of the debugger gives the correct result. While the same field has a different value in the output xml file passed from OPA to another system. Please give some advice on above question.

    Kind regards

    Mounia

    Sorry, I did not respond earlier. Do you have a support call opened in this regard, otherwise there is someone who has a very similar problem.

    I answered internally on this and the problem seems to be that of mathematical accuracy and very low values, which are then compared with zero. The debugger uses a .net implementation that can give slightly different numerical values at the extremes. I think that your rules would benefit from a degree of rounding applied before you test for equality with anything. Note the type of value that I've seen is 4-16

    I have provided more information to Schneider, who also provided a (Simplified) modules and some sample data.

    The debugger uses essentially the same engine of determinations and in general, you will see exactly the same result except that you've discovered to some extremely small numbers. In your case even if the value is 4-16 in the debugger and 0 in the API (or vice versa) the effect that has on the logic is that a single value is zero, so that the other does not which translates an extra 1000 added and results of 1000 and 2000 respectively.

    Concerning

    Ian

  • Change the namespace in the XML document in PLSQL

    Hi friends,

    by creating an XML namespace, I used a query as below

    SELECT ' <? XML version = "1.0" encoding = "UTF-8" standalone = "yes"? > '

    || () XMLSERIALIZE

    (XMLELEMENT) DOCUMENT

    "DeriveCoverageRequest,"

    XmlAttributes)

    "urn: xyz:ccw:config:common: data ' AS 'xmlns '.

    ("urn: xyz:ccw:config:msa: data ' AS 'xmlns:ns1'),

    (l_xmltype) AS CLOB)

    its working fine. But... There are no changes in ie.

    DeriveCoverageRequest should be like "ns1:DeriveCoverageRequest".

    I modified the code as

    SELECT ' <? XML version = "1.0" encoding = "UTF-8" standalone = "yes"? > '

    || () XMLSERIALIZE

    (XMLELEMENT) DOCUMENT

    "ns1:DeriveCoverageRequest,"

    XmlAttributes)

    "urn: xyz:ccw:config:common: data ' AS 'xmlns '.

    ("urn: xyz:ccw:config:msa: data ' AS 'xmlns:ns1'),

    (l_xmltype) AS CLOB)

    but his mistake to launch.

    Please help out to as below

    < ns1:DeriveCoverageRequest xmlns = "urn: xxx:ccw:config:common: data" xmlns:ns1 = "urn: xxx:ccw:config:msa: data" >

    Thanks in advance.

    Arun

    BTW, 10.2, you can make use of XMLROOT, no necessary concatenation... (and no risk of implicit conversion of character)

    SELECT XMLSERIALIZE ( DOCUMENT xmlroot
                                  (XMLELEMENT (
                                   "ns1:DeriveCoverageRequest",
                                   xmlattributes (
                                      'urn:cisco:ccw:config:common:data' AS "xmlns",
                                      'urn:cisco:ccw:config:msa:data' AS "xmlns:ns1"),
                                   dummy)
                                   , VERSION '1.0', STANDALONE YES
                                   )
                                   AS CLOB)
    from dual;   
    
    X
    
  • extraction of xmltype table in the xml output: redundant nodes

    Hi guys - see example below.  (edit: Sorry, did not use these forums for a while and can't seem to understand how to format the code...)

    [code] SQL > select *.

    the v version $2;

    BANNER

    --------------------------------------------------------------------------------

    Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production

    PL/SQL Release 11.2.0.4.0 - Production

    CORE Production 11.2.0.4.0

    AMT for Linux: Version 11.2.0.4.0 - Production

    NLSRTL Version 11.2.0.4.0 - Production

    [/ code]

    [/ code]

    SQL > create table mytesttable (item_id issue, x_data xmltype);

    Table created.

    SQL >

    SQL > insert into mytesttable

    2 with dat (select ' blah' point of double

    3 Union all the

    4 Select "blah" more than double)

    5, t as (select xmlelement ("x_data"

    6, xmlattributes (1 as "dummyattr")

    7, xmlagg (xmlelement ("item"

    8                                                ,item))

    9                              ) x_data

    10 dat

    11              )

    12. Select 1, x_data

    13 t;

    1 line of creation.

    SQL >

    SQL > select *.

    2 of mytesttable;

    ITEM_ID

    ----------

    X_DATA

    ---------------------------------------------------------------------------------------------

    -------

    1

    < x_data dummyattr = "1" >

    < item > blah < / item >

    < element > more blah < / item >

    < / x_data >

    1 selected line.

    SQL >

    SQL > select xmlelement ("outerelement"

    2, xmlelement ("itemID", item_id)

    3, xmlelement ("x_data", x_data)

    4                   )

    5 mytesttable;

    XMLELEMENT ("OUTERELEMENT", XMLELEMENT("ITEMID",ITEM_ID), XMLELEMENT("X_DATA",X_DATA))

    ---------------------------------------------------------------------------------------------

    -------

    < outerelement > < itemID > 1 < / itemID > < x_data > < x_data dummyattr = "1" >

    < item > blah < / item >

    < element > more blah < / item >

    < / x_data >

    < / x_data > < / outerelement >

    1 selected line.

    [/ code]

    Like the above, I have an xmltype in a table that has other non-xmltype columns.   I have a requirement to extract them out in a single xml document in a manner similar to the last SQL it.

    the problem is that if I do it according to the foregoing, I add a redundant node artificially.  the first node < x_data > is not necessary, but how can I go and add the xmltype column to the result without having to qualify it with another element around it?

    know how to do the following:

    < outerelement > < itemID > 1 < / itemID > < x_data dummyattr = "1" >

    < item > blah < / item >

    < element > more blah < / item >

    < / x_data > < / outerelement >

    ?

    Too bad... I had a moment mute:

    Select xmlelement ("outerelement"

    xmlelement ("itemID", item_id)

    x_data

    )

    of mytesttable;

  • to the xml output

    I am sql developer 10g version.
    now, I want to see released in Formate of xml...

    the syntex below does not can not someone help?


    Select * from employees for xml auto;

    I answered this last week, but it seems to have been deleted for some reason any.

    Discover the DBMS_XMLGEN package:

    Select dbms_xmlgen.getxml ("select * from employees where rownum")< 6')="" xml="" from="">

    is the equivalent of your example.

  • Ddeleting the second tag line in the XML output

    Hi all

    When I run the following query:

    Select dbms_xmlgen.getxml ("select wo.work_order_no,
    cursor (select regacc.work_order_no, regacc.work_order_task_no, regacc.regulatory_account_no
    of sa_work_orde_reg regacc
    where regacc.work_order_no = wo.work_order_no) Reg_Test
    of sa_work_order wo') xml
    Double;

    I get the following result:

    <? XML version = "1.0"? >
    rowset <>
    < ROW >
    < WORK_ORDER_NO > 1000170 < / WORK_ORDER_NO >
    < REG_TEST >
    < REG_TEST_ROW >
    < WORK_ORDER_NO > 1000170 < / WORK_ORDER_NO >
    < WORK_ORDER_TASK_NO > 01 < / WORK_ORDER_TASK_NO >
    < REGULATORY_ACCOUNT_NO > 100.2.1 < / REGULATORY_ACCOUNT_NO >
    < / REG_TEST_ROW >
    < / REG_TEST >
    < / ROW >
    < / LINES >

    Now what I need, is remove the second line tag < REG_TEST_ROW >. Y at - it a function or other ways to handle this. I'll use this query in the API of DBMS_XMLGEN.newcontext inside my procedure.

    Thank you for your help in advance.

    Published by: user33333 on June 29, 2010 01:11

    Published by: user33333 on June 29, 2010 01:19

    Hello

    Here are a few options...

    (1) using a scalar subquery rather than the CURSOR constructor (as long as it's supposed to always return a single line):

    SELECT dbms_xmlgen.getxml(
    'SELECT wo.work_order_no,
            ( SELECT XMLForest( regacc.work_order_no,
                                regacc.work_order_task_no,
                                regacc.regulatory_account_no )
              FROM sa_work_orde_reg regacc
              WHERE regacc.work_order_no = wo.work_order_no ) reg_test
    FROM sa_work_order wo'
    ) xml
    FROM dual;
    

    (2) incorporating a XSL transformation (Yes, still!) to copy all nodes except REG_TEST_ROW:

    
    
    
     
      
     
    
    
    
    
    
    

    (3) with the help of a simple replacement out serialized.

  • Adding namespace in the tag for each group

    I want to use the substring method in tag for each group.
    Like this: <? for-each - group: current - group (); xdofx:substr(xmlTag,3)? >, but it does not work. How to make it work?
    Thank you.

    Just use the native method of substring XSL - http://www.zvon.org/xxl/XSLTreference/Output/function_substring.html

    BEEP is sensitive when you mix native and OPE methods

    Tim

  • How to manage no data found in pdf format using the rtf output

    Hello

    In my rtf model, I have two frames - frame1 and frame2,

    These frameworks are based on the G1 group. Group G1 features of elements empid, empname

    My requirement is

    1. to return frame1 when the query (i.e. group G1) has given, this frame1 would print out the pdf of the report xml editor - correct work

    in the xml output, I saw that < LIST_G1 / > generates as below

    < LIST_G1 >

    < G1 >

    < EMPID > 1234 < / EMPID >

    JOHN < EMPNAME > < / EMPNAME >

    < G1 >

    < G1 >

    < EMPID > 1235 < / EMPID >

    BRAND of < EMPNAME > < / EMPNAME >

    < G1 >

    < G1 >

    < EMPID > 1236 < / EMPID >

    TONY < EMPNAME > < / EMPNAME >

    < G1 >

    < / LIST_G1 >

    2 return frame2 whenever the request (i.e. the group G1) has no data this frame2 output print pdf of the xml editor saying no report given - would not exist currently working.

    output is

    < LIST_G1 >

    < / LIST_G1 >

    (see there is no entry for < G1 > < / G1 > at all.)


    Now because of that, my frame1/frame2 who checks the value <? choose:? > <? When: County (G1). = 0 ? > out of the reutrning in the first case (as expected)

    but don't return do not all outputs in the 2nd case (his does not work as expected by me)


    Any pointers or help appreciated.


    Thanks in advance

    It solved using the IF ELSE block in the two frames, I'm back frame1 for the scenario IF count (G1) > 0 and return frame2 for another scenario.

  • IBY_FD_PAYMENT_FORMAT_TEXT xml output

    Hello

    IBY_FD_PAYMENT_FORMAT_TEXT used to always save the XML output, generally as follows:

    ....

    No extract has been created beforehand. Create extract. Timestamp: Wed Mar 05 12:42:20 WST 2014

    Size of the product extract - doc::590376

    After create extract, extract is not null.

    Check-in first 1 MB of generated excerpt below:

    ==================

    <? XML version = "1.0" encoding = "UTF-8"? > < OutboundPaymentInstruction...

    After application of a number of CPP (17167654 & 17176017), the XML is no longer registered in the log file.  The log looks like:

    ...

    No extract has been created beforehand. Create extract. Timestamp: Kills Mar 04 15:59:21 WST 2014

    Size of the product extract - doc::23158

    After create extract, extract is not null.

    Start formatting. Timestamp: Kills Mar 04 15:59:25 WST 2014

    Before formatting: Timestamp: kills Mar 04 15:59:25 WST 2014

    Model type: ETEXT

    ...

    Anyone would offer any suggestion as to how restore us this connected XML functionality?

    Thank you

    Hello

    This change was due to a fix implemented in bug 11828195. They have limited xml extracts to be included in the payment format logs instructions when FND 'Statement' debug level is ONE, then the section of code that primts the xml extracted for the log file is included when the FDFormatProgramUtils.java file is version 120.35.12010000.34 or 12.0.x, version 120.30.12000000.39 and more.

    You can still see, but you will need to turn on statement-level debugging.

    Cheryl

  • How the XML element used in RTF PUBLIC/PRIVATE? I know how to hide columns in RTF, but do not know how to generate xml below way. Help, please.

    Hello

    I'm following link below to show/hide my columns dynamically. See "formatting of column.

    http://docs.Oracle.com/CD/E12844_01/doc/BIP.1013/e12187.PDF

    According to the doc element can be made in private/public.

    <items type="PUBLIC">
     <item>
      <name>Plasma TV</name>
      <quantity>10</quantity>
      <price>4000</price>
     </item>
     <item>
    

    And even can be used to hide the column with the help of State

    <?if@column:/items/@type="PUBLIC"?>
    

    MY QUESTION IS HOW TO DO THIS IN MY XML BELOW?

    Here's the part of my XML code that I use in the definition of the data to RTF.

    <group name="GH3" source="QH3">
    <element name="COLUMN_HEAD3" value="COLUMN_NAME" /> 
    </group>
    <group name="GH4" source="QH4">
    <element name="COLUMN_HEAD4" value="COLUMN_NAME" /> 
    </group>
    

    I'm out like that.

    <LIST_GH3>
    <GH3>
    <COLUMN_HEAD3>REBILL_TO_OTHER_BUSINESS_UNIT</COLUMN_HEAD3>
    </GH3>
    </LIST_GH3>
    <LIST_GH4>
    <GH4>
    <COLUMN_HEAD4>XYZ</COLUMN_HEAD4>
    </GH4>
    </LIST_GH4>
    

    In order to use the logic according to the oracle document I want output like this.

    <LIST_GH3 type="PUBLIC">
    <GH3>
    <COLUMN_HEAD3>REBILL_TO_OTHER_BUSINESS_UNIT</COLUMN_HEAD3>
    </GH3>
    </LIST_GH3>
    <LIST_GH4 type="PRIVATE">
    <GH4>
    <COLUMN_HEAD4>BLANK</COLUMN_HEAD4>
    </GH4>
    </LIST_GH4>
    

    Should what changes I make in my XML to get the result of the execution as above? Help, please. Where should I make changes in the XML above? Name of the Group? Name of the element?

    I intend to use it under condition in RTF model to hide the column, but do not know how to set the column as PRIVATE/PUBLIC type in the XML output that is used to populate the data in the RTF while running.

    <?if@column:/BTSPIEXP/LIST_GH3/@type=”PUBLIC”?>COLUMN_HEAD3<?end if?>
    

    Kind regards

    Patricia K.

    Hello

    Problem has been resolved. I used the value of the item to determine whether to show it.

    Kind regards

    Patricia K.

  • Questions of EXCEL output in the XML editor logo

    Hello

    We use the Publisher XML API to generate PDFS, EXCEL returns by using the template. When adding image for the model of its display in the output pdf file. But not in Excel output projection. Then I added url: {/ Image} in the text of the image in the template and submitted the report again now able to see the image output to excel. Can you please tell me why his does not display not not the picture in excel by default which is the line that goes in the case of PDF. IAM getting the same question for HTML output generation also. Please tell me what I can do to get the image by default identical to the way I'm in PDF format.

    Thank you
    Satya

    for the xml editor:
    How to determine the Version of the Publisher Oracle XML to Oracle E-Business Suite 11i and Release 12 [362496.1 ID]

    >
    To resolve this problem, we need to make manual configuration image as menioned in the document 736897.1?
    >
    It is based on your report and your needs

    It's may be:
    -OA_MEDIA and url as the url: {' ${OA_MEDIA} / your_image'}
    -URLs as interface http as url: {'http://www.servernews.ru/assets/images/articles/594131/OracleLogo.jpg'}
    -logo by submodel

    then you can try the logo by OA_MEDIA

  • Avoid namespace in the output.

    Hello

    I am using a transformation to eliminate one of the attributes 'ErrorMessage' < PersonImage > with the help of an "if" condition Refer to OTN: XML attribute hiding if there is no data/value

    I get a result as follows:

    ----------
    < outputVariable >
    -< part xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" name = "payload" >
    -< response xmlns = "http://xmlns.monash.edu.au/its/rms/ImageProcessResponse" >

    -< Summary >
    -< total >
    < transformed > 4 < / transformed >
    < defective > 0 < / defective >
    < successful > 4 < / successful >
    -< Server1 Machine = "1" Name = "Basil1" >
    < successful > 4 < / successful >
    < failed > 0 < / failure >
    < / Server1 >
    -< Server2 Machine = "2" Name = "Basil2" >
    < successful > 4 < / successful >
    < failed > 0 < / failure >
    < / Server2 >
    < / total >
    < terminate / >
    < / Summary >
    -< detail >
    -< PersonImage >
    "< rms:PersonImage ID ="12410276"FileName ="12410276.jpg"Fetched =" Y "S1 = S2" Y' = 'Y' xmlns:rms = "http://xmlns.monash.edu.au/its/rms/ImageProcessResponse" / > "
    "< rms:PersonImage ID ="12620203"FileName ="12620203.jpg"Fetched =" Y "S1 = S2" Y' = 'Y' xmlns:rms = "http://xmlns.monash.edu.au/its/rms/ImageProcessResponse" / > "
    "< rms:PersonImage ID ="12790974"FileName ="12790974.jpg"Fetched =" Y "S1 = S2" Y' = 'Y' xmlns:rms = "http://xmlns.monash.edu.au/its/rms/ImageProcessResponse" / > "
    "< rms:PersonImage ID ="12983233"FileName ="12983233.jpg"Fetched =" Y "S1 = S2" Y' = 'Y' xmlns:rms = "http://xmlns.monash.edu.au/its/rms/ImageProcessResponse" / > "
    < / PersonImage >
    < / details >
    < / answer >
    < / part >
    < / outputVariable >
    -----------

    But I'm unable to remove the namespace after each release of < PersonImage >. I wanted the output as follows:

    -----------
    < outputVariable >
    -< part xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" name = "payload" >
    -< response xmlns = "http://xmlns.monash.edu.au/its/rms/ImageProcessResponse" >

    -< Summary >
    -< total >
    < transformed > 4 < / transformed >
    < defective > 0 < / defective >
    < successful > 4 < / successful >
    -< Server1 Machine = "1" Name = "Basil1" >
    < successful > 4 < / successful >
    < failed > 0 < / failure >
    < / Server1 >
    -< Server2 Machine = "2" Name = "Basil2" >
    < successful > 4 < / successful >
    < failed > 0 < / failure >
    < / Server2 >
    < / total >
    < terminate / >
    < / Summary >
    -< detail >
    -< PersonImage >
    "< rms:PersonImage ID ="12410276"FileName ="12410276.jpg"recovered =" Y "S1 = S2" Y"="Y"/ >"
    "< rms:PersonImage ID ="12620203"FileName ="12620203.jpg"recovered =" Y "S1 = S2" Y"="Y"/ >"
    "< rms:PersonImage ID ="12790974"FileName ="12790974.jpg"recovered =" Y "S1 = S2" Y"="Y"/ >"
    "< rms:PersonImage ID ="12983233"FileName ="12983233.jpg"recovered =" Y "S1 = S2" Y"="Y"/ >"
    < / PersonImage >
    < / details >
    < / answer >
    < / part >
    < / outputVariable >

    -----------

    Very much appreciate your help with this.


    Thank you and best regards,
    Rakesh

    You are syaing that you want to remove the definition of namesspace, but keep the namespace alias in the XML file. This translates namespace not valid. I shouyld keep this, it's XML messages valid. The request of the appellant to be aligend to XML standards, you should change.

    BTW:

    http://orasoa.blogspot.com/2008/12/remove-namespaces-in-OSB-and-bpelesb.html

    Marc

  • The simultaneous output file is XML if the result of the Template is set to Excel. Why?

    Hello

    A simultaneous program that I run is supposed to give the result in the form of an Excel spreadsheet.

    The model has the default output Type: Excel. And the output format of simultaneous program: XML.

    Currently, it returns the output as XML data in the definition of data in a new tab in the browser. What should I check to make sure that the Excel output is obtained and that the model is obtained as a result

    PS: Using the model for WORD generator plugin. And apply the XML obtained my rtf file-> I get the expected result. Overview: PDF

    Why it does not work using the simultaneous program?

    Thank you in advance,

    ATP

    Answer: I solved the above problem by using the following steps.

    The part of the publication of the log file is missing. Once this has been noticed a the OPP service log gave more details. There was a certain Ref that wasn't.
    So returned to watch the RTF, since it was the breaking point, and it has been identified.

    It details of the agenda were not visible without loading an XML. When I double click on without load the XML file I got an error "compiler error. Hidden module Module_EditFF... »

    After searching on Google, the answer was clear: Oracle Applications: in the hidden module compilation error: Module_editFF in Oracle BI Publisher

    My BI editor caused me trouble in the last days and sanitation of and re - install it works like a charm.

    Problem solved. Loaded my RTF using the new organization. Double click on the field element and set the details I wanted by using the 'Add a text to help..' button and using the bar of tabs 'State' and the (F1) Key "help".

    Reloaded the model ran simultaneous program ==> Excel output.

    Voila!

  • building XPath with the XML with the Namespace using PL SQL

    All trying to build the path to each node, when the XML code with no namespace, the following code works very well provide the result

    1 ~/

    2 ~ /Person/

    3 ~ /Person/ âge /

    4 ~ /Person/ homecity /

    5 ~ /Person/ nom /

    6 ~ /Person/ AccueilGuides/lat /

    7 ~ /Person/ AccueilGuides/name /

    8 ~ /Person/ homecity / long /

    But when the XML is changed to

    <person xmlns="urn:person" xmlns:lat="urn:lat">
    <name>Rob</name>
    <age>37</age>
    <homecity>
        <name>London</name>
        <lat>123.000</lat>
        <long>0.00</long>
    </homecity>
    </person>"

    The result of the code below the performance translates into just below result

    1~/
     2~/person/

    In the XML file above, XML namespace is not constant and varies for each XML. My requirement is to analyze the complete XML code, where I can read the XML with namespace and get the result that is mentioned below

    1~/
    2~/person/
    3~/person/age/
    4~/person/homecity/
    5~/person/name/
    6~/person/homecity/lat:lat/
    7~/person/homecity/name/
    8~/person/homecity/long/

    Can you please help me solve the issue mentioned. Thanks in advance. -Code snippet below:

    DECLARE
      l_File VARCHAR2(32000) := '<person>
    <name>Rob</name>
    <age>37</age>
    <homecity>
        <name>London</name>
        <lat>123.000</lat>
        <long>0.00</long>
    </homecity>
    </person>';
     
     l_Where_Clause VARCHAR2(100) := '/*';
     l_Append_Var   VARCHAR2(100) := '/';
     
     TYPE Ty_Paths IS TABLE OF VARCHAR2(1000) INDEX BY PLS_INTEGER;
     l_Ty_Paths      Ty_Paths;
     l_Ty_Paths_Temp Ty_Paths;
     
     TYPE Ty_Verifier IS TABLE OF VARCHAR2(1000) INDEX BY VARCHAR2(1000);
     l_Ty_Varifier Ty_Verifier;
     
    l_Prev_Query_Rec VARCHAR2(100);
    l_Index_Num      NUMBER := 0;
    l_Cur_Exec_Row   NUMBER := 0;
    BEGIN
     l_Ty_Paths(Nvl(l_Ty_Paths.COUNT, 0) + 1) := l_Append_Var;
     l_Cur_Exec_Row := 1;
     
     --Dbms_Output.put_line('Before entering the loop');
     
     LOOP
       l_Ty_Paths_Temp.DELETE;
      SELECT DISTINCT REPLACE(l_Append_Var || '/' || t.Xml || '/', '//', '/') BULK COLLECT
       INTO   l_Ty_Paths_Temp
      FROM   (SELECT Xmltype(Extract(VALUE(e), '/').Getstringval()) .Getrootelement() AS Xml
               FROM   TABLE(Xmlsequence(Extract(Xmltype(l_File), l_Where_Clause))) e) t;
     
      l_Ty_Varifier(Nvl(l_Ty_Varifier.COUNT, 0) + 1) := l_Append_Var;
      --Dbms_Output.put_line('L_TY_PATHS_TEMP.Count::'||L_TY_PATHS_TEMP.Count);
      IF l_Ty_Paths_Temp.COUNT > 0 THEN
         l_Index_Num := Nvl(l_Ty_Paths.COUNT, 0) + 1;
         FOR i IN l_Ty_Paths_Temp.FIRST .. l_Ty_Paths_Temp.LAST LOOP
            l_Ty_Paths(l_Index_Num) := l_Ty_Paths_Temp(i);
            --Dbms_Output.put_line('L_INDEX_NUM::'||L_INDEX_NUM);
            --Dbms_Output.put_line('L_TY_PATHS(L_INDEX_NUM)::'||L_TY_PATHS(L_INDEX_NUM));
            l_Index_Num := l_Index_Num + 1;
         END LOOP;
      END IF;
      --Dbms_Output.put_line('L_TY_PATHS.Count::'||L_TY_PATHS.Count);
      --Dbms_Output.put_line('L_TY_PATHS.Count::'||L_CUR_EXEC_ROW);
     
      IF (NOT l_Ty_Paths.EXISTS(l_Cur_Exec_Row + 1)) OR (l_Cur_Exec_Row = l_Ty_Paths.COUNT) THEN
         --Dbms_Output.put_line('Exiting');
         EXIT;
      ELSE
         --Dbms_Output.put_line('Inside the Else part');
     
         l_Cur_Exec_Row := l_Cur_Exec_Row + 1;
         l_Append_Var   := l_Ty_Paths(l_Cur_Exec_Row);
         l_Where_Clause := l_Ty_Paths(l_Cur_Exec_Row) || '*';
      END IF;
     
      --To Display the record:
         --Dbms_Output.put_line(L_TY_PATHS.Count);
      END LOOP;
      IF l_Ty_Paths.COUNT > 0 THEN
        FOR i IN l_Ty_Paths.FIRST .. l_Ty_Paths.LAST LOOP
          Dbms_Output.Put_Line(i || ' record is ' || l_Ty_Paths(i));
       END LOOP;
     END IF;
     
    END;

    Thank you.

    If you have patterns, it may be easier to work directly on them.

    Here's the idea:

    (1) install "Oracle XML DB manageability Packages", available on the code page for the XML DB sample: http://download.oracle.com/otn/samplecode/xdb_util.zip

    This is a set of utilities which allows us to annotate the XML schemas, to deal with the underlying or storage structure, and (this is the interesting part here) a few views of dictionary to describe the relational XSD structure.

    (it is now an integrated 12 c btw)

    (2) enter these two schemas:

    Start

    () dbms_xmlschema.registerSchema

    schemaURL-online "pacs.002.001.03S2.xsd."

    schemaDoc-online xmltype (bfilename('TEST_DIR','pacs.002.001.03S2.xsd'), nls_charset_id ('AL32UTF8'))

    local-online true

    genTypes-online fake

    genTables-online fake

    enableHierarchy-online dbms_xmlschema. ENABLE_HIERARCHY_NONE

    options-online dbms_xmlschema. REGISTER_BINARYXML

    );

    end;

    /

    Start

    () dbms_xmlschema.registerSchema

    schemaURL-online "SCTCvfBlkCredTrf.xsd."

    schemaDoc-online xmltype (bfilename('TEST_DIR','SCTCvfBlkCredTrf.xsd'), nls_charset_id ('AL32UTF8'))

    local-online true

    genTypes-online fake

    genTables-online fake

    enableHierarchy-online dbms_xmlschema. ENABLE_HIERARCHY_NONE

    options-online dbms_xmlschema. REGISTER_BINARYXML

    );

    end;

    /

    (3) the following query built all the paths of node defined by the main schema (SCTCvfBlkCredTrf.xsd), as well as the namespaces:

    with schema_list (schema_url, schema_owner) as)

    Select 'SCTCvfBlkCredTrf.xsd', 'OTN' from dual

    Union of all the

    Select sd.dep_schema_url, sd.dep_schema_owner

    of schema_list sl

    Join dba_xml_schema_dependency on sd.schema_url = sl.schema_url sd

    and sd.schema_owner = sl.schema_owner

    ),

    namespace_mapping (target_namespace, prefix) as long as)

    Select target_namespace

    , « ns » || ROW_NUMBER() (order target_namespace) as a prefix

    of user_xml_schema_namespaces

    where schema_url in (select schema_url from schema_list)

    ),

    () schema_nodes

    is_attr

    node_name

    max_occurs

    element_id

    parent_element_id

    target_namespace

    schema_url

    ) as)

    Select 0

    element_name as node_name

    xmlcast)

    XMLQUERY ('/ XS: ELEMENT / ' @maxOccurs passing returning content element)

    as varchar2 (10)

    )

    element_id

    parent_element_id

    target_namespace

    schema_url

    of user_xml_schema_elements

    where schema_url in (select schema_url from schema_list)

    Union of all the

    Select 1

    attribute_name as node_name

    null

    null

    element_id

    target_namespace

    schema_url

    of user_xml_schema_attributes

    where schema_url in (select schema_url from schema_list)

    )

    Select the level

    sn.node_name

    sn.max_occurs

    connect_by_isleaf as is_leaf

    sys_connect_by_path)

    -case when ns.prefix is not null and is_attr = 0 then ns.prefix | ':' end |

    -case when sn.is_attr = 1 then ' @' end |

    SN. NODE_NAME

    , '/'

    ) as xpath

    -, target_namespace

    of schema_nodes sn

    outer join ns namespace_mapping let ns.target_namespace = sn.target_namespace

    Connect prior sn.element_id = sn.parent_element_id

    Start with sn.schema_url = "SCTCvfBlkCredTrf.xsd".

    and sn.parent_element_id is null

    ;

    LEVEL MAX_OCCURS IS_LEAF XPATH NODE_NAME
    ----- ------------------ ---------- ------- ----------------------------------------------------------------------------------------------------------
    1 SCTCvfBlkCredTrf 0 /ns2:SCTCvfBlkCredTrf
    2 1 SndgInst /ns2:SCTCvfBlkCredTrf / ns2:SndgInst
    2 1 RcvgInst /ns2:SCTCvfBlkCredTrf / ns2:RcvgInst
    2 1 SrvcId /ns2:SCTCvfBlkCredTrf / ns2:SrvcId
    2 1 TstCode /ns2:SCTCvfBlkCredTrf / ns2:TstCode
    2 FType 1 /ns2:SCTCvfBlkCredTrf / ns2:FType
    2 FileRef 1 /ns2:SCTCvfBlkCredTrf / ns2:FileRef
    2 1 FileDtTm /ns2:SCTCvfBlkCredTrf / ns2:FileDtTm
    2 1 OrigFRef /ns2:SCTCvfBlkCredTrf / ns2:OrigFRef
    2 1 OrigFName /ns2:SCTCvfBlkCredTrf / ns2:OrigFName
    2 1 OrigDtTm /ns2:SCTCvfBlkCredTrf / ns2:OrigDtTm
    2 1 FileRjctRsn /ns2:SCTCvfBlkCredTrf / ns2:FileRjctRsn
    2 1 FileBusDt /ns2:SCTCvfBlkCredTrf / ns2:FileBusDt
    2 1 FileCycleNo /ns2:SCTCvfBlkCredTrf / ns2:FileCycleNo
    2 FIToFIPmtStsRptS2 1 /ns2:SCTCvfBlkCredTrf 0 / ns2:FIToFIPmtStsRptS2
    3 GrpHdr 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:GrpHdr
    4 MsgId 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:GrpHdr / ns1:MsgId
    4 CreDtTm 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:GrpHdr / ns1:CreDtTm
    4 InstgAgt 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:GrpHdr / ns1:InstgAgt
    5 FinInstnId 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:GrpHdr / ns1:InstgAgt / ns1:FinInstnId
    6 BIC 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:GrpHdr / ns1:InstgAgt / ns1:FinInstnId / ns1:BIC
    3 OrgnlGrpInfAndSts 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts
    4 OrgnlMsgId 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:OrgnlMsgId
    4 OrgnlMsgNmId 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:OrgnlMsgNmId
    4 OrgnlNbOfTxs 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:OrgnlNbOfTxs
    4 OrgnlCtrlSum 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:OrgnlCtrlSum
    4 GrpSts 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:GrpSts
    4 StsRsnInf 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf
    5 Orgtr 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf / ns1:Orgtr
    6 id 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf / ns1:Orgtr / ns1:Id
    7 OrgId 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf / ns1:Orgtr / ns1:Id / ns1:OrgId
    8 1 BICOrBEI /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf / ns1:Orgtr / ns1:Id / ns1:OrgId / ns1:BICOrBEI
    5 ARS 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf / ns1:Rsn
    6 Cd 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf / ns1:Rsn / ns1:Cd
    6 Prtry 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf / ns1:Rsn / ns1:Prtry
    4 NbOfTxsPerSts 2 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:NbOfTxsPerSts
    5 1 DtldNbOfTxs /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:NbOfTxsPerSts / ns1:DtldNbOfTxs
    5 1 DtldSts /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:NbOfTxsPerSts / ns1:DtldSts
    5 1 DtldCtrlSum /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:NbOfTxsPerSts / ns1:DtldCtrlSum
    3 TxInfAndSts boundless 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts
    4 StsId 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsId
    4 OrgnlInstrId 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlInstrId
    4 OrgnlEndToEndId 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlEndToEndId
    4 OrgnlTxId 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxId
    4 TxSts 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:TxSts
    4 StsRsnInf 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf
    5 Orgtr 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf / ns1:Orgtr
    6 id 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf / ns1:Orgtr / ns1:Id
    7 OrgId 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf / ns1:Orgtr / ns1:Id / ns1:OrgId
    8 1 BICOrBEI /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf / ns1:Orgtr / ns1:Id / ns1:OrgId / ns1:BICOrBEI
    5 ARS 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf / ns1:Rsn
    6 Cd 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf / ns1:Rsn / ns1:Cd
    6 Prtry 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf / ns1:Rsn / ns1:Prtry
    4 InstdAgt 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:InstdAgt
    5 FinInstnId 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:InstdAgt / ns1:FinInstnId
    6 BIC 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:InstdAgt / ns1:FinInstnId / ns1:BIC
    4 OrgnlTxRef 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef
    5 IntrBkSttlmAmt 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:IntrBkSttlmAmt
    CTL 6 1 /ns2:SCTCvfBlkCredTrf/ns2:FIToFIPmtStsRptS2/ns1:TxInfAndSts/ns1:OrgnlTxRef/ns1:IntrBkSttlmAmt/@Ccy
    5 1 IntrBkSttlmDt /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:IntrBkSttlmDt
    5 DbtrAgt 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:DbtrAgt
    6 FinInstnId 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:DbtrAgt / ns1:FinInstnId
    7 1 BIC /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:DbtrAgt / ns1:FinInstnId / ns1:BIC
    5 CdtrAgt 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:CdtrAgt
    6 FinInstnId 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:CdtrAgt / ns1:FinInstnId
    7 1 BIC /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:CdtrAgt / ns1:FinInstnId / ns1:BIC

    In fact, you would be generally extracted from mapping data in a separate query so that you can use it to build the dynamic with XMLNamespaces clause of the namespace.

    NB1: Also note that not all roads are needed, only those which IS_LEAF = 1 or MAX_OCCURS = "unlimited" or MAX_OCCURS > '1', then you can add a filter predicate in the query directly.

    NB2: The query does support all the features of XSD, for example, I've relied on the default behavior for attributes 'element_form_default' and 'attribute_form_default '.

  • How to extract the XML with namespace?

    Hi all

    Here's the XML I:

    <? XML version = "1.0" encoding = "UTF-8"? >
    -< transaction xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns = "http://schemas.test.com/Support/Services/test1/2012" xsi: schemaLocation = "http://schemas.test.com/Support/Services/test1/2012 Support.test1.v1.xsd" >
    -< application >
    < > 10 Sam < / Sam >
    < > 32 Actid < / Actid >
    < Pax > 3 < / Pax >
    < > 10 - DEC - 2012 Flt < / Flt >
    < user name > WebUserNameTest < / name >
    < / request >
    < application >
    < Sam > 1 < / Sam >
    < Actid > 3 < / Actid >
    < > 2 Pax < / Pax >
    < Flt > 2012 - dec - 12 < / Flt >
    < user name > WebUserNameTest < / name >
    < / request >
    < / transaction >

    I need to extract the item values:

    The code below will help me when I have no namespace, what needs to be done in order to work with the value of the element namespace and etract

    v_string_xml: =.
    ' / / Query [' |] To_char (counter_xml) | '] / Sam / text () ';
    v_ssp_table (v_ssp_table. COUNTY) .memid: =.
    p_xml_in. EXTRACT (v_string_xml) .getnumberval ();


    v_string_xml: =.
    ' / / Query [' |] To_char (counter_xml) | '] / Actid / text () ';
    v_ssp_table (v_ssp_table. COUNTY) .actid: =.
    p_xml_in. EXTRACT (v_string_xml) .getnumberval ();

    v_string_xml: =.
    ' / / Query [']
    || To_char (counter_xml)
    || '] / Pax / text () ';
    v_ssp_table (v_ssp_table..) Pax COUNT): =.
    p_xml_in. EXTRACT (v_string_xml) .getnumberval ();

    v_string_xml: =.
    ' / / Query [' |] To_char (counter_xml) | '] / Flt / text () ';
    v_ssp_table (v_ssp_table..) Flt COUNT): =.
    p_xml_in. EXTRACT (v_string_xml) .getstringval ();

    v_string_xml: =.
    ' / / Query [']
    || To_char (counter_xml)
    || '] / Username / text () ';
    v_ssp_table (v_ssp_table. COUNTY) .username: =.
    p_xml_in. EXTRACT (v_string_xml) .getstringval ();
    declare
      v_xml xmltype := xmltype( '
    
    
    10
    32
    3
    2012-DEC-10
    WebUserNameTest
    
    
    1
    3
    2
    2012-DEC-12
    WebUserNameTest
    
    ' );
    begin
      for r_xml in ( select *
                     from xmltable( xmlnamespaces( default 'http://schemas.test.com/Support/Services/test1/2012' )
                                   , '/Transaction/Request'
                                   passing v_xml
                                     columns memid number path 'Memid'
                                           , actid number path 'Actid'
                                           , pax number path 'Pax'
                                           , flt varchar2(100) path 'Flt'
                                           , username varchar2(100) path 'Username'
                                  )
                   )
      loop
        dbms_output.put_line( r_xml.memid );
        dbms_output.put_line( r_xml.actid );
        dbms_output.put_line( r_xml.pax );
        dbms_output.put_line( r_xml.flt );
        dbms_output.put_line( r_xml.username );
      end loop;
    end;
    

Maybe you are looking for

  • pages 5 file path

    Is there a way to find the path of a file of 5 Pages of somewhere in the application page to open itself?

  • No sound or release of the iPhone 4

    Lost all sound from my iPhone 4, has no ring others can not hear me I can't hear them, have tried resetting tried restoration have also updated to the latest update, nothing is on mute and sound turned up, also made the switch on the side is undefine

  • Try to use/install software camera Canon on WinXP Pro

    I have windows XP Professional on my computer and today installed software camera Canon IXUS117HS on it, unfortunately, whenever I connect the camera via the USB port it will fail to recognize the 'Canon Utilities CameraWindow DC' software to upload

  • Volume on the screen bar stopped showing

    on the screen volume bar Hello I have a Lenovo ThinkPad Edge laptop. The Volume bar on my screen stopped showing. How can I get that back?

  • Return a variable expansion

    Hello everyone. I want to return a variable of the extension, it is possible? What can be done of the extension? Thank you, best regards.