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

}

Tags: Adobe Animate

Similar Questions

  • Widget to the Web service, parsing XML

    I worked on the communication with my web services and back to my widget.

    By using the code below, I was able to perform a GET and repay the XML, but I can't find data where I expect it to be node-wise when parsing XML. I return an object with 3 variables attached to it. I expect to be child nodes 1, 2, and 3. They proved to be 1, 3 and 5 nodes.

    Any ideas on why or how? I feel I'm missing just a simple thing in all of this.

    XML response

    
    - http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
      1000
      Test Station
      105.285
      
    

    The widget code

    //****************** Ajax Logic ******************
    var xmlHttp;
    function getStationUpdate() {
    
        alert("in station update");
        xmlHttp = new XMLHttpRequest();
    
        var Posturl = "http://MachineIPGoesHERE:51107/Service1.asmx/HelloWorld2?";
        alert("after post url");
        xmlHttp.onreadystatechange = updateData;
        alert("after onReadyStateChange");
        xmlHttp.open("GET", Posturl, true);
        alert("after GET");
    
        xmlHttp.send(null);
    }
    
    function updateData() {
        if (xmlHttp.readyState == 4) {
            alert(xmlHttp.responseText);
            parser = new DOMParser();
            var xmlDoc = parser.parseFromString(xmlHttp.responseText, "text/xml");
    
            alert(xmlDoc.documentElement.childNodes[1].tagName + " " + xmlDoc.documentElement.childNodes[1].childNodes[0].nodeValue);
            //alert(xmlDoc.documentElement.childNodes[1].childNodes.length);
            //alert(xmlDoc.documentElement.childNodes[1].hasChildNodes());
            //alert(xmlDoc.documentElement.childNodes[2].hasChildNodes());
            //alert(xmlDoc.documentElement.childNodes[2].tagName + " " + xmlDoc.documentElement.childNodes[2].childNodes[0].nodeValue);
            alert(xmlDoc.documentElement.childNodes[3].tagName + " " + xmlDoc.documentElement.childNodes[3].childNodes[0].nodeValue);
            alert(xmlDoc.documentElement.childNodes[5].tagName + " " + xmlDoc.documentElement.childNodes[5].childNodes[0].nodeValue);
    
            alert(xmlDoc.documentElement.childNodes.length);
        }
    

    Web service

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Services;
    using System.Xml.Serialization;
    
    namespace WebService1
    {
        /// 
        /// Summary description for Service1
        /// 
        [WebService(Namespace = "http://tempuri.org/")]
        [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
        [System.ComponentModel.ToolboxItem(false)]
        // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
         [System.Web.Script.Services.ScriptService]
        public class Service1 : System.Web.Services.WebService
        {
    
            [WebMethod]
            public string HelloWorld()
            {
                return "Hello World";
            }
    
            [WebMethod]
            public myTestObj HelloWorld2()
            {
                myTestObj test = new myTestObj();
                return test;
            }
        }
    
        [Serializable]
        public class myTestObj
        {
            private int _StationID;
            private string _StationName;
            private double _Volume;
    
            [XmlElementAttribute(Order = 0)]
            public int StationID
            {
                get
                {
                    return this._StationID;
                }
                set
                {
                    this._StationID = value;
                }
            }
    
            [XmlElementAttribute(Order = 1)]
            public string StationName
            {
                get
                {
                    return this._StationName;
                }
                set
                {
                    this._StationName = value;
                }
            }
    
            [XmlElementAttribute(Order = 2)]
            public double Volume
            {
                get
                {
                    return this._Volume;
                }
                set
                {
                    this._Volume = value;
                }
            }
    
            public myTestObj()
            {
                StationID = 1000;
                StationName = "Test Station";
                Volume = 105.285;
            }
        }
    }
    

    > Any ideas on why or how? I feel I'm missing just a simple thing in all of this.

    White space nodes?

  • Err: ORA-31011: failed to parse XML

    Hello

    While inserting the XML code in the table, I faced slot problem, Pls suggest a way out of the code.
    Your help is appreciate.
    I'm using the version of Oracle - 10.2.0.2.0

    Err: ORA-31011: failed to parse XML
    ORA-19202: an error has occurred in the processing of XML
    LPX-00234: the 'xsi' namespace prefix is not declared
    Error on line 1
    ORA-06512: at "SYS." XMLTYPE", line 254
    ORA-06512: at line 1

    -Step 1
    CREATE TABLE EMP (EMPCODE NUMBER (8), EMPNAME VARCHAR2 (100), THE NUMBER OF EMPDEPTNO (8), NUMBER EMPSAL (34.2));
    /
    -Step 2
    BEGIN
    FOR X IN (SELECT * FROM USER_OBJECTS S WHERE ROWNUM < = 50)
    LOOP
    INSERT INTO VALUES EMP (X.OBJECT_ID, X.OBJECT_NAME, 20, X.OBJECT_ID + 10);
    END LOOP;
    COMMIT;
    END;
    /
    -Step 3
    create the table EMPXML (XMLCLOB XMLTYPE);
    /
    -Step 4
    DECLARE
    v_xmldata CLOB.
    v_tmpdata CLOB.
    v_xmltype XMLTYPE.
    BEGIN
    DBMS_LOB.CREATETEMPORARY (v_tmpdata, false);
    v_xmldata: = ' <? XML version = "1.0" encoding = "UTF-8"? > ';

    SELECT Xmlelement ("employee",

    XmlAttributes ("http://ns.oracle.com.tw/XSD/ORACLE/ESB/Message/EMF/ServiceEnvelope" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" AS ")
    "xmlns:ns0,"
    ' http://ns.oracle.com.tw/XSD/ORACLE/ESB/Message/EMF/ServiceEnvelope ServiceEnvelope.xsd > ' AS
    ("xsi: schemaLocation").
    XMLAGG (Xmlforest (AS Empcode "EmpID",
    EmpName AS "EmpName",.
    Empsal AS 'EmpSal'))) BY v_xmltype
    FROM Emp
    WHERE Empdeptno = 20;

    SELECT v_xmltype.getCLOBVal () IN the v_tmpdata FROM dual;

    DBMS_LOB. Append (v_xmldata, v_tmpdata);

    BEGIN
    INSERT IN EMPXML VALUES (xmltype (v_xmldata));
    EXCEPTION WHEN OTHERS THEN
    dbms_output.put_line ('Err: ' |) SQLERRM);
    END;
    END;
    /
    -Step 5
    SELECT * from empxml;
    /
    -Step 6
    DROP TABLE EMP PURGE;
    /
    -Step 7
    DROP TABLE EMPXML PURGE;
    /
    Thank you and best regards,
    Yogesh Nagle
    India

    What? Pepijn you provided the correct use of Xmlattributes and showed that your script would go without errors. What is the problem with his answer or it does not that you need it?

  • Problem in parsing XML

    Hello

    Any1 can you please tell me how to do Xml parsing in Blackberry. I'm a bit confused by it.

    Assume that it is my link:

    {keyword: "keword", url: "videoUrl"}

    While parsing xml:

    String keyword1 ="";

    element.getName.equalsIgnoreCase ("keyword");

    keyword1 = Element.GetText ();

    is she writing?

    Hey its done.

  • Parsing XML and get the attributes of a tag

    Hello

    When parsing XML for application of Cascades in C++, I am able to get the value of a tag as follows:

    00000

    But I also want to get the attributes of a tag:

    But I don't know how to get the 'CA' and 'California' attributes with my current code.  Can anyone help?  Here is the code I use to parse the XML code:

    void CMController::requestFinished(QNetworkReply* reply) {
    
        if (reply->error() == QNetworkReply::NoError) {
    
            QXmlStreamReader xml;
    
            QByteArray data = reply->readAll();
            xml.addData(data);
    
            QString zip;
            QString id;
            QString location;
    
            while (!xml.atEnd() && !xml.hasError()) {
    
                /* Read next element.*/
                QXmlStreamReader::TokenType token = xml.readNext();
    
                /* If token is just StartDocument, we'll go to next.*/
                if (token == QXmlStreamReader::StartDocument) {
                    continue;
                }
    
                /* If token is StartElement, we'll see if we can read it.*/
                if (token == QXmlStreamReader::StartElement) {
    
                    if (xml.name() == "zip") {
                        zip = xml.readElementText();
                    }
    
                    if (xml.name() == "id") {
                        ???
                    }
    
                    if (xml.name() == "location") {
                        ???
                    }
    
                }
    
            }
    
            emit succeeded(result);
    
        } else {
            emit failed();
        }
    
        reply->deleteLater();
    
    }
    

    Thank you!

    I found a working example:

    if(xml.name() == "state"){
        QXmlStreamAttributes attrib = xml.attributes();
        QStringRef ref = attrib.value("location");
        qDebug() << "location: " << ref;
    }
    
  • Best way to Parse XML using Dreamweaver CC 2015.3

    I was on a wild goose chase - trying to figure out how to parse XML using DW CC

    every article I read, says something about XML & XSLT, but it is no longer available in the new CC - I read about using jQuery or php, but have not yet find a resource to learn specifically "using DW CC.

    I'm willing to learn how to parse XML with DW CC but I would get a definitive direction to go before I'm trying to learn something that adobe will put in 'end of life '.

    advice or links to resources that can parse XML DW CC 2015 would be LARGELY APPRECIATED, thank you

    x 126 has written:

    What I'm asking is...

    1. What is the best procedure to insert XML into a page using DW CC 2015 as my editor?
    a. what happened to spry? b. what happened to XSLT?

    As Nancy explained, Spry has been abandoned by Adobe, a few years ago.

    XSLT server behavior has been removed at the same time as other server behaviors Dreamweaver CC. The problem with most of the PHP server behaviors was that they were based on code that has been removed from PHP 7. The XSLT server behavior didn't rely on these features, but it was not the most friendly of server behaviors. XSLT is a complex language that is to be avoided when parsing XML unless you really know what you're doing.

    The easiest way to manipulate XML in Dreamweaver should use PHP SimpleXML. I've linked to the samples page in the PHP online documentation. Believe me, it's much easier than trying to do battle with XSLT. If you have a subscription to lynda.com, you can learn more about SimpleXML to my operational with SimpleXMLclass.

  • 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)

  • Failed to parse XML

    Hello

    If I use the following XML code it does not produce anything. Please help me to find what the problem is.
    [PHP]
    var XML = < xml >
    " < manifest xmlns =" http://www.imsglobal.org/XSD/imscp_v1p1 "xmlns:imsmd =" " http://www.imsglobal.org/XSD/imsmd_v1p2 "" xmlns: xsi = " " http://www.w3.org/2001/XMLSchema-instance "xsi: schemaLocation =" http://www.imsglobal.org/XSD/imscp_v1p1 http://www.imsglobal.org/xsd/imscp_v1p1.xsd http://www.imsglobal.org/xsd/imsmd_v1p2 http://www.imsglobal.org/xsd/imsmd_v1p2.xsd "identifier="Manifest7-CEC3D3-3201-DF8E-8F42-3CEED12F4197"version ="IMS CP 1.1.4">
    < text > < / text >
    < / manifesto >
    < / xml >;

    trace (XML.manifest.Text) [PHP]

    It does not produce anything on the screen. Any help is appreciated.

    The IMS, overall it is wisdom, mucked with the default namespace in the scorm doc set. Should be a simple workaround to resolve. Take a look at this:

    var nsIMS:Namespace = new Namespace ("http://www.imsglobal.org/xsd/imscp_v1p1");

    the ns ims default
    default xml namespace = nsIMS;
    var xml =
         "http://www.imsglobal.org/XSD/imscp_v1p1" xmlns:imsmd ="http://www.imsglobal.org/xsd/imsmd_v1p2" "xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance"xsi: schemaLocation ="http://www.imsglobal.org/xsd/imscp_v1p1http://www.imsglobal.org/xsd/imscp_v1p1.xsdhttp://www.imsglobal.org/xsd/imsmd_v1p2http://www.imsglobal.org/xsd/imsmd_v1p2.xsd "identifier="Manifest7-CEC3D3-3201-DF8E-8F42-3CEED12F4197"version ="IMS CP 1.1.4">
             Text
        

    ;

    trace ("ims def ns:", xml.manifest.text);

    the ns by default to a null value when the value

    lack of namespace xml = null;

    trace ("null def ns:", xml.manifest.text);

  • 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" >. "

  • How to declare a global xml element in as2?

    How to declare a global xml element in as2?

    _Global.XML = new XML();

  • Parsing XML in ColdFusion 5

    Hello there,

    It's not like there is a native way to parse XML in ColdFusion version 5.0. ColdFusion MX makes it easier to work with XML, but unfortunately I am working under Windows with a CF5 server.

    I've gotten to the point of use CFHTTP to retrieve XML content in a variable, but I don't know the best way to decompress the data in a query, or another structure that I can use to feed the rest of the model. I thought to save the content of a file and then a loop top, but something tells me that it is an inefficient way to do the job.

    I would like to avoid having to install any additional software, but if it's the only way to process XML in CF5, then I would be grateful for any recommendations on the best tools to evaluate or buy. Or if there is a way to do it in JavaScript, it would be great, too.

    Thanks for any help!

    try to use SoXML, it is a custom tag, is free and can be downloaded from the Adobe Exchange website

    --> Adobe Exchange link

    M

  • Help parsing XML with multiple namespaces

    I have a function that returns the following XML:
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <soap:Body>
          <fetchReportDataResponse xmlns="http://RptArchive/">
             <fetchReportDataResult>
                <feed xmlns="urn:WA.Ecy.ADS.RptAuditImage.Services">
                   <Table xmlns="">
                      <Report>Person Item</Report>
                      <Program>WQ</Program>
                      <Application>PARIS</Application>
                   </Table>
                   <Table xmlns="">
                      <Report>Select DB by Fragment</Report>
                      <Program>WQ</Program>
                      <Application>PARIS</Application>
                   </Table>
                   <Table xmlns="">
                      <Report>EmployeeDetailReport</Report>
                      <Program>ADS</Program>
                      <Application>Son1</Application>
                   </Table>
                   <Table xmlns="">
                      <Report>DeliveryTestReport</Report>
                      <Program>ADS</Program>
                      <Application>Test</Application>
                   </Table>
                   <Table xmlns="">
                      <Report>Report_NoDMRs_ProcessByDeliveryMethod</Report>
                      <Program>WQ</Program>
                      <Application>PARIS</Application>
                   </Table>
                </feed>
             </fetchReportDataResult>
          </fetchReportDataResponse>
       </soap:Body>
    </soap:Envelope>
    I wrote to try to get the data of the following SQL statement:
    select application,program_name,report
    from 
    (select extract(enforce_pkg.get_ads_report_data,'/soap:Envelope/soap:Body/fetchReportDataResponse/fetchReportDataResult/child::node()',
    'xmlns="http://RptArchive/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/') xml
    from dual )t,
    xmltable('/feed/Table'
    passing t.xml
    columns
    report varchar2(100) path 'Report',
    program_name varchar2(100) path 'Program',
    application varchar2(100) path 'Application');
    {code}
    This returns zero records.  If I break this up, I see that my extract statement is working:
    
    {code}
    select extract(enforce_pkg.get_ads_report_data,'/soap:Envelope/soap:Body/fetchReportDataResponse/fetchReportDataResult/child::node()',
    'xmlns="http://RptArchive/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/') xml
    from dual ;
    Returns
    <feed xmlns="urn:WA.Ecy.ADS.RptAuditImage.Services">
    <Table xmlns="">
    <Report>Person Item</Report>
    <Program>WQ</Program>
    <Application>PARIS</Application>
    </Table>
    <Table xmlns="">
    <Report>Select DB by Fragment</Report>
    <Program>WQ</Program>
    <Application>PARIS</Application>
    </Table>
    <Table xmlns="">
    <Report>EmployeeDetailReport</Report>
    <Program>ADS</Program>
    <Application>Son1</Application>
    </Table>
    <Table xmlns="">
    <Report>DeliveryTestReport</Report>
    <Program>ADS</Program>
    <Application>Test</Application>
    </Table>
    <Table xmlns="">
    <Report>Report_NoDMRs_ProcessByDeliveryMethod</Report>
    <Program>WQ</Program>
    <Application>PARIS</Application>
    </Table>
    </feed>
    So I guess that there is something wrong with my implementation of the function xmltable - perhaps because there are two namespaces involved,
    one of them is null (I know that it is bad form--I am a consumer here and do not have control of the source).

    Any help would be appreciated.

    Best regards, Tony

    You can use xmltable with a simple xpath as follows:

    create or replace type ty_Rep  as object (rep_name varchar2(40), prg_name varchar2(40),app_name varchar2(40));
    /
    create or replace type tb_Rep as table of ty_Rep;
    /
    
    set serveroutput on
    declare
      l_xml xmltype := xmltype('
                                 
                                   
                                       
                                          
                                             Person ItemWQPARIS
    Select DB by FragmentWQPARIS
    EmployeeDetailReportADSSon1
    DeliveryTestReportADSTest
    Report_NoDMRs_ProcessByDeliveryMethodWQPARIS
    '); l_Rep tb_Rep := tb_Rep(); begin select ty_Rep(x.Report, x.Program, x.Application) bulk collect into l_Rep from (select l_XML as m from dual) d ,xmltable ('//Table' passing d.m columns Report varchar2(40) path 'Report' ,Program varchar2(40) path 'Program' ,Application varchar2(40) path 'Application') as x; dbms_output.put_line(l_Rep.count); for r in 1..l_Rep.count loop dbms_output.put_line('Report: ' || l_Rep(r).rep_name ); dbms_output.put_line('Program: ' || l_Rep(r).prg_name ); dbms_output.put_line('Application: ' || l_Rep(r).app_name ); end loop; end; / 5 Report: Person Item Program: WQ Application: PARIS Report: Select DB by Fragment Program: WQ Application: PARIS Report: EmployeeDetailReport Program: ADS Application: Son1 Report: DeliveryTestReport Program: ADS Application: Test Report: Report_NoDMRs_ProcessByDeliveryMethod Program: WQ Application: PARIS PL/SQL procedure successfully completed.
  • Parse XML and insert into the table Oracel

    Hi all

    I have an XML document, I need to analyze and take the respective tag data and inserting it into another table.

    This is the XML code that I have.

    " < convertTo xsi: schemaLocation =" https://xecdapi.XE.com/schema/v1/convertTo.xsd "> "

    < terms > http://www.XE.com/privacy.php < / terms >

    < privacy > http://www.XE.com/legal/DFS.php < / privacy >

    < to > < /pour > USD

    < amount > 1.0 < / amount >

    < timestamp > 2015-10-25T 23: 00:00Z < / timestamp >

    < from >

    rate <>

    < currency > EUR < / currency >

    < e > 0.9075541422 < / mid >

    < / rates >

    rate <>

    INR < currency > < / currency >

    < e > 65.0313451105 < / mid >

    < / rates >

    rate <>

    < currency > CAD < / currency >

    < e > 1.3167560135 < / mid >

    < / rates >

    rate <>

    < currency > GBP < / currency >

    < e > 0.6528693249 < / mid >

    < / rates >

    < / from >

    < / convertTo >


    Here is the code I use to analyze the values

    DECLARE

    XMLType x: = XMLType)

    ' ' < convertTo xsi: schemaLocation = " https://xecdapi.XE.com/schema/v1/convertTo.xsd "> "

    < terms > http://www.XE.com/privacy.php < / terms >

    < privacy > http://www.XE.com/legal/DFS.php < / privacy >

    < to > < /pour > USD

    < amount > 1.0 < / amount >

    < timestamp > 2015-10-25T 23: 00:00Z < / timestamp >

    < from >

    rate <>

    < currency > EUR < / currency >

    < e > 0.9075541422 < / mid >

    < / rates >

    rate <>

    INR < currency > < / currency >

    < e > 65.0313451105 < / mid >

    < / rates >

    rate <>

    < currency > CAD < / currency >

    < e > 1.3167560135 < / mid >

    < / rates >

    rate <>

    < currency > GBP < / currency >

    < e > 0.6528693249 < / mid >

    < / rates >

    < / from >

    < / convertTo > '

    );

    BEGIN

    FOR r IN

    (

    SELECT

    Name of the AS ExtractValue (Value (p),'/ rate/currency/text () ')

    -, ExtractValue (value (p), '/ Row/Address/State/Text ()') State

    -, ExtractValue (value (p), '/ Row/Address/City/Text ()') city

    Of

    TABLE (XMLSequence (Extract(x,'convertTo/from/rate'))) p

    )

    LOOP

    -do what you want with r.name, r.state, r.city

    dbms_output.put_line ('Name' | r.Name);

    END LOOP;

    END;

    I get the error message below

    Error report:

    ORA-31011: XML parsing failed

    ORA-19202: an error has occurred in the processing of XML

    LPX-00234: the 'xsi' namespace prefix is not declared

    Error on line 1

    ORA-06512: at "SYS." XMLTYPE", line 310

    ORA-06512: at line 2

    31011 00000 - "XML parsing failed"

    * Cause: XML parser returned an error trying to parse the document.

    * Action: Check whether the document to parse is valid.

    Any help on how to fix this would be really useful.

    Appreciate your time and your help.

    Thank you

    Olivier

    Have you even tried to do what we have suggested?

    SQL > ed
    A written file afiedt.buf

    1 with t as (select xmltype ('))
    "" 2 http://xecdapi.xe.com "xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance"" xsi: schemaLocation = "https://xecdapi.xe.com/schema/v1/convertTo.xsd" > ""
    3 http://www.xe.com/privacy.php
    4 http://www.xe.com/legal/dfs.php
    5 USD
    6    1.0
    7 2015-10 - 25 T 23: 00:00Z
    8
    9
    10 EUROS
    11 0.9075541422
    12

    13

    14
    ") in XML of the double)"
    15-
    16 end of test data
    17-
    18 select x.*
    19 t
    20, xmltable (xmlnamespaces ("http://www.w3.org/2001/XMLSchema-instance" as "xsi", default 'http://xecdapi.xe.com'),)
    21 ' / convertTo/of/rate.
    22 passage t.xml
    path of VARCHAR2 (3) currency 23 columns '. / currency '
    24, half-way number '. / mid'
    25*                ) x
    SQL > /.
    HEART MI
    --- ----------
    EUR.907554142

    1 selected line.

  • Analytical problems XML Namespace

    A provider generates the XML code that MX7 application must parse to convert data on the CFM page.

    < Cfset myXml = xmlParse (theXml) > line is used to get the code, which showed the error: -.

    «The prefix "xsi" for the attribute "xsi: type" associated with an element type "FAB_PkgAvailRS" is not related.»

    He comes to the line in the XML file: -.

    < FAB_PkgAvailRS Target = 'test' Version = '2002' has xsi: type = "FAB_PkgAvailRS" >, where the xsi Namespace up the Analyzer.

    What can we do about it.

    If the expression of xsi is deleted, it analyzes very easily.

    Any help would be appreciated.

    Which goes back to my first question - is the namespace prefix "xsi: ' in fact defined in the document?

  • Remove xml namespace created

    Hello
    I am writing an xml file using the file adapter.
    My requirement was to remove the namespace of the xml file before you write it with the help of file adapter.
    I solved this problem by using the xslt code and got the output shown below xml:

    <? XML version = "1.0"? >
    < order xmlns = "http://ProblemIsStillProblem.com" >
    < header >
    < source >
    < Originating_System > towing
    < / Originating_System >
    < User_Id > MVNO_BEGA
    < / User_Id >
    < / original >
    < priority > 4
    < / priority >
    .
    .
    .
    < / order >

    I want more is to remove this xmlns = "http://ProblemIsStillProblem.com" of the order.
    IE I need something as shown below:

    <? XML version = "1.0"? >
    < order >
    < header >
    < source >
    < Originating_System > towing
    < / Originating_System >
    < User_Id > MVNO_BEGA
    < / User_Id >
    < / original >
    < priority > 4
    < / priority >
    .
    .
    .
    < / order >

    I ask you to provide a way to deal with this issue in bpel.

    Thanks in advance for your valuable response and time.

    Thank you and best regards,
    Shanty

    Shanty,

    You cannot delete default namespace to load XML using any function in BPEL, same setting to the "unqualified" elementFormDefault won't help you.

    To remove the namespace by default, you must proceed as follows:

    1. create a variable tempXML of type xsd: String

    2. Add a Java Embedding activity, add the following code inside the Java embedding activity:

    Input XMLElement = (oracle.xml.parser.v2.XMLElement) getVariableData ("your Variable with load XML");
    StringWriter sw = new StringWriter();
    String outputString = null;
    Input.Print (SW);
    outputString = sw.toString ();
    Remove default namespace
    outputString = outputString.replaceAll ("xmlns =-" http://ProblemIsStillProblem.com-"", "");
    Remove null namespace, if any
    outputString = outputString.replaceAll ("xmlns =------"------"", "");
    payload chain put xml to update the game to a variable we can access outside the integration of java.
    setVariableData ("tempXML", outputString);

    3. prior to compile your BPEL process, add the following import statements just after the element:


    4. variable tempXml will be responsible changed XML, you can write to files as a string, or you can convert XML DOM object using the function of ora: parseEscapedXML .

    Thank you best regards &,.
    Diakité
    http://SOA-HOWTO.blogspot.com

Maybe you are looking for

  • How can I activate sim free new iphone is?

    Buy my first is iphone I just took delivery, but given that I bought unlocked and sim free, it will not be activated. Apple support said that I need a sim card. Like I did, maybe I should have, but I'm here. So if I want to use my iphone as an ipod a

  • black screen. no usable control

    HelloWhen I launch FF the window is black. The top of the window where the tools/address bar should be is transparent. I'm unable to open in safe mode.I can find the menu, but when I open the options, it opens also black.I have uninstalled twice. Onc

  • Pavilion P6-2310EF: Pavilion of the P6-2310EF Bios password

    Greetings, I am currently a few problems with my operating system. I need to change some settings in the bios of my P6-2310EF, but a password is requested. I read a few posts on this forum and it seems that the password is factory set. Is it possible

  • Hardware DAQ do not appear in LabVIEW measurement IO after loading 2014 DS2, uninstall 2014 DS2 and then reinstalling 2013 DS1.

    Hardware DAQ do not appear in the measures of e/s. I installed LabVIEW worm 2014 DS2 Developer suite and my request is not worked. I then uninstalled ver 2014 DS2 Developer suite and re-installed worm 2014 DS1 Developer suite that installs such as La

  • Draw two lines up to the maximum length of photo

    Hello The coordinates of the edge detection line is attached. How can I draw these two lines in an imageso line extends and catches up to the maximum length of the image. ? IE first extract the point of intersection of these two lines and look if it