Extract XML - Namespace question

Hello
I try to extract a value from an xml element, but it does not work when I put the name space.
The following XML code:

<? XML version = "1.0" encoding = "UTF-8"? >
< nfeProc xmlns = "http://www.portalfiscal.inf.br/nfe" xmlns:ds = "http://www.w3.org/2000/09/xmldsig#" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" versão "1.10" = >
< NFe xmlns = "http://www.portalfiscal.inf.br/nfe" >
< infNFe Id = versão "1.10" = "NFe35100492754738007094550010000418641120612904" >
< ide >
< cUF > 35 < / cUF >
< cNF > 112061290 < / cNF >
< natOp > COMPRA PARA COMERCIALIZACAO DEVOLUCAO < / natOp >
< indPag > 0 < / indPag >
< mod > 55 < / mod >
< set > 1 < / series >
< naturist > 41864 < / naturist >
< a half > 2010 - 04 - 26 < / half >
< dSaiEnt > 2010 - 04 - 26 < / dSaiEnt >
< tpNF > 1 < / tpNF >
< cMunFG > 3548708 < / cMunFG >
< tpImp > 1 < / tpImp >
< tpEmis > 1 < / tpEmis >
< VAC > 4 < / cDV >
< tpAmb > 2 < / tpAmb >
< finNFe > 1 < / finNFe >
< procEmi > 0 < / procEmi >
< verProc > 1.0 < / verProc >
< / ide >
< / infNFe >
< / CHILD >
< / nfeProc >


But this XML file is a BLOB in a table that I converted to CLOB and after to XMLTYPE.
And here is the SQL code that I am trying to run:

Select extract (column_value,'cUF / text () ') AS 'XML ELEMENT.
of (xmltype (blob_to_clob (fl_l.file_data)) select media_data_clob)
of fnd_attached_documents fad_l
fnd_documents_tl fdt_l
fnd_lobs fl_l
where fad_l.document_id = fdt_l.document_id
and fdt_l.media_id = fl_l.file_id
and fdt_l.language = 'PTB '.
and fad_l.entity_name = 'NFe_iSupplier') myxml.
table (xmlsequence (Extract (media_data_clob, '//cUF'))) t;


Can someone help me?

Thank you!

Hello

You must add a namespace clause the extract() function.

table example (xmlsequence (extract (media_data_clob,'/ / EUC ',' xmlns = http://www.portalfiscal.inf.br/nfe')))

HTH,

Chris

Tags: Oracle Development

