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

Tags: Adobe Animate

Similar Questions

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

  • 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;
    }
    
  • 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.

  • failed to parse

    win xp, HP all in one single 2175

    failed to parse, or no communication with the driver for scanning.

    reinstalled the software for the HP device

    Doctor HP: only WIA is in order

    The software that I use to keep my cleaned registry is free from a company called iObit.  The tool is called the Advanced System Care.  The software is third, it's up to you if you want to use it, but I use the free version at work and the paid version at home, to keep my PC, cleaned registry and have not had any problems with both versions.  Here a link to the site where you can get it.  If you're not comfortable software download that you are not familiar with, then I suggest to ask someone trust you who is good with the PC if they know of a program that can clean your registry for you.  Other that that, you may need to pay someone to clean it up.  Uninstall the printer software before you clean the registry, so that cleaning can get all the files, get rid of that.  If uninstalling, cleaning the registry and reinstall does not, correct it let me know.

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

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

  • Store functions/procedures in BI Publisher - failed to load XML

    Hello world

    I am trying to call a function to return a set of rows with BI Publisher. When I want to look at the data on the 'Data' tab, I get "Failed to load XML".

    Here are the steps I took:

    Step 1: created a type

    create type numset_t as table of number;
    

    Step 2: Creating the function

    create or replace function f1(x number) return numset_t pipelined is
    begin
    for i in 1..x loop
    pipe row(i);
    end loop;
    return;
    end;
    

    Step 3: Under "Data sets", I created a SQL query with the following options/code

    Code:

    select * from table(f1(3))
    

    Options: Data Source - my selected schema

    SQL type: Non-standard SQL

    Name of tag line: test

    How can I check my data using the button "data"?

    Thank you

    Here's the steps/documentation on how to call a function from BI Publisher:

    #1) make sure you use SYS_REFCURSOR.

    (#2) create your function as below:

    CREATE OR REPLACE FUNCTION FUNC1 (P1 VARCHAR2) RETURN SYS_REFCURSOR IS
    
       XDO_CURSOR SYS_REFCURSOR;
    BEGIN
     IF P1 = 'USA' THEN
     OPEN XDO_CURSOR FOR
     'SELECT  TO_CHAR(SYSDATE,''MM-DD-YYYY'') AS CURRENT_DATE, X.STATE FROM SchemaName.XX1 X WHERE X.ID IN (100,200,400)';
     RETURN XDO_CURSOR;
     ELSE
     OPEN XDO_CURSOR FOR
     'SELECT  TO_CHAR(SYSDATE,''MM-DD-YYYY'') AS CURRENT_DATE, X.STATE FROM SchemaName.XX1 X WHERE X.ID IN (300,500,600)';
     RETURN XDO_CURSOR;
     END IF ;
    END FUNC1;
    

    (#3) connect as system and grant execute the user to BI

    GRANT EXECUTE ON SchemaName.FUNC1 TO BI_USER;
    

    (#4) under the data model, create a data set with the following (as for example):

    BI requires the variable xdo_cursor as the output, so do not change the name of the variable.

    DECLARE
       type refcursor is REF CURSOR;
       xdo_cursor refcursor;
    BEGIN
       :xdo_cursor := SchemaName.func1(:P1);
    END;
    

    Type of SQL procedure call =

    Thank you. I hope that everything that troubleshoot you.

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

  • 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

  • last} character causes parse XML error

    Hi I m importing source code c# in flex using the mx tag: Model by placing the source code as CDATA in a node of an XML file. The strange thing is that the Flex compiler throw errors in compiling strange if closing} is left in the CDATA string. {If I remove the last} char, the program compiles and runs correctly, and I have to manually add the} later. Anyone got any ideas?

    Here is an example of XML code that works because the final} is missing. If I put it in the compiler Flex fails.

    <? XML version = "1.0" encoding = "utf-8"? >
    < codeTemplate >
    < code >
    <! [CDATA]
    Class x
    {
    class x()
    {
    }
    []] >
    < code >
    < / codeTemplate >

    I have not the time to try it now, but I expect that you will not have the same problem with a .as file. You can make an actionscript class with a static property of type XML and then access in your mxml component:

    public class MyXMLData {}
    public static var codeTemplate:XML =

    Class x
    {
    class x()
    }...
    ]]>
    ;
    }

    And then in your MXML component,

    import...
    var myXML:XML = MyXMLData.codeTemplate;

    Tim

  • Stop Error Message "Failed to parse the SQL query" appearing

    Hello

    I have a sql query that is built into a string and then compiled and executed at run time. This query lies in a region and is returned.

    The query uses a view that uses a database link. If the link of database falls down for some reason, the "Failed to Parse SQL Query" message and the details on the DB link not working. However, I want to be able to implement my own error message when this happens, but I can't find a way to capture the error. I have put an exception handler in the region but because the code is technically correct and only fails at runtime that is not catching it.

    Is anyway to catch this error and display my message?

    Thank you
    -Mark

    Hello

    Try to use condition to hide the region and instead of this report will show another area where is your custom error message?

    BR, Jari

  • Failed to parse the SQL query by user

    Hi all

    in my application, I have a piece of text with a button "submit". In this article, I type a name and a report after the element region show me the result (s). This works for all my users (> 2000) perfectly, but that users become an error in the area of the report:

    Failed to parse the SQL query:
    ORA-01403: no data found

    We try this with the same searchstring on the same computer/browser. If I connected the result is ok, if the logged on user, the error message appears. If I try this on the user's computer with me connected, ok result. If the user try this on another pc, error results.

    I have a production and a developer workspace. In the developer workspace the user can try this perfectly without errors. That in the space of productive work, clear the error.

    The SQL-Select in the ist verry simple reprirt:

    Select id
    name
    raum
    table
    where instr (upper (name), upper (:P60_SEARCH)) > 0

    However, all users can use this search box with report perfectly, only this one user has the error. There is no restrictions on this point or a State.

    Can someone help me?

    Hi Carsten,

    I don't think that there is a way to do it.

    Could you please mark the correct and useful answers in this thread? Otherwise I'll never get near Andy ;) :)

    Denes Kubicek
    ------------------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    ------------------------------------------------------------------------------

  • Help parsing XML message using PeopleCode

    Hi all

    I'm new to web services and XML, but was able to consume a WSDL and call the web service successfully.

    I am now trying to parse the XML message that I receive as an answer and to retrieve values that I need and with the response analysis problems. Here's what I did and the my AE Test code. Basically, I'm trying to navigate to the 'Results' element in the response, and then use GetChildNode to get the child nodes, then use FindNode to find items and their values.

    Here's the WSLD I used to create the web service in PS. I only need WSDL operation doSearch_3_15
    [https://www.epls.gov/epls/services/EPLSSearchWebService?wsdl]

    My PC below calls the web service and passes the family name "ZOD" as a search parameter, and this should return 3 results back.

    I'm grabbing the response back and analyse to extract the values I need.

    + & inXMLDoc = CreateXmlDoc(""); +
    + & ret = inXMLDoc.ParseXmlString (& answer. GenXMLString()); +

    The question that I have is to be able to get 'inside' the results node (there are 3 of them) and browse the child nodes and get my values.

    AE Test code:

    Local channel & charge useful, & responseStr, last;
    Local Message msg & response;
    Local XmlDoc xml & inXMLDoc;
    Local of the array of XmlNode GetElements, RecordList, & field1List & aResultsNode;
    Local XmlNode RecordNode & ClassificationNode;
    Local file & MYFILE;

    + & FilePath = ' / psoft/ultimate.9/fpsdv1/prod/ap/files / '; +
    "+ & FileName = uhc_report.xml" +;
    + & MYFILE = GetFile (& FilePath | & FilePath_Absolute of filename, "W", %); +.

    + & payload = "<? XML version = "1.0"? "> < doSearch xmlns ="https://www.epls.gov/epls/services/EPLSSearchWebService">"; +
    + & first = ""; +
    + & last = "ZOD"; +
    + & payload = & load useful | "< query > < first >. and first. "< / first > < last > | & last. "< / last > < / query > < / doSearch > ';" +

    + & xml = CreateXmlDoc (& payload); +
    + & msg = CreateMessage (Operation.DOSEARCH_3_15, IntBroker_Request %) +;
    + & msg. SetXmlDoc(&xml); +

    + & reply = IntBroker.SyncRequest % (& msg); +

    If All(&reply) then

    If & MYFILE. IsOpen then
    + & MYFILE. WriteString (& response. GenXMLString()); +
    On the other
    MessageBox (0, "", 0, 0, "cannot Open File.");
    End - If;

    + & inXMLDoc = CreateXmlDoc(""); +
    + & ret = inXMLDoc.ParseXmlString (& answer. GenXMLString()); +

    If & then ret

    + & field1List = & inXMLDoc.GetElementsByTagName ("results"); +

    If & field1List.Len = 0 Then
    MessageBox (0, "", 0, 0, "GetElementsByTagName node not found");
    Error ("GetElementsByTagName Node not found");
    + / * perform some processing of error * / +.
    On the other
    J = 1 & at & field1List.Len
    If & j > 1 Then
    + MessageBox(0, "", 0, 0, &field1List [&j].) NodeName | " = " | field1List [& j]. NodeValue); +

    + & RecordNode = & inXMLDoc.DocumentElement.GetChildNode (& j); +
    If & RecordNode.IsNull then
    MessageBox (0, "", 0, 0, "GetChildNode not found");
    On the other
    + & ClassificationNode = & RecordNode.FindNode ("classification"); +
    If & ClassificationNode.IsNull then
    MessageBox (0, "", 0, 0, "FindNode not found");
    On the other
    + & SDN_TYPE = Substring (& ClassificationNode.NodeValue, 1, 50); +
    MessageBox (0, "", 0, 0, "& SDN_TYPE =" |) (& SDN_TYPE);
    End - If;
    End - If;

    End - If;
    -End;
    End - If;

    MessageBox (0, "", 0, 0, & inXMLDoc.DocumentElement.NodeName);

    On the other
    + / * perform some processing of error * / +.
    MessageBox (0, "", 0, 0, "error.) ParseXml");
    End - If;

    On the other
    MessageBox (0, "", 0, 0, "error.) No response").
    End - If;


    See the link below for the web service XML response with a few Notes message. As a link between the response as an XML doc (had to add .txt to xml extension to download).  I appreciate your help and comments.
    http://compshack.com/files/XML-message.PNG
    http://compshack.com/files/uhc_report.xml_.txt

    And here is the result of my AE Test. I'm able to find 3 County results, that I expected because I have 3 files returned from the web service, but fails for some reason, GetChildNode.

    results = (0,0)

    GetChildNode not found (0.0)

    results = (0,0)

    GetChildNode not found (0.0)

    results = (0,0)

    GetChildNode not found (0.0)

    Published by: Maher on 12 March 2012 10:21

    Published by: Maher on 12 March 2012 10:41

    Hello

    I made a few adjustments to your code.
    First of all you need not create an XMLDOC object on the IB response, since it is already a XML.
    Instead use something like this:

    / * Send & receive message * /.
    & ResMsg = % IntBroker.SyncRequest (& ReqMsg);
    / * Get XMLDOC of the response message * /.
    & xml = ResMsg.GetXmlDoc ();
    strxml = & xml. GenFormattedXmlString();
    / * read the reply * /.
    & aNodeData = & xml. GetElementsByTagName ("yournodename")

    Now your code fixed

    &inXMLDoc = CreateXmlDoc("");
    &ret = &inXMLDoc.ParseXmlFromURL("c:\temp\test.xml");
    If &ret Then
       &field1List = &inXMLDoc.GetElementsByTagName("results");
       If &field1List.Len = 0 Then
          MessageBox(0, "", 0, 0, "GetElementsByTagName Node not found");
          Error ("GetElementsByTagName Node not found");
          /* do error processing */
       Else
          For &j = 1 To &field1List.Len
             If &j > 1 Then
                MessageBox(0, "", 0, 0, &field1List [&j].NodeName | " = " | &field1List [&j].NodeValue);
                &RecordNode = &field1List [&j];
    
                &RecordChildNode = &RecordNode.GetChildNode(&j);
                If &RecordChildNode.IsNull Then
                   MessageBox(0, "", 0, 0, "GetChildNode not found");
                Else
                   MessageBox(0, "", 0, 0, "&RecordChildNode name:" | &RecordChildNode.NodeName);
    
                   &ClassificationNode = &RecordNode.FindNode("classification");
                   If &ClassificationNode.IsNull Then
                      MessageBox(0, "", 0, 0, "FindNode not found");
                   Else
                      &SDN_TYPE = Substring(&ClassificationNode.NodeValue, 1, 50);
                      MessageBox(0, "", 0, 0, "&SDN_TYPE = " | &SDN_TYPE);
                   End-If;
    
                End-If;
             End-If;
          End-For;
       End-If;
       MessageBox(0, "", 0, 0, &inXMLDoc.DocumentElement.NodeName);
    
    Else
       /* do error processing */
       MessageBox(0, "", 0, 0, "Error. ParseXml");
    End-If;
    

    Result:
    PeopleTools 8.51.12 - Application Engine
    Copyright (c) 1988-2012 Oracle and/or its affiliates.
    All rights reserved

    results = (0,0)
    Game number of messages: 0
    Number of messages: 0
    Reason for the message: results = (0.0) (0.0)

    & RecordChildNode name: address (0,0)
    Game number of messages: 0
    Number of messages: 0
    Reason for the message: & RecordChildNode name: address (0.0) (0.0)

    & SDN_TYPE =
    Individual (0,0)
    Game number of messages: 0
    Number of messages: 0
    Reason for the message: & SDN_TYPE =
    Individual (0.0) (0.0)

    results = (0,0)
    Game number of messages: 0
    Number of messages: 0
    Reason for the message: results = (0.0) (0.0)

    & RecordChildNode name: agencyUID (0,0)
    Game number of messages: 0
    Number of messages: 0
    Reason for the message: & RecordChildNode name: agencyUID (0.0) (0.0)

    & SDN_TYPE =
    Individual (0,0)
    Game number of messages: 0
    Number of messages: 0
    Reason for the message: & SDN_TYPE =
    Individual (0.0) (0.0)

    results = (0,0)
    Game number of messages: 0
    Number of messages: 0
    Reason for the message: results = (0.0) (0.0)

    & RecordChildNode name: classification (0,0)
    Game number of messages: 0
    Number of messages: 0
    Reason for the message: & RecordChildNode name: classification (0.0) (0.0)

    & SDN_TYPE =
    Individual (0,0)
    Game number of messages: 0
    Number of messages: 0
    Reason for the message: & SDN_TYPE =
    Individual (0.0) (0.0)

    soapenv:envelope (0,0)
    Game number of messages: 0
    Number of messages: 0
    Reason for the message: soapenv:Envelope (0.0) (0.0)
    Application Engine TEST_AE program ended normally

    Find the differences :)

    Published by: Hakan Biroglu on March 12, 2012 19:22

  • parse xml timestamp labview in javascript

    Hi, im reading XML files created from labview7.1 with javascript and it works fine, the only problem is that I don't know how to parse the timestamp. For DS

    ...


    Date of Eximination


    4


    0



    0



    -916291696



    0


    ...

    should be the date of 2011-01-24 and

    ...


    Date of Eximination


    4


    0



    0



    -916205296



    0


    ...

    2011-01-25 indices?

    It seems to work

    
    
    
    

Maybe you are looking for