Similar Questions

  • Several files extracted Xml name

    Hi, I make a change in our DMS project that has the input XML to extract file.

    We used this guideline for configuring a flat file with all entry names XMLs.

    https://support.Oracle.com/CSP/main/article?cmd=show & type = not & DOCTYPE = HOWTO & ID = 871446.1

    the configuration works perfectly. Our flat file list of files and reads them OK.

    My question comes here, how can I get the NAME of THE XML FILE which is extracted at the present time? I can get the input file, but it's the flat file that contains all the names, not the XML itself.

    Hi Andres,

    I see two options off the top of my head:
    (1) includes the name of the XML file in the XML - I know, it's a simple solution, but sometimes they are the best :)
    (2) map the name to extract XML in a GVM - I'm not exactly sure that this would work, but it might be possible. I'll see if I can find.

    -Andy

  • FrameMaker-&gt; XML-&gt; FrameMaker questions

    Hello

    I have currently about 150 pages fm submits, that were originally unstructured, but I managed to make a structure of work for her. There are mainly paintings, which have references, images, graphics, tables and internal stuff, so all normal technical document. Reason I'm structuring it and what about XML is that we have another file XML where we will add data in this document, and currently, it is done by hand and we want to do it my machine. These things are done by the magic of programmers who can better c-related speaking in tongues English.

    I can make the XML of this fine, so that the XML that is created is valid and structure looks like, it is very well copied as XML. Graphics, images and internal tables are currently inside anchored like graphics frames, since they were something similar in the informal document and read/write rules that transform images EPS, because internal tables do not work like SVG, I prefer otherwise, because it is also the XML and anchored frames have some links referring to other parts of the document. SVG would be also easier to manage in programming (or so I think) as the EPS. If anyone can think of the best way to do this, I'm open to suggestions.

    Question now is when I opened this created XML in FrameMaker, it loads first half-hour (computer is Intel T2500 2 GHz, 2 GB of RAM, computer laptop XP Pro SP3 and FM is version 10), then displays the 9 error pages records concerning 'framemaker cannot insert table (cell) at the current position cell' and then document appears as 600 to 1000 pages 'masterpiece' where 150 pages seems normal but after this first page If displays of new and tables is presented as a column in the page. It was suggested that if the file is created by FrameMaker, FrameMaker it would open normally, but apparently this is not the case.

    Reading/writing-rules currently look like this: (if it is useful at all)

    {"Table" element

    is the table fm "Table" element

    }


    element {"TableHead"

    is the fm "TableHead" table header element

    }

    element {"TableBody"

    is part of fm "TableBody table body."

    }


    element {'Row'

    table fm line item is "Row".

    }

    element {'cell'

    is fm "Cell" table cell element

    }


    cross reference fm 'HRef' element's "HRef";


    element {'Row'

    is the element of row in table fm 'ROW '.

    }


    'Cell' is fm "CELL" table cell element


    element {"Graphic"

    is the graphic element of fm;

    writer anchored frame {}

    export to file ' $(entity) .eps "as"EPS ".

    specify the size in pt;

         }

    }


    element {"Equation"

    is fm equation element.

    export equation writer to file ' $(entity) .eps "as"EPS ".

    }

    There are some things that might look odd for some people. There are a few conditional text in FM submit and without rules as

    'Cell' is fm "CELL" table cell element

    XML is not valid against the DTD.

    I'd appreciate any help. I can also provide other files here, but due to NDA reasons, real document is no-go, but I think that if the structure is needed to see, the DTD is very good.

    Ian, Russ,

    As you probably know both, it is perfectly acceptable to have multiple rules read/write for a type of item. In this case, the rules include:

    element {'Row'

    table fm line item is "Row".

    }

    element {'Row'

    table fm line item is "ROW".

    }

    or

    element {'cell'

    is fm "Cell" table cell element

    }

    'Cell' is fm "CELL" table cell element

    The first pair of rules said FrameMaker when it creates XML, FrameMaker and PLACE items that both are output as an XML line items. The second pair of rules said the items FrameMaker and CELL are saved as XML as cell.

    When there are several relevant mappings, FrameMaker uses the first to appear in the rules of r/w. When is the reading of XML documents by using these rules, he could map a line XML line or LINE item and a cell to cell or CELL. Since mixed case of these two rules version appears before the version all uppercase, when reading XML, FrameMaker elements with the same name as the XML namespace it creates.

    Ejlamsa,

    Your FrameMaker EDD has both row and LINE (cell and CELL)? If this isn't the case, you can remove rules for the types of items you don't use.

    Insofar as the error messages and the wrong document when you open XML, Ian is quite correct that FrameMaker needs to know the number of columns there are in the table. If your DTD does not yet of this attribute, the simplest solution is to add a. It is possible using a plug-in or script to create columns as needed, but it's a lot more effort.

    -Lynne

  • Changed to aaa when exporting xml doc in AIR application XML namespaces

    When I export my xml in a Format of TimedText leave an AIR application, that I'm working on xml namespaces change to aaa instead of xml... anyone knows how to fix this or prevents the application to change arbitrarily.

    Another question, for some reason any code I have, as to the format now, won't let me not use the appendChild method to add my cuepoints to the FTT xml document.

    Any advice would be greatly appreciated.  My code is below:

    Create final XML

    private void submit (): void

    {

    If (boolVideoSelected is true)

    {

    xmlData =

    " < tt XML: lang ="fr"xmlns =" http://www.w3.org/2006/04/ttaf1 "xmlns:tts =" " http://www.w3.org/2006/04/ttaf1#styling ">

    < head >

    < style >

    < style id = '1' tts:textAlign = 'center' tts:backgroundColor = 'gray' tts:color = 'white' tts:fontSize = '14' 'product' = tts:fontFamily / >

    < / style >

    < / head >

    < body >

    < div XML: lang = "fr" style = "1" >

    < / div >

    < / body >

    < /tt >;

    var cue: XML;

    var strTempDuration:String;

    var strTempTime:String;

    var strTempContent:String;

    vidVideo.pause (); Break video

    btnPlay.label = ' > ';

    for (var i: int = 0; i < stateArray.length; i ++) //Convert stateArray in XML

    {

    strTempDuration = stateArray [i].duration.toString ();

    strTempTime = stateArray [i].time.toString ();

    strTempContent = stateArray [i].content.toString ();

    cue = < p starts hard = {strTempTime} = {strTempDuration} > //Generate {strTempContent} < /p > cue

    trace (XMLDATA);

    xmlData.body.div.appendChild (cue); Insert markers in XML in order

    }

    xmlFile = new file;

    xmlFile.browseForSave ("save the XML file"); Window open for save location

    Event listeners


    xmlFile.addEventListener (Event.SELECT, xmlFileSelectHandler);
    xmlFile.addEventListener (IOErrorEvent.IO_ERROR, ioHandler);
    xmlFile.addEventListener (SecurityErrorEvent.SECURITY_ERROR, securityHandler);
    }
    }

    private void xmlFileSelectHandler(e:Event):void {}
    var newFile:File = e.target as file;

    If (! newFile.extension | newFile.extension! = "xml") //Check .xml was included in the user's input
    {
    newFile.nativePath += ".xml"; Add .xml file name, if it was not included
    }

    var stream: FileStream = new FileStream();
    Stream.Open (newFile, FileMode.WRITE);
    stream.writeUTFBytes (xmlData.toString ()); Write the XML string in XML file
    Stream.Close ();
    }

    xmlData = http://www.w3.org/2006/04/ttaf1.

    xmlns: XML = ""http://www.w3.org/XML/1998/namespace"

    xmlns:TTS ="http://www.w3.org/2006/04/ttaf1#styling" >. "

  • Extract XML with xmlns duble truble, 9i database data

    Hello

    I have a problem extracting the data from the example:

    My xml file:
    <? XML version = "1.0" encoding = "UTF-8"? >
    < document xmlns = "http://www.crea.si/Schemas/2004/Document/ZbsXml" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schemaLocation = "http://www.crea.si/Schemas/2004/Document/ZbsXml ZbsCreaDoc.xsd" >
    < data >
    < DataFormat >
    text/xml, < MimeType > < / MimeType >
    < / DataFormat >
    < content >
    < EmbeddedData >
    < Paket xmlns = "http://www.zbs-giz.si/Schemas/2006/ZbsXml" >
    < VodilniZapis >
    < StevilkaRacuna > 00000000 < / StevilkaRacuna >
    < StevilkaPaketa > 0000 < / StevilkaPaketa >
    < DatumPaketa > 0000 - 00 - 00 < / DatumPaketa >
    < / VodilniZapis >
    < / Paket >
    < / EmbeddedData >
    < / content >
    < / data >
    < / document >

    my selection:
    SELECT extractValue (Value (t), ' VodilniZapis/StevilkaPaketa', 'xmlns = "http://www.crea.si/Schemas/2004/Document/ZbsXml" ') MimeType
    TABLE (XMLSequence (extract (xm, ' / Document/data/content/EmbeddedData/package/VodilniZapis ',' xmlns = "http://www.crea.si/Schemas/2004/Document/ZbsXml" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" '))) t;

    It does not work except that it I use only one < package > instead of < Paket xmlns = "http://www.zbs-giz.si/Schemas/2006/ZbsXml" >


    Anyopne help me? Thank you.

    Hello

    Since the element child "Paket" comes from another namespace, you must qualify (and its descendants) in the XPath expression.

    Something like this should do it:

    SELECT extractValue(value(t), 'VodilniZapis/StevilkaPaketa', 'xmlns="http://www.zbs-giz.si/Schemas/2006/ZbsXml"') mimetype
    FROM TABLE(
      XMLSequence(
        extract( xml, '/Document/Data/Content/EmbeddedData/ns2:Paket/ns2:VodilniZapis',
                 'xmlns="http://www.crea.si/Schemas/2004/Document/ZbsXml",
                  xmlns:ns2="http://www.zbs-giz.si/Schemas/2006/ZbsXml"' )
      )
    ) t;
    
  • Extracting XML error. The XML file that is assigned in the configuration.xml is either incorrect or damaged.

    1. some web pages gives "error extracting XML. The XML file that is assigned in the configuration.xml is wrong or corrupt.

    2 Youtube gives, after having pressed the button start, message "an error has occurred. Please try again later.
    Even youtube opening page with IE, there is no problem.

    3. scrolling on Mozilla firefox pages only works with the sidebar not with the mouse wheel.

    Other user accounts on this computer is not these problems.

    BR Juha

    This can be caused by a recent update of Flash 11.3.

    See:

  • extract xml data in the collection

    Hello

    I want to extract xml data in a collection of collection


    could any body you tell me if we succeed in sql
    ex:

    declare
    type t_code is table of number;
    type r_rec is record (c_name varchar2 (100),)
    c_code vrachar2 (100),
    c_code_number t_code);
    type t_rec is the table of the r_rec;

    l_xml xmltype: = xmltype (')

    < body >
    <>campaign
    < code > < code > CAMP_1
    < description > Campaign_1 < / description >
    < rateplans >
    < rateplanCode > 1 < / rateplanCode >
    < rateplanCode > 2 < / rateplanCode >
    < rateplanCode > 3 < / rateplanCode >
    < / rateplans >
    < / campaign >
    <>campaign
    < code > < code > CAMP_2
    < description > Campaign_2 < / description >
    < rateplans >
    < > 11 rateplanCode < / rateplanCode >
    < > 22 rateplanCode < / rateplanCode >
    < rateplanCode > 33 < / rateplanCode >
    < / rateplans >
    < / campaign >
    <>campaign
    < code > < code > CAMP_3
    < description > Campaign_3 < / description >
    < rateplans >
    < > 111 rateplanCode < / rateplanCode >
    < > 222 rateplanCode < / rateplanCode >
    < > 333 rateplanCode < / rateplanCode >
    < / rateplans >
    < / campaign >
    < result >
    < > 00 resultCode < / resultCode >
    < resultText > success < / resultText >
    < / result >
    (< / body > ');

    Start

    Select / * logic exrat value of xml in the final collection * /.
    Double;

    end;

    I want data in the model in my final collection t_rec

    CAMP_1, Campaign_1, nested_table (1,2,3)
    CAMP_2, Campaign_2, nested_table (11,22,33)
    CAMP_3, Campaign_3, nested_table (111,222,333)

    Published by: 948596 on May 17, 2013 05:17

    Like this

    SQL> declare
      2       type t_code is table of number ;
      3       type r_rec is record
      4       (
      5          c_name varchar2(100),
      6          c_code varchar2(100),
      7          c_code_number t_code
      8       );
      9       type t_rec is table of r_rec ;
     10       l_rec t_rec := t_rec();
     11       l_xml xmltype := xmltype
     12                        ('
     13                           
     14                           
     15                           CAMP_1
     16                           Campaign_1
     17                           
     18                           1
     19                           2
     20                           3
     21                           
     22                           
     23                           
     24                           CAMP_2
     25                           Campaign_2
     26                           
     27                           11
     28                           22
     29                           33
     30                           
     31                           
     32                           
     33                           CAMP_3
     34                           Campaign_3
     35                           
     36                           111
     37                           222
     38                           333
     39                           
     40                           
     41                           
     42                           00
     43                           Success
     44                           
     45                           '
     46                        ) ;
     47  begin
     48       for i in (
     49                 select rownum id
     50                      , t1.code
     51                      , t1.description
     52                      , t2.rate_plan_code
     53                      , row_number() over(partition by t1.code order by t2.rate_plan_code) rno
     54                   from xmltable
     55                        (
     56                             '/body/campaign' passing l_xml
     57                             columns
     58                               code        varchar2(100) path 'code',
     59                               description varchar2(100) path 'description',
     60                               rate_plans  xmltype       path 'rateplans'
     61                        ) t1
     62                      , xmltable
     63                        (
     64                             '/rateplans/rateplanCode' passing t1.rate_plans
     65                             columns
     66                               rate_plan_code varchar2(100) path '.'
     67                        ) t2
     68                )
     69       loop
     70            if i.rno = 1 then
     71               l_rec.extend;
     72               l_rec(l_rec.count).c_name := i.description;
     73               l_rec(l_rec.count).c_code := i.code;
     74               l_rec(l_rec.count).c_code_number := t_code();
     75            end if;
     76            l_rec(l_rec.count).c_code_number.extend;
     77            l_rec(l_rec.count).c_code_number(i.rno) := i.rate_plan_code;
     78       end loop;
     79       for i in 1..l_rec.count
     80       loop
     81          dbms_output.put_line(l_rec(i).c_code || '  ' || l_rec(i).c_name);
     82          for j in 1..l_rec(i).c_code_number.count
     83          loop
     84             dbms_output.put_line(l_rec(i).c_code_number(j));
     85          end loop;
     86       end loop;
     87  end;
     88  /
    CAMP_1  Campaign_1
    1
    2
    3
    CAMP_2  Campaign_2
    11
    22
    33
    CAMP_3  Campaign_3
    111
    222
    333
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    
  • Extract xml nested with attributes using plsql

    Hi, I need to extract xml file and insert 2 oracle tables. The xml file is the use of attributes, and I cannot retrieve the element 'code' nested with its attributes in the context of its parent folder "table." Here is a sample of the xml data that I have to extract the date:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < dataset - cv:dataset - cv dateProduced = "2011-09-19 11:50:45 ' xmlns:dataset - cv ="http://www.myurl.com/dataset-cv/1.0.0">"
    < lov >
    < id of the table = "00000000000001000" Name = "Role of the system" isSystem = "true" status = "Enabled" >
    < id code = "00000000000000306" Name = "Helpdesk" code = "1" status = "Enabled" / >
    < id code = "000000000000000307" Name = "Reviewer" code = "2" status = "Enabled" / >
    < id code = "00000000000000308" Name = 'Administrator' code = '3' status = "Enabled" / >
    < /table >
    < id of the table = "00000000000002000" Name = 'Country' sSystem 'false' status = "Enabled" = >
    < id code = "000000000000002004" Name = "AFGHANISTAN" code = "4" status = "Enabled" / >
    < id code = "000000000000002008" Name = 'ALBANIA' code = '8' status = "Enabled" / >
    < id code = "000000000000002010" Name = "ANTARCTICA" code = "10" status = "Enabled" / >
    < /table >
    < / lov >
    < / dataset - cv:dataset - cv >


    I use a query like this that seems to work to get all the attributes of table or all attributes of code element element, but not the code attributes in the context of his record from the table parent.

    SELECT id
    englishname
    status
    FROM XMLTABLE ('for $i //lov//table return $i"
    FROM db_get_xml_from_file (p_file_name, p_directory)
    ID VARCHAR2 COLUMNS (32) PATH '@id '.
    , englishname PATH VARCHAR2 (50) '@englishName '.
    , status VARCHAR2 (10) PATH '@status '.
    )

    Any help will be much appreciated

    Thank you

    Dave

    user12036327 wrote:
    I use a query like this that seems to work to get all the attributes of table or all attributes of code element element, but not the code attributes in the context of his record from the table parent.

    To get the nested data, that you need to implement nested xmltable statements. for example

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select xmltype('
      2  
      3    
      4      
      5        
      6        
      7        
      8      
    9 10 11 12 13
    14
    15
    ') as xml from dual) 16 -- 17 -- end of sample data 18 -- 19 select tbl.id tbl_id 20 ,tbl.englishname as tbl_englishname 21 ,tbl.issystem as tbl_issystem 22 ,tbl.status as tbl_status 23 ,cd.id as cd_id 24 ,cd.englishname as cd_englishname 25 ,cd.code as cd_code 26 ,cd.status as cd_status 27 from t 28 ,xmltable(xmlnamespaces('http://www.myurl.com/dataset-cv/1.0.0' as "dataset-cv"), 29 '/dataset-cv:dataset-cv/lov/table' 30 passing t.xml 31 columns id varchar2(32) path '/table/@id' 32 ,englishname varchar2(20) path '/table/@englishName' 33 ,issystem varchar2(5) path '/table/@isSystem' 34 ,status varchar2(10) path '/table/@status' 35 ,code xmltype path '.' 36 ) tbl 37 ,xmltable(xmlnamespaces('http://www.myurl.com/dataset-cv/1.0.0' as "dataset-cv"), 38 '/table/code' 39 passing tbl.code 40 columns id varchar2(32) path '/code/@id' 41 ,englishname varchar2(20) path '/code/@englishName' 42 ,code number path '/code/@code' 43 ,status varchar2(10) path '/code/@status' 44* ) cd SQL> / TBL_ID TBL_ENGLISHNAME TBL_I TBL_STATUS CD_ID CD_ENGLISHNAME CD_CODE CD_STATUS -------------------------------- -------------------- ----- ---------- -------------------------------- -------------------- ---------- ---------- 00000000000001000 System Role true Enabled 00000000000000306 Helpdesk 1 Enabled 00000000000001000 System Role true Enabled 000000000000000307 Reviewer 2 Enabled 00000000000001000 System Role true Enabled 00000000000000308 Administrator 3 Enabled 00000000000002000 Country false Enabled 000000000000002004 AFGHANISTAN 4 Enabled 00000000000002000 Country false Enabled 000000000000002008 ALBANIA 8 Enabled 00000000000002000 Country false Enabled 000000000000002010 ANTARCTICA 10 Enabled 6 rows selected.
  • Extracting XML data limit?

    Hi all

    Can someone help with the data limit for retrieving XML from a text field?

    Scenario: I have a text field with the limit set for the 1000 characters. Can you please let me know if there is any limitation extracting XML with a text field with 1000 characters?


    Thank you
    Yassine

    Hi John,

    I have not met a deadline, I had 8000-character text fields (as much as can fit on an A4 page) and I had pictures of 4 MB in a data node.

    Concerning

    Bruce

  • Evaluation of XML Namespace by using the java properties file

    Hi all

    In my java class, I get the XML as a string. I am convert this string to xml. So in order to evaluate the xpath expression, I'm able to evaluate the xpath expression by using the namespace prefix and the namespace url as key / value in my properties file. It has worked well.


    But my project is that,

    I can receive different xmls with different sets of namespaces. For each xml namespace prefix and url wil set. While I can keep track of a set of namespace prefix and url for each xml.

    The problem here is that
    XML_A is to have its own prefix - ns1 pointing to 'http://orders.com/purchase', ns2, pointing to "http://orders.com/invoice".

    XML_B is to have its own prefix - ns1 pointing to 'http://sales.com/stock', ns2, pointing to "http://sales.com/item" - I mean same ns1 and ns2


    Kindly tell me, it's possible in the file build.properties, to bring together the key pair / value. while I have not lead to any conflict, of having the URL of the different namespace
    for the same key "ns1."

    ns1 = http://orders.com/purchase


    ns1 = http://sales.com/stock


    I want the above two lines occur in the same file build.properties. Also, when using MapObj.get ("ns1") - (where MapObj will see the values of keys to the build.properties file.)
    I want to differentiate the ns1 under certain conditions (xml_name in my case).

    Here for the prefix, I have no other don't be concat something to make a difference like A_ns1 and B_ns2. This will create problems. So kindly help me by giving an alternative.



    Thank you
    Sabarisri. N

    Hi Sabarisri,

    First, there's a material typo in my previous post (hmap2 must be read hmap, all along). I who will edit later because it is annoyingly confusing. But leave it for now.

    I think I was so explicit that I was able to convey the idea that ns1, ns2, etc., if there is more, used by the author of XML_A and XML_B are unimportant as long as you, as the consumer of them, are concerned. Apparently, I was not very successful.

    Let me do it again.

    Assume that XML_A contains the prefixes and namespace URIs like this. I even add one more by way of illustration which may overlap in the two documents.

    xmlns:ns1 = "http://orders.com/suppliers".
    xmlns:ns2 = "http://orders.com/stock".
    xmlns: x = "http://orders.com/serial."

    Then in XML_B, these.

    xmlns:ns1 = "http://customers.com/contact".
    xmlns:ns2 = "http://customers.com/billing".
    xmlns:y = "http://orders.com/serial".

    (ns1, ns2, x) and (ns1, ns2, y) are appearing as such when xml documents are served. x and there are still pointing to the same namespace (think of it as the namespace where the serial number of the orders they need later use to gather the two sets of data.) x and there is maybe not even the same same alphabet their semantics (namespace uri) are the same, the same namespace.

    Put yourself in the situation of consuming them. You know you have to deal with totally 5 namespace uri. You build the dictionary: a HashMap or unique or other properties file. Under your control are the namespace prefixes. You can ignore absolutely what they use ns1,... x, y. Design you your own. That's all.

    hmap.put("p","http://orders.com/suppliers");
    hmap.put("q","http://customers.com/contact");
    hmap.put("r","http://orders.com/serial");
    hmap.put("s","http://orders.com/stock");
    hmap.put("t","http://customers.com/billing");
    

    One more time (p, q, r, s, t) are figurative, you name it what you please as long as they are in line with the production of the grammar of namespace prefix.

    With the help of (p, q, r, s, t), you build your xpath query. The namespace context Manager can resolve correctly. You can't even say what namespace prefix must be used by querying the xml, A or B.

    Hope that makes it clearer by the repetition by another speech.

    Published by: tsuji 7 Sep 2011 08:13 (typos only)

  • Parsing XML Namespace in as2

    HI, I am looking to analyze weather information of flow RSS Yahoo weather.

    It is a typical XML node.

    < description > Yahoo! Weather for Palm Springs, CA < / description >

    I used the typical XML, parsing code in as2;

    var text1 = this.firstChild.childNodes [0] Sublst.ChildNodes(1).ChildNodes(0) [1].firstChild.nodeValue;

    txt1. Text = text1;

    I was doing pretty good until I reached a node that has been formatted as well;

    < yweather:forecast day = 'My' date = ' Sep 28 2009 "low ="74"high ="103"text ="Sunny"code ="32"/ >".

    This text has charted an undefined value.

    I tried to research this and so far everything I've been able to know, are that it is a XML namespace and is easily managed in as3. Unfortunately, I have to use as2.

    How do I analyze this information in a dyamic text fields?

    Or if not, where, in the literature contact adobe how this is done?

    Forrest

    Hello

    Try this code:

    var xmlname:XML = new XML();

    xmlname.ignoreWhite = true;

    XMLName.Load ("sample.xml");

    xmlname.onLoad = function (success: Boolean) {}

    xNode = xmlname.firstChild var;

    var tday = xNode.childNodes [0].attributes.day;

    adate = xNode.childNodes var [0].attributes.date;

    trace (tDate);

    }

  • How to extract xml with namespaces

    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 ();

    Published by: akm006 on March 19, 2013 11:11

    Try

    SQL> declare
      2  x xmltype := xmltype('
      3  
      4  
      5  10
      6  32
      7  3
      8  2012-DEC-10
      9  WebUserNameTest
     10  
     11  
     12  1
     13  3
     14  2
     15  2012-DEC-12
     16  WebUserNameTest
     17  
     18  ') ;
     19
     20  v_string_xml varchar2(100);
     21  v_string_xml_ns varchar2(500);
     22  v_ssp number;
     23  counter_xml number := 1;
     24  begin
     25
     26  v_string_xml := 'Transaction/Request[' || TO_CHAR (counter_xml) || ']/Memid/text()';
     27
     28  v_string_xml_ns :='xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.test.com/Support/Services/test1/2012"';
     29
     30  v_ssp := x.EXTRACT(v_string_xml,v_string_xml_ns).getnumberval();
     31
     32  dbms_output.put_line(v_ssp);
     33
     34  end;
     35  /
    
    10
    
    PL/SQL procedure successfully completed
    
    SQL>
    
  • Extract XML question

    Hello

    I have the XML code below in a table (configbom) that has a column (DATA) that is XMLTYPE. I try to extract the value of State via SQL in SQLPLUS like this:


    SQL > Select extract(data,'/ConfigBomRequestResponse/ConfigBomRequestResult/StatusCode') from configbom;

    EXTRACT(DATA,'/CONFIGBOMREQUESTRESPONSE/CONFIGBOMREQUESTRESULT/STATUSCODE')
    --------------------------------------------------------------------------------


    SQL >

    I didn't recover. Does anyone have any ideas what I am doing wrong?

    Thank you
    Melinda



    < ConfigBomRequestResponse xmlns = "http://swagelok.com/service/tibco/2009/09/03" >
    < ConfigBomRequestResult xmlns:i = "http://www.w3.org/2001/XMLSchema-instance" >

    < StatusCode > 0 < / StatusCode >
    < StatusMessage / >
    < BomResults >

    < ConfigBomData >
    < allocation_length i: nil = "true" / >
    < cut_length
    i: Nil = "true" / >
    < description > FL UNDER ASSEMBLY < / description >

    < part_number > SS-FL4B-C-RF4SA < / part_number >

    < quantity_per > 2 < / quantity_per >
    < i: Nile uom = "true" / >

    < / ConfigBomData >
    < ConfigBomData >

    < allocation_length > 33,84 < / allocation_length >

    < cut_length > 33,84 < / cut_length >
    < description > 1 / 4 & quot; TUBE & amp;
    BRAID < / description >
    < part_number > SS-FL4-B-HXX < / part_number >

    < quantity_per i: nil = "true" / >
    IN < Glu > < / UDM >
    < / ConfigBomData >

    < / BomResults >
    < / ConfigBomRequestResult >
    < / ConfigBomRequestResponse >

    Hi, Melinda,

    two things: first of all, you can set the column in the table by using a table alias. This is necessary because the column is a type of object-orientation that should be treated by a Manager.
    Then, you must pass in the namespace of the element. In otherwise, extract tent to search in the default namespace contains all values at all. As a result, your query should look like this:


    select extract(x.data,
    '/ConfigBomRequestResponse/ConfigBomRequestResult/StatusCode',
    'xmlns="http://swagelok.com/service/tibco/2009/09/03"')
    from configbom x;

    Best regards

    Jürgen

  • Extract XML Value returns nothing

    Hi, I have a table where I put an XMLTYPE column called XML_RESPONSE and a CLOB called XML_RESPONSE_CLOB with the same XML content each.

    One of the values of records in the two columns look like this:

    <? xml version = "1.0" encoding = "UTF - 8"? >< s : Envelope xmlns:S = » http://schemas.xmlsoap.org/soap/envelope/ « >< Body >< ns2:StampCFDBytesResponse xmlns:ns2 = » http://impl.Controllers.massive.Fe.STO.com/ "xmlns:ns3 = » http://exception.Fe.STO.com/ "><stampedDocument>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGNmZGk6Q29tcHJvYmFudGUgdmVyc2lvbj0iMy4yIiBmb2xpbz0Cinb2IubXgvVGltYnJlRmlzY2FsRGlnaXRhbCBodHRwOi8vd3d3LnNhdC5nb2IubXgvVGltYnJlRmlzY2FsRGlnaXRhbC9UaW1icmVGaXNjYWxEaWdpdGFsLnhzZCIgeG1sbnM6dGZkPSJodHRwOi8vd3d3LnNhdC5nb2IubXgvVGltYnJlRmlzY2FsRGlnaXRhbCIvPgogICAgPC9jZmRpOkNvbXBsZW1lbnRvPgo8L2NmZGk6Q29tcHJvYmFudGU+</stampedDocument></ns2:StampCFDBytesResponse></S:Body></S:Envelope>

    I am trying to extract the base64 code, that is inside the < stampedDocument > element.

    If I use this code, the procedure runs, but returns nothing:

    Select apex_web_service.parse_xml (XML_RESPONSE, "/ / envelope/body/stampedDocument")

    in v_stamped from f_cfdi_timbrados where id_cfdi_timbrado = 1002;

    If I use the following the procedure returns an error:

    Select apex_web_service.parse_xml (XML_RESPONSE, '//Envelope/Body/stampedDocument/stampedDocument ()')

    Select apex_web_service.parse_xml (XML_RESPONSE, '//S:Envelope/S:Body/stampedDocument/stampedDocument ()')

    Select apex_web_service.parse_xml (XML_RESPONSE, ' / / s: Envelope / Body / stampedDocument')

    in v_stamped from f_cfdi_timbrados where id_cfdi_timbrado = 1002;

    06503 00000 - "PL/SQL: function returned no value."

    * Cause: A call to the PL/SQL function completed, but no RETURN statement has been

    executed.

    * Action: Function to rewrite PL/SQL, ensuring that it always returns

    a value of the appropriate type.

    I also tried with the ExtractValue function and retunrs null or an error.

    SELECT id_cfdi_timbrado,

    EXTRACTVALUE (e.xml_response, ' / envelope/body/stampedDocument ')

    'CFDI_BASE_64 '.

    OF e f_cfdi_timbrados

    WHERE id_cfdi_timbrado = 1002;

    Please notify. It's my first experience of XML parsing and it seems that I am lost.

    Francisco

    The error message provides the clue that you need.  If you were to search on this error message, you will see he's trying to tell you that you are missing a RETURN statement at the end of your function.  Something like

    RETURN v_stamped;

    That would resolve the issue causing the error ORA.

    Regarding the second question, that you will encounter, your clips are not correctly name space which is part of the XML.  For extractValue, there is a third parm

    EXTRACTVALUE

    If your query would look like

    EXTRACTVALUE (e.xml_response, ' / s: Envelope/Body / ns2:stampedDocument ',' xmlns:S = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2 = "http://impl.controllers.massive.fe.sto.com/"')

    I leave you to you of apex_web_service.parse_xml of research

    That said, depending on your version of Oracle, extractValue might be obsolete and you will have to go in a different direction.

    Here are a few tips to post on the forums

    Re: 2. How can I ask a question in the forums?

  • using XPath with SQL to extract XML data

    Given the data like this:
    <?xml version="1.0"?>
    <ExtendedData>
       <Parameter name="CALLHOLD"><BooleanValue>true</BooleanValue></Parameter>
    
      <Parameter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="BARRING_PASSWORD" xsi:nil="true"/>
    
      <Parameter name="ALLCF"><BooleanValue>true</BooleanValue></Parameter>
    
      <Parameter name="RealProv"><BooleanValue>false</BooleanValue></Parameter>
    
    </ExtendedData>
    I usually use extractValue as shown below, for example function to extract the value for the last parameter in the above data, for example:
    select extractValue(extended_data,'/ExtendedData/Parameter[@name="RealProv"]/BooleanValue') "my_column_alias" from table
    Any ideas on how can I return the value of the parameter xsi: Nil for that node:
    <Parameter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="BARRING_PASSWORD" xsi:nil="true"/>
    I would like to extract the
    true
    in
    xsi:nil="true"
    ...

    Thank you

    Published by: HouseofHunger on May 15, 2012 14:13

    Published by: HouseofHunger on May 15, 2012 14:13

    ExtractValue() has a third parameter, that we can use to declare the namespace mappings:

    SQL> with sample_data as (
      2    select xmltype('
      3  
      4    true
      5    
      6    true
      7    false
      8  ') doc
      9    from dual
     10  )
     11  select extractvalue(
     12           doc
     13         , '/ExtendedData/Parameter[@name="BARRING_PASSWORD"]/@xsi:nil'
     14         , 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
     15         )
     16  from sample_data
     17  ;
    
    EXTRACTVALUE(DOC,'/EXTENDEDDAT
    --------------------------------------------------------------------------------
    true
     
    

    If you are on 11.2.0.2 and upward, extractvalue() is obsolete.
    Must use XMLCast/XMLQuery instead:

    SQL> with sample_data as (
      2    select xmltype('
      3  
      4    true
      5    
      6    true
      7    false
      8  ') doc
      9    from dual
     10  )
     11  select xmlcast(
     12           xmlquery('/ExtendedData/Parameter[@name="BARRING_PASSWORD"]/@xsi:nil'
     13            passing doc
     14            returning content
     15           ) as varchar2(5)
     16         )
     17  from sample_data
     18  ;
    
    XMLCAST(XMLQUERY('/EXTENDEDDAT
    ------------------------------
    true
     
    

    Note: the prefix xsi is predefined when using Oracle's XQuery, so in this case we must explicitly declare.

    Published by: odie_63 on May 15, 2012 15:23

Maybe you are looking for

  • How to unlock your Mac with your Apple Watch

    Hello How to unlock your Mac with your Apple Watch? my mac: MacBook Pro (13 inch, late 2011) MacOS Sierra 10.12 I can not found "Allow your Apple Watch unlock your Mac" in security and privacy Thank you

  • Drivers XP for Satellite P300-134

    Where can I find XP drivers for the laptop above?And yes I know that it is not supposed to have XP on it, but for what I need for Vista will just not cut it. Where I can find any help will be much appreciated. D

  • MacBook Pro a mess (maybe after upgrading to El Capitan)

    I need help in desperate mode.  I tried to implement everything that I know and I now return to the pros.    I have a Macbook Pro mid-2012.  The computer is still very well without any problems.   After about 3-4 weeks after the upgrade to El Capitan

  • Migration of Cisco to Dell N4000/N3000

    Hello I need some advice. We currently organize a Cisco network on integrated 3750 WLC aging and several switches (3650 and 2960). It is EOL and we wanted to move away from them anyway. So, we bought a N4032F for the core and several N3024P/N3048P fo

  • the desktop icons disappear when I connect through a VPN

    On my Windows 7 Professional 64-bit, SP1 system, automatic reorganization and snap to grid are unchecked.  And I don't have problems with icons on a restart.  I have problems when I access my system in my home using a VPN and the DRC. Sometimes when