Parsing XML reading Null

I have this code that read specific XML file character and gets its data.

import flash.net.URLLoader;

import flash.net.URLRequest;

import flash.events. *;

const this_XML:String = "Classes/Levels/killer.xml";

var inf:XML;

var xmlLoader:URLLoader;

var isDefending:Boolean;

var defLevel:Number;

It all starts

loadData();

function loadData()

{

INF = new XML();

xmlLoader = new URLLoader (new URLRequest (this_XML));

xmlLoader.addEventListener (Event.COMPLETE, parseXML);

}

function parseXML(evt:Event):void

{

INF = XML (evt.target.data);

xmlLoader.removeEventListener (Event.COMPLETE, parseXML);

Setup();

}

function Setup (): void {}

This. HPT = 100000;

trace (INF. Data.baseHP);

This. HPT = inf.data.baseHP + (inf.data.level * inf.data.levelIncrease);

This. HP is this. HPT;

trace (this.) HPT)

trace (this.) HP)

defLevel = inf.data.defLevel;

trace (defLevel)

MovieClip (parent) .healthCreateA ();

gotoAndPlay (2);

}

Each of these tracing instructions puts white.

What I am doing wrong?

Here is my XML file.

<? XML version = "1.0" encoding = "us-ascii"? >

< data >

< level "0" > < / level >

< baseHP > ' 999900' < / baseHP >

< defLevel > ' 250' < / defLevel >

< levelIncrease > ' 100' < / levelIncrease >

< / data >

I have it working now.

If I eliminate the .data. node, it works fine.

It would be inf.baseHP instead of inf.data.baseHP.

Thank you!

Tags: Adobe Animate

Similar Questions

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

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

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

  • the XML reader - need assistance to change the script, please help

    Hi all, I don't know if this is the right place for this question but I want to change a xml flash drive so that it creates the playlist with the name I want and not the default. Some can tell me please how to change this so that when the player has found songs in the "my_mp3s" folder it creates a named xml playlist

    'mymusic.xml ' instead of the default "audioplaylist.xml".  I tried to edit the script of the player's actions and overwrite changes but it still does not work, here is the code please help. I found this script online.

    Thank you

    Stop();

    / * ALL BUTTONS BELOW ARE MARKED FOR EDITABLE AND DON'T CHANGE, BUT IF YOU KNOW WHAT YOU ARE DOING
    THEN YOU CAN ACTUALLY CHANGE WHAT YOU WANT BUT FOR THIS APP WORKS CORRECTLY ONLY CHANGE IF NECESSARY
    ENTRIES... ONCE YOU HAVE MADE YOUR CHANGES, COPY AND PASTE THIS ENTIRE SCRIPT PAGE IN
    THE FIRST IMAGE OF THE SCENARIO THAT HE RIGHT THE SCRIPT THATS ALREADY THERE.
    The button labels for the XML READER text * /.
    SIDE MENU BUTTONS\\\
    Btn1.buttText.ButtonText.text = "DOWNLOAD FILES"; DO NOT CHANGE
    btn2.buttText.ButtonText.text = "SYSTEM VOLUME"; DO NOT CHANGE
    btn3.buttText.ButtonText.text = 'EDIT PLAYLIST XML'; DO NOT CHANGE
    btn4.buttText.ButtonText.text = "BURN CD"; DO NOT CHANGE
    btn5.buttText.ButtonText.text = "CREATE a FOLDER"; DO NOT CHANGE
    btn6.buttText.ButtonText.text = 'DELETE FILE'; DO NOT CHANGE
    btn7.buttText.ButtonText.text = "CDROM OPEN"; DO NOT CHANGE
    btn8.buttText.ButtonText.text = 'OPEN DVD'; DO NOT CHANGE
    btn9.buttText.ButtonText.text = "FTP CLIENT"; DO NOT CHANGE
    btn14.buttText.ButtonText.text = "VIEW PLAYLIST"; DO NOT CHANGE
    btn23.buttText.ButtonText.text = "INFO"; DO NOT CHANGE
    btn25.buttText.ButtonText.text = 'HELP '; DO NOT EDIT
    btn26.buttText.ButtonText.text = 'HELP MDM'; DO NOT CHANGE
    LOW BTNS
    btn19.buttText.ButtonText.text = "OPEN TRAY"; DO NOT CHANGE
    btn20.buttText.ButtonText.text = 'CLOSE CD TRAY'; DO NOT CHANGE
    btn21.buttText.ButtonText.text = "OPEN DVD TRAY"; DO NOT CHANGE
    btn22.buttText.ButtonText.text = "CLOSE DVD TRAY"; DO NOT CHANGE

    Here ARE the FUNCTIONS THAT CAN BE CHANGED, BUT THAT THOSE BRAND 'YOU CAN CHANGE this PATH' are sure to change
    MY DOWNLOAD FILES
    Btn1.onRelease = function() {}
    MDM. Dialogs.BrowseFile.filterList = "MP3 files | * .mp3 ';
    MDM System.exec ("E:\\My Music\\").    Path to the download of the file //YOU CAN CHANGE THIS path
    }
    SYSTEM VOLUME / / / DO NOT CHANGE
    btn2.onRelease = function() {}
    MDM. System.exec("sndvol32.exe");    System volume .exe
    }
    EDITING XML PLAYLIST / / / DO NOT CHANGE
    btn3.onRelease = function() {}
    MDM. System.exec (MDM. System.Paths.programFiles+"Mgamerz\\audiolist2.xml");    XML list
    }
    BURN CD / / YOU CAN CHANGE THIS PATH
    btn4.onRelease = function() {add your way here to your burning nero for example software
    MDM. System.exec (MDM. System.Paths.programFiles+"Nero\\nero.exe");
    }
    CREATE FOLDER / / / DO NOT CHANGE
    btn5.onRelease = function() {}
    MDM FileSystem.makeFolderUnicode ("C:\\Program Files\\Mgamerz\\Burn").    Creates a working folder for burning mp3s
    }
    DELETE FOLDER / / / DO NOT CHANGE
    btn6.onRelease = function() {///Deletes working folder if you want to remove it
    MDM. FileSystem.deleteFolder ("C:\\Program Files\\Mgamerz\\Burn", "ask", "Are you sure");
    }
    OPEN CDROM / / YOU CAN CHANGE THIS PATH
    btn7.onRelease = function() {///Opens change of cdrom drive letter to match your pc
    MDM System.exec("I:\\."); "
    }
    OPEN DVDROM / / YOU CAN CHANGE THIS PATH
    btn8.onRelease = function() {///Opens changing the letter to match your pc dvdrom drives
    MDM System.exec("I:\\."); "
    }
    FTP CLIENT / / YOU CAN CHANGE THIS PATH
    btn9.onRelease = function() {///File path to your ftp software (I use here the cover page)}


    MDM. System.exec (MDM. System.Paths.programFiles + "Microsoft FrontPage Bar\\Office\\Microsoft Office\\Office10\\Shortcut"); "
    }
    Buttons in the header at the top

    DRIVE C: / / / DO NOT EDIT
    btn10.onRelease = function() {///Opens to the top of drive c: for navigation
    MDM. System.exec (MDM. System.Paths.programFiles+"\\");
    }
    * btn11.onRelease = function() {///Opens to the top of the unit for navigation
    MDM System.exec("D:\\."); "    YOU CAN CHANGE THIS PATH
    }*/
    MY DOCUMENTS / / / NOT EDIT
    btn12.onRelease = function() {///Opens my documents for navigation}
    MDM. Dialogs.BrowseFile.filterList = "MP3 files | * .mp3 ';
    MDM. Dialogs.BrowseFile.show ("my Documents\\");
    }
    MP3 FILE / / / DO NOT CHANGE THE
    btn13.onRelease = function() {//main directory for mp3 files
    MDM. System.exec (MDM. System.Paths.programFiles+"Mgamerz\\my_mp3s\\");
    }
    VIEW PLAYLIST / / / DO NOT CHANGE
    btn14.onRelease = function() {///View playlist as a text file
    MDM. System.exec (MDM. System.Paths.programFiles+"Mgamerz\\my_mp3s\\mp3.t xt");
    }
    UPDATE XML FILE / / / DO NOT CHANGE
    btn15.onRelease = function() {///Creates xml playlist once new mp3s have been added
    MDM. System.exec (MDM. System.Paths.programFiles+"Mgamerz\\audiolist2.xml");
    }
    MINIMIZE BUTTON
    * btn16.onRelease = function() {//Minimizes application
    MDM. Application.Minimize (///DO) NOT EDIT
    }*/
    CLOSE BUTTON
    * btn17.onRelease = function() {///Closes application
    MDM. Application.Exit ('ask', ' are you sure you want to go out to? ") DO NOT EDIT
    }*/
    SCREEN CAPTURE DEVICE / / / DO NOT CHANGE
    btn18.onRelease = function() {///Screen capture sofdtware
    MDM. System.exec (MDM. System.Paths.programFiles+"Mgamerz\\apps\\Capture screen Studio\\css.exe");
    }
    OPEN CDROM TRAY / / YOU CAN CHANGE THIS PATH
    btn19.onRelease = function() {}
    MDM System.openCDTray ("I").
    }
    CDROM TRAY CLOSE / / YOU CAN CHANGE THIS PATH
    btn20.onRelease = function() {//Closes cdrom tray
    MDM System.closeCDTray ("I").
    }
    OPEN DVDROM PLATEAU / / YOU CAN CHANGE THIS PATH
    btn21.onRelease = function() {//Opens dvdrom
    MDM System.openCDTray ("H").
    }
    CLOSE TRAY DVDROM / / YOU CAN CHANGE THIS PATH
    btn22.onRelease = function() {//Closes dvdrom plateau
    MDM System.closeCDTray ("H").
    }

    * btn23.onRelease = function() {//DO NOT EDIT
    nextFrame();
    }*/
    HELP / / DO NOT EDIT
    btn25.onRelease = function() {//Closes dvdrom plateau
    MDM. System.exec (MDM. System.Paths.programFiles+"Mgamerz\\help.exe");
    }
    HELP OF MDM / / DO NOT EDIT
    btn26.onRelease = function() {//Closes dvdrom plateau
    MDM. System.exec (MDM. System.Paths.programFiles + "MDM helps 2.5 file\\MDM 2.5 UserManual.chm"); "
    }

    use:

    / * ALL BUTTONS BELOW ARE MARKED FOR EDITABLE AND DON'T CHANGE, BUT IF YOU KNOW WHAT YOU ARE DOING
    THEN YOU CAN ACTUALLY CHANGE WHAT YOU WANT BUT FOR THIS APP WORKS CORRECTLY ONLY CHANGE IF NECESSARY
    ENTRIES... ONCE YOU HAVE MADE YOUR CHANGES, COPY AND PASTE THIS ENTIRE SCRIPT PAGE IN
    THE FIRST IMAGE OF THE SCENARIO THAT HE RIGHT THE SCRIPT THATS ALREADY THERE.
    The button labels for the XML READER text * /.
    SIDE MENU BUTTONS\\\
    Btn1.buttText.ButtonText.text = "DOWNLOAD FILES"; DO NOT CHANGE
    btn2.buttText.ButtonText.text = "SYSTEM VOLUME"; DO NOT CHANGE
    btn3.buttText.ButtonText.text = 'EDIT PLAYLIST XML'; DO NOT CHANGE
    btn4.buttText.ButtonText.text = "BURN CD"; DO NOT CHANGE
    btn5.buttText.ButtonText.text = "CREATE a FOLDER"; DO NOT CHANGE
    btn6.buttText.ButtonText.text = 'DELETE FILE'; DO NOT CHANGE
    btn7.buttText.ButtonText.text = "CDROM OPEN"; DO NOT CHANGE
    btn8.buttText.ButtonText.text = 'OPEN DVD'; DO NOT CHANGE
    btn9.buttText.ButtonText.text = "FTP CLIENT"; DO NOT CHANGE
    btn14.buttText.ButtonText.text = "VIEW PLAYLIST"; DO NOT CHANGE
    btn23.buttText.ButtonText.text = "INFO"; DO NOT CHANGE


    btn25.buttText.ButtonText.text = 'HELP '; DO NOT EDIT
    btn26.buttText.ButtonText.text = 'HELP MDM'; DO NOT CHANGE
    LOW BTNS
    btn19.buttText.ButtonText.text = "OPEN TRAY"; DO NOT CHANGE
    btn20.buttText.ButtonText.text = 'CLOSE CD TRAY'; DO NOT CHANGE
    btn21.buttText.ButtonText.text = "OPEN DVD TRAY"; DO NOT CHANGE
    btn22.buttText.ButtonText.text = "CLOSE DVD TRAY"; DO NOT CHANGE

    Here ARE the FUNCTIONS THAT CAN BE CHANGED, BUT THAT THOSE BRAND 'YOU CAN CHANGE this PATH' are sure to change
    MY DOWNLOAD FILES
    Btn1.onRelease = function() {}
    MDM. Dialogs.BrowseFile.filterList = "MP3 files | * .mp3 ';
    MDM System.exec ("E:\\My Music\\").    Path to the download of the file //YOU CAN CHANGE THIS path
    }
    SYSTEM VOLUME / / / DO NOT CHANGE
    btn2.onRelease = function() {}
    MDM. System.exec("sndvol32.exe");    System volume .exe
    }
    EDITING XML PLAYLIST / / / DO NOT CHANGE
    btn3.onRelease = function() {}
    MDM. System.exec (MDM. System.Paths.programFiles+"Mgamerz\\audiolist2.xml");    XML list
    }
    BURN CD / / YOU CAN CHANGE THIS PATH
    btn4.onRelease = function() {add your way here to your burning nero for example software
    MDM. System.exec (MDM. System.Paths.programFiles+"Nero\\nero.exe");
    }
    CREATE FOLDER / / / DO NOT CHANGE
    btn5.onRelease = function() {}
    MDM FileSystem.makeFolderUnicode ("C:\\Program Files\\Mgamerz\\Burn").    Creates a working folder for burning mp3s
    }
    DELETE FOLDER / / / DO NOT CHANGE
    btn6.onRelease = function() {///Deletes working folder if you want to remove it
    MDM. FileSystem.deleteFolder ("C:\\Program Files\\Mgamerz\\Burn", "ask", "Are you sure");
    }
    OPEN CDROM / / YOU CAN CHANGE THIS PATH
    btn7.onRelease = function() {///Opens change of cdrom drive letter to match your pc
    MDM System.exec("I:\\."); "
    }
    OPEN DVDROM / / YOU CAN CHANGE THIS PATH
    btn8.onRelease = function() {///Opens changing the letter to match your pc dvdrom drives
    MDM System.exec("I:\\."); "
    }
    FTP CLIENT / / YOU CAN CHANGE THIS PATH
    btn9.onRelease = function() {///File path to your ftp software (I use here the cover page)}
    MDM. System.exec (MDM. System.Paths.programFiles + "Microsoft FrontPage Bar\\Office\\Microsoft Office\\Office10\\Shortcut"); "
    }
    Buttons in the header at the top

    DRIVE C: / / / DO NOT EDIT
    btn10.onRelease = function() {///Opens to the top of drive c: for navigation
    MDM. System.exec (MDM. System.Paths.programFiles+"\\");
    }
    * btn11.onRelease = function() {///Opens to the top of the unit for navigation
    MDM System.exec("D:\\."); "    YOU CAN CHANGE THIS PATH
    }*/
    MY DOCUMENTS / / / NOT EDIT
    btn12.onRelease = function() {///Opens my documents for navigation}
    MDM. Dialogs.BrowseFile.filterList = "MP3 files | * .mp3 ';
    MDM. Dialogs.BrowseFile.show ("my Documents\\");
    }
    MP3 FILE / / / DO NOT CHANGE THE
    btn13.onRelease = function() {//main directory for mp3 files
    MDM. System.exec (MDM. System.Paths.programFiles+"Mgamerz\\my_mp3s\\");
    }
    VIEW PLAYLIST / / / DO NOT CHANGE
    btn14.onRelease = function() {///View playlist as a text file
    MDM. System.exec (MDM. System.Paths.programFiles+"Mgamerz\\my_mp3s\\mp3.t xt");
    }
    UPDATE XML FILE / / / DO NOT CHANGE
    btn15.onRelease = function() {///Creates xml playlist once new mp3s have been added
    MDM. System.exec (MDM. System.Paths.programFiles+"Mgamerz\\mymusic.xml");
    }
    MINIMIZE BUTTON
    * btn16.onRelease = function() {//Minimizes application
    MDM. Application.Minimize (///DO) NOT EDIT
    }*/
    CLOSE BUTTON
    * btn17.onRelease = function() {///Closes application
    MDM. Application.Exit ('ask', ' are you sure you want to go out to? ") DO NOT EDIT
    }*/
    SCREEN CAPTURE DEVICE / / / DO NOT CHANGE
    btn18.onRelease = function() {///Screen capture sofdtware
    MDM. System.exec (MDM. System.Paths.programFiles+"Mgamerz\\apps\\Capture screen Studio\\css.exe");
    }
    OPEN CDROM TRAY / / YOU CAN CHANGE THIS PATH
    btn19.onRelease = function() {}
    MDM System.openCDTray ("I").
    }
    CDROM TRAY CLOSE / / YOU CAN CHANGE THIS PATH
    btn20.onRelease = function() {//Closes cdrom tray
    MDM System.closeCDTray ("I").
    }
    OPEN DVDROM PLATEAU / / YOU CAN CHANGE THIS PATH
    btn21.onRelease = function() {//Opens dvdrom
    MDM System.openCDTray ("H").
    }
    CLOSE TRAY DVDROM / / YOU CAN CHANGE THIS PATH
    btn22.onRelease = function() {//Closes dvdrom plateau
    MDM System.closeCDTray ("H").
    }

    * btn23.onRelease = function() {//DO NOT EDIT
    nextFrame();
    }*/
    HELP / / DO NOT EDIT
    btn25.onRelease = function() {//Closes dvdrom plateau
    MDM. System.exec (MDM. System.Paths.programFiles+"Mgamerz\\help.exe");
    }
    HELP OF MDM / / DO NOT EDIT
    btn26.onRelease = function() {//Closes dvdrom plateau
    MDM. System.exec (MDM. System.Paths.programFiles + "MDM helps 2.5 file\\MDM 2.5 UserManual.chm"); "
    }

  • 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

  • Get.get ('XML') returns Null

    I use AJAX in my program to recover the city and the State of the ZIP Code entered. It used to work now it isn't and I don't know why. I have not changed at all the javascript or the application process. During the decoding of the javascript, I discovered that get.get('XML') returns NULL.

    The javascript is as follows:
    <script language="JavaScript" type="text/javascript">
    <!--
    function pull_multi_value(pValue){
        var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
        'APPLICATION_PROCESS=SET_CITY_STATE',0);
    if(pValue){
    get.add('TEMPORARY_APPLICATION_ITEM',pValue)
    }else{
    get.add('TEMPORARY_APPLICATION_ITEM','null')
    }    
    gReturn = get.get('XML');
    alert('gReturn'+gReturn);
      if(gReturn){
            var l_Count = gReturn.getElementsByTagName("item").length;
            for(var i = 0;i<l_Count;i++){
                var l_Opt_Xml = gReturn.getElementsByTagName("item");
    var l_ID = l_Opt_Xml.getAttribute('id');
    var l_El = html_GetElement(l_ID);
    if(l_Opt_Xml.firstChild){
    var l_Value = l_Opt_Xml.firstChild.nodeValue;
    }else{
    var l_Value = '';
    }
    if(l_El){
    if(l_El.tagName == 'INPUT'){
    l_El.value = l_Value;
    }
    else if(l_El.tagName == 'SPAN' &&
    l_El.className == 'grabber'){
    l_El.parentNode.innerHTML = l_Value;
    l_El.parentNode.id = l_ID;
    }else{
    l_El.innerHTML = l_Value;
    }
    }
    }
    }
    get = null;
    }

    //-->
    </script>
    The on-demand process is as follows:
    DECLARE
    v_county VARCHAR2 (25);
    v_city VARCHAR2 (25);
    v_state VARCHAR2 (2);
    v_zip varchar2 (5);
    CURSOR cur_c
    IS
    SELECT the County, city, State, zip
    OF ZIP
    WHERE zip = v ("TEMPORARY_APPLICATION_ITEM");
    BEGIN
    HTP.p (: TEMPORARY_APPLICATION_ITEM);
    C BY cur_c
    LOOP
    v_city: = c.city;
    v_state: = c.state;
    v_zip: = c.zip;
    v_county: = c.county;
    END LOOP;
    OWA_UTIL.mime_header ("text/xml", FALSE);
    HTP.p ('Cache-Control: non-cache');
    HTP.p ('Pragma: non-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ("< body >");
    HTP.prn ("< desc > This XML genericly defines several elements < / desc > '");
    HTP.prn ("< item id ="P2_CO_CITY"> ' |") v_city | ("< / item >");
    -HTP.prn ("< option id ="P2_CO_STATE"value ="' | c.state |) '">' || c.State | ("< / option >");
    HTP.prn ("< item id ="P2_CO_STATE"> ' |") v_state | ("< / item >");
    HTP.prn ("< item id ="P2_COUNTY"> ' |") v_county | ("< / item >");
    HTP.prn ("< item id ="P2_CO_ZIP"> ' |") v_zip | ("< / item >");
    HTP.prn ("< / body >");
    EXCEPTION
    WHILE OTHERS
    THEN
    OWA_UTIL.mime_header ("text/xml", FALSE);
    HTP.p ('Cache-Control: non-cache');
    HTP.p ('Pragma: non-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ("< body >");
    HTP.prn ("< desc > This XML genericly defines several elements < / desc > '");
    HTP.prn ("< item id ="P2_CO_CITY"> ' |") SQLERRM | ("< / item >");
    HTP.prn ("< / body >");

    END;
    The javascript is run when someone tabs out of P2_CO_ZIP_LOOKUP. The HTML Form Element Attributes is:
    onChange = "pull_multi_value (this.value); »
    I ran the SQL statement from the On-Demand Process (ODP) in SQL Workshop and it worked fine.
    
    It doesn't work using FF or IE7 at my company but iIt works fine on APEX.ORACLE.COM. I tried using Firefox but could not find the cause of the problem.
    
    Login Credentials:
    Workspace:  RGWORK
    Application:  Online Certification Application Prototype (21405)     
    User:           tester
    Password:    test123
    Page     :     2 (Name and Address)
    
    Can someone help me?
    
    Thanks,
    Robert
    http:\\apexjscss.blogspot.com
    
    Edited by: sect55 on Mar 24, 2010 9:52 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    Hello:

    The AJAX call that happens from a public page? If so replace the '0' in the instantiation of the 'htmldb_Get' $v ('pFlowStepId').

    CITY

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

  • NULL values for some elements of the XML reading tree

    I am confirming that I interpret correctly all the elements of a custom data XML structure defined by my application (the schema is completely under my control).  Some of the elements in my XML tree are read as NULL values, even if similar items are readind as expected.  I have checked some obvious things like misspelling the names of keys, but have not yet find the problem.  Anyone who has debugged similar questions - what else could cause this?

    Example XML:

    
        1.0.0.0
        1000
        MyAppsName
        
            
                1000
                userDefined
                StructName
            
        
    
    

    And extracted C++ w/comments at the end of each line about what I see (DataManager is my class of CRUD operations):

    In DataManager.hpp:

    QVariant mCustomDataStructsTopLevel;
    QVariantMap mCustomDataStructsTopLevelMap;
    

    In DataManager.cpp:

    mCustomDataStructsTopLevel = mXda.load(Utils::dataFilePath(customDataStructsFileName));  // XmlDataAccess; verified loading w/no errors
    mCustomDataStructsTopLevelMap = mCustomDataStructsTopLevel.toMap();
    
    qDebug() << "appName element value: " << mCustomDataStructsTopLevelMap["appName"]; // Outputs "MyAppsName" as expected
    qDebug() << "lastId element value: " << mCustomDataStructsTopLevelMap["lastId"]; // Outputs null (specifically: QVariant(, ) ) - this is NOT expected
    qDebug() << "appVersion element value: " << mCustomDataStructsTopLevelMap["appVersion"]; // Outputs null (specifically: QVariant(QString, "") )  - this is NOT expected
    

    OK, I got the feeling (and actually hoped) it was a silly mistake of face-palm on my part (compared to a problem of BB10 who had little chance of getting fixed).

    The problem is that I copy the structure of custom data from Starter to my Active dir to my data directory to first install but do not crush him on subsequent launches, as the copy in the data directory is what the user changes and relies on.  I was not a delete and reinstall on each of my iterations, so I wasn't really loading the modified versions of my XML I wanted--just, I was getting a day old stale version which was actually for the items I didn't expect NULL values for nulls.  DOH!

  • 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

    
    
    
    
  • Parsing XML in a string with kXML

    Hello

    I make a web service call that returns the XML in a string. I need to analyze this with kXML. The Setup is complete, but I can't find any help with regard to the analysis of the chain.

    Any help?

    Thank you

    Teja.

    Have you tried that?

     try{
                HttpConnection connection = null;
                InputStream inputStream = null;
    
                connection = (HttpConnection) Connector.open(URL + MainUI.connectionParameters,Connector.READ_WRITE, true);
                inputStream = connection.openInputStream();
    
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                DocumentBuilder builder = factory.newDocumentBuilder();
                Document document = builder.parse( inputStream );
    
                Element rootElement = document.getDocumentElement();
                rootElement.normalize();
                displayNode( rootElement, 0 );
            }
            catch ( Exception e )
            {
                System.out.println( e.toString() );
            }
    
    private void displayNode( Node node, int depth )
        {        
    
            if ( node.getNodeType() == Node.ELEMENT_NODE )
            {
                StringBuffer buffer = new StringBuffer();
                //indentStringBuffer( buffer, depth );
                NodeList childNodes = node.getChildNodes();
                int numChildren = childNodes.getLength();
                Node firstChild = childNodes.item( 0 );
    
                // If the node has only one child and that child is a Text node, then it's of
                // the form  Text, so print 'Element = "Text"'.
    
    if ( numChildren == 1 && firstChild.getNodeType() == Node.TEXT_NODE )
                {
    
                            buffer.append( firstChild.getNodeValue() );
                            buffer.append( "\n" );
                            add( new RichTextField( buffer.toString() ));
                            add( new SeparatorField());
    
                }
                else
                {
    
                    parentName = node.getNodeName();
    
                    for ( int i = 0; i < numChildren; ++i )
                    {
                        displayNode( childNodes.item( i ), depth + 1 );
                    }
                }
            }
            else
            {
    
                String nodeValue = node.getNodeValue();
                if ( nodeValue.trim().length() != 0 )
                {
                    StringBuffer buffer = new StringBuffer();
                    indentStringBuffer( buffer, depth );
                    buffer.append( '"' ).append( nodeValue ).append( '"' );
                    add( new RichTextField( buffer.toString() ));
                }
            }
        }
    
  • Helps the Parseing XML

    Version: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production

    Hello

    I need assistance with an XML file to generate lines to insert into a table staged for further processing.

    There is an XML document that is loaded into a table in the database via a Web Service call.

    I need to query this table to get the XML code, loop through it to create folders, with the fields in a specific order and insert records into a table of staging.

    There are two columns that are not in the XML that are added during the process. I am including these tables as well.

    I know it is a bunch of "stuff", but I hope I've provided enough information to get help.

    The tables and insert queries:

    -This table contains the XML of the Web Service call

    CREATE TABLE exam_results
    (
    CLOB results_clob
    );

    INSERT INTO exam_results (results_clob)
    VALUES
    ("< result > < candidate > < ProgramCandidateID > 911221 < / ProgramCandidateID > < LastName > V361208 < / LastName > < FirstName > J361208 < / FirstName > < / candidate > < event > < ended > 1 < / filled > < CompleteDate > 2011 - 08 - 05T 10: 23:42.957 < / CompleteDate > < FormName > SSU11-05 < / FormName > < NumStarts > 2 < / NumStarts > < ProgramRegistrationID > SU0006510JV < / ProgramRegistrationID > < result > 564865 identifier < / result identifier >") < Sponsor > MySponsor < / sponsor > < StartTime > 2011 - 08 - 05T 08: 22:47.877 < / StartTime > < TestName > SSU11 < / TestName > < / Event > < start > < Start > < BrowserVersion > 8.0 < / BrowserVersion > < OperatingSystem > Windows NT 4.0 < / OperatingSystem > < / Start > < / begins > < Scores > < issues > < > < name > 105103 < / name > < SeqDelivered > 1 < / SeqDelivered > < response > 1 < / response > < key > 4 < / key > < seconds > 169.126 < / seconds > < Section > 1 < / Section > < / Question > < Question > < name > 261292 < / name > < SeqDelivered > 2 < / SeqDelivered > < answer > 3 < / response > < key > 3 < / key > < seconds > 97.984 < / seconds > < Section > 1 < / Section > < / Question > < Question > < name > 261241 < / name > < SeqDelivered > 3 < / SeqDelivered > < response > 3 < / response > < key > 3 < / key > < seconds > 87.579 < / seconds > < Section > 1 < / Section > < / Question > < Question > < name > 261451 < / name > < SeqDelivered > 4 < / SeqDelivered > < answer > 3 < / response > < key > 3 < / key > < seconds > 59.983 < / seconds (> < Section > 1 < / section > < / Question > < Question > < name > 264373 < / name > < SeqDelivered > 5 < / SeqDelivered > < response > 5 < / response > < key > 1 < / key > < seconds > 86.346 < / seconds > < Section > 1 < / Section > < / Question > < / Questions > < / Scores > < / result > ');

    -This table is to get 1 of the additional columns that must be included

    CREATE TABLE tracking_id_tbl
    (
    tracking_id NUMBER,
    customer_id NUMBER,
    launch_code VARCHAR2 (11)
    );

    INSERT INTO tracking_id_tbl (tracking_id, customer_id, launch_code)

    VALUES (557,2296267, 'SU0006510JV');

    -This table is to get the other extra column which must be included

    CREATE TABLE school_code_tbl
    (
    customer_id NUMBER,
    nb_id NUMBER,
    organization_id VARCHAR2 (8)
    );

    INSERT INTO school_code_tbl (customer_id, nb_id, organization_id)

    VALUES (2296267,911221, '12');

    -This table will receive the file created from the XML

    CREATE TABLE staging_tbl
    (
    results_data VARCHAR2 (4000)
    );

    To facilitate the XML file to read (we hope) here is a formatted version:

    < result >

    < candidate >

    < ProgramCandidateID > 911221 < / ProgramCandidateID >

    < name > V361208 < / LastName >

    J361208 < FirstName > < / name >

    < / candidate >

    < event >

    < finish > 1 < / completed >

    < completeDate > 2011 - 08 - 05T 10: 23:42.957 < / CompleteDate >

    SSU11-05 < FormName > < / FormName >

    < NumStarts > 2 < / NumStarts >

    < ProgramRegistrationID > SU0006510JV < / ProgramRegistrationID >

    ID of < result > 564865 < / ID results >

    < sponsor > MySponsor < / sponsor >

    < StartTime > 2011 - 08 - 05T 08: 22:47.877 < / StartTime >

    SSU11 < TestName > < / TestName >

    < / event >

    < start >

    < start >

    < > 8.0 BrowserVersion < / BrowserVersion >

    < OperatingSystem > Windows NT 4.0 < / OperatingSystem >

    < / start >

    < / starts >

    < scores >

    < questions >

    < question >

    < name > 105103 < / name >

    < SeqDelivered > 1 < / SeqDelivered >

    < response > 1 < / answer >

    < Key > 4 < / key >

    < seconds > 169.126 < / seconds >

    article <>1 < / Section >

    < / question >

    < question >

    < name > 261292 < / name >

    < SeqDelivered > 2 < / SeqDelivered >

    < response > 3 < / answer >

    < Key > 3 < / key >

    < seconds > 97.984 < / seconds >

    article <>1 < / Section >

    < / question >

    < question >

    < name > 261241 < / name >

    < SeqDelivered > 3 < / SeqDelivered >

    < response > 3 < / answer >

    < Key > 3 < / key >

    < seconds > 87.579 < / seconds >

    article <>1 < / Section >

    < / question >

    < question >

    < name > 261451 < / name >

    < SeqDelivered > 4 < / SeqDelivered >

    < response > 3 < / answer >

    < Key > 3 < / key >

    < seconds > 59.983 < / seconds >

    article <>1 < / Section >

    < / question >

    < question >

    < name > 264373 < / name >

    < SeqDelivered > 5 < / SeqDelivered >

    < response > 5 < / answer >

    < Key > 1 < / key >

    < seconds > 86.346 < / seconds >

    article <>1 < / Section >

    < / question >

    < / questions >

    < / scores >

    < / result >

    This XML file is for 1 card. There are several issues that are in the file. I reduced to only 5 is easier to see.

    The layout of the document to be inserted in the staging table is:

    Event.TestName

    Event.FormName

    Event.CompleteDate

    v_tracking_id

    Event.ProgramRegistrationID

    Event.StartTime

    Event.CompleteDate / * end * /.

    Candidate.LastName

    Candidate.FirstName

    Candidate.MiddleName (the middle name does not exist in the file XML then return null)

    Candidate.ProgramCandidateID

    v_school_code

    Candidate.CustomProperties.Answer (this does not exist in the file XML then return null)

    Event.ResultID

    Event.NumStarts

    Event.Completed

    Event.Sponsor

    Scores.Questions.Question.Name

    Scores.Questions.Question.Section

    Scores.Questions.Question.SeqDelivered

    Scores.Questions.Question.Key

    Scores.Questions.Question.Answer

    Scores.Questions.Question.Seconds

    Starts.OperatingSystem

    Starts.BrowserVersion

    The expected output is:

    INSERT INTO staging_tbl (results_data)
    VALUES ('SSU11,SSU11-05,08/05/2011,557,SU0006510JV,08:22:47,10:23:42,V361208,J361208,,911221,12,,564865,2,1,MySponsor,105103,1,1,4,1,169.126,Windows NT 4.0,8.0");

    INSERT INTO staging_tbl (results_data)
    VALUES ('SSU11,SSU11-05,08/05/2011,557,SU0006510JV,08:22:47,10:23:42,V361208,J361208,,911221,12,,564865,2,1,MySponsor,261292,1,2,3,3,97.984,Windows NT 4.0,8.0");

    INSERT INTO staging_tbl (results_data)
    VALUES ('SSU11,SSU11-05,08/05/2011,557,SU0006510JV,08:22:47,10:23:42,V361208,J361208,,911221,12,,564865,2,1,MySponsor,261241,1,3,3,3,87.579,Windows NT 4.0,8.0");

    INSERT INTO staging_tbl (results_data)
    VALUES ('SSU11,SSU11-05,08/05/2011,557,SU0006510JV,08:22:47,10:23:42,V361208,J361208,,911221,12,,564865,2,1,MySponsor,261451,1,4,3,3,59.983,Windows NT 4.0,8.0");

    INSERT INTO staging_tbl (results_data)
    VALUES ('SSU11,SSU11-05,08/05/2011,557,SU0006510JV,08:22:47,10:23:42,V361208,J361208,,911221,12,,564865,2,1,MySponsor,264373,1,5,1,5,86.346,Windows NT 4.0,8.0");

    The Questions/Question, is what makes a separate line if the values for the other fields would be the same for however many questions is in the XML file.

    That's what I've tried so far:

    DECLARE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             CURSOR get_results_cur
    IS
    SELECT results_clob
    Of exam_results;

    get_results_rec XMLTYPE.
    get_results_clob CLOB.
    NUMBER (38) v_count: = 1;


    v_result VARCHAR2 (32000);
    v_tracking_id tracking_id.tracking_id_tbl%TYPE;
    v_school_code organization_id.school_code_tbl%TYPE;

    BEGIN
    OPEN get_results_cur.
    SEEK get_results_cur INTO get_results_clob;
    CLOSE Get_results_cur;

    get_results_rec: = xmltype.createxml (get_results_clob);

    SELECT tracking_id
    school_code
    IN v_tracking_id
    v_school_code
    OF ti tracking_id_tbl
    JOIN school_code_tbl ON ti.customer_id = sc.customer_id sc
    WHERE ti.launch_code = get_results_rec. EXTRACT ('/ Result/Event/ProgramRegistrationID/text()').getstringval () AND)
    nb_id = get_results_rec. EXTRACT ('/ Result/Candidate/ProgramCandidateID/text()').getstringval ();)

    While get_results_rec. EXISTSNODE ('/ / result [' | v_count |]) ']') = 1
    LOOP
    v_result: =.
    (get_results_rec. EXTRACT ('/ results/event/TestName [' | v_count | / text () ']) .getstringval ())
    || ','
    || (get_results_rec. EXTRACT ('/ results/event/FormName [' | v_count | / text () ']) .getstringval ())
    || ','
    || ((get_results_rec. EXTRAIT ('/ résultats/événement/CompleteDate [' || v_count || / text () SUBSTR']) .getstringval ()), 1, 10)
    || ','
    || v_tracking_id
    || ','
    || (get_results_rec. EXTRACT ('/ results/event/ProgramRegistrationID [' | v_count | / text () ']) .getstringval ())
    || ','
    || ((get_results_rec. EXTRAIT ('/ résultats/événement/StartTime [' || v_count || / text () SUBSTR']) .getstringval ()), 12.8)
    || ','
    || ((get_results_rec. EXTRAIT ('/ résultats/événement/CompleteDate [' || v_count || / text () SUBSTR']) .getstringval ()), 12.8)
    || ','
    || (get_results_rec. EXTRACT ('/ result/candidate/name [' | v_count | / text () ']) .getstringval ())
    || ','
    || (get_results_rec. EXTRACT ('/ result/candidate/name [' | v_count | / text () ']) .getstringval ())
    || ',,'
    || -(get_results_rec. Extract('/result/candidate/MiddleName [' || v_count ||) '] / text () ') .getStringVal ()); ',' ||
    (get_results_rec. EXTRACT ('/ result/candidate/ProgramCandidateID [' | v_count | / text () ']) .getstringval ())
    || ','
    || v_school_code
    || ','
    || (get_results_rec. EXTRACT ('/ results/event/result identifier [' | v_count | / text () ']) .getstringval ())
    || ','
    || (get_results_rec. EXTRACT ('/ results/event/NumStarts [' | v_count | / text () ']) .getstringval ())
    || ','
    || (get_results_rec. EXTRACT ('/ results/event/completed [' | v_count | / text () ']) .getstringval ())
    || ','
    || (get_results_rec. EXTRACT ('/ results/event/sponsor [' | v_count | / text () ']) .getstringval ());
    || ','

    -Add the results of the first question

    || ','
    || (get_results_rec. EXTRACT ('/ result, departures, Start, OperatingSystem [' | v_count | / text () ']) .getstringval ())
    || ','
    || (get_results_rec. EXTRACT ('/ result, departures, Start, BrowserVersion [' | v_count | / text () ']) .getstringval ());

    v_count: = v_count + 1;

    INSERT INTO staging_tbl (results_data)
    VALUES (v_result);

    END LOOP;
    END;

    What can clear?

    Thank you

    Joe

    You have several questions in the XML, so when flattened document you will have several lines trying to extract in v_result.  Where the error.  You will need to either loop

    for rec in (select... from XMLTable...)

    loop

    insert into staging_tbl...

    end loop;

    or make an insert select

    insert into staging_tbl (results_data)

    Select...

    from XMLTable...

  • Parsing XML feed

    I have codes as follows:
    SET SERVEROUTPUT ON
    SET DEFINE OFF
    DECLARE
    feedURL VARCHAR2 (500);
    xmlparser parser. Analyzer;
    feedXML xmldom. DOMDocument;
    titles xmldom. DOMNodeList;

    titles_found NUMBER;
    curNode xmldom. DOMNode;
    textChild xmldom. DOMNode;

    BEGIN

    feedURL: = '3Aproject % http://192.168.2.30/cgi-bin/query-meta?v%3Asources=cansumtest & v = query-meta & query = HOOD & render.function = xml-feed-display & content-type = text/xml';

    Parser: = xmlparser.newParser;
    feedXML: = xmlparser.parse (feedURL);
    xmlparser.freeParser (parser);

    titles: = xmldom.getElementsByTagName(feedXML,'*');

    FOR j IN LOOP 1.xmldom.getLength (titles)
    curNode: = xmldom.item(titles,j-1);
    textChild: = xmldom.getFirstChild (curNode);

    dbms_output.put_line ('('||) LPAD(j,2) |') '|| xmldom.getNodeValue (textChild));

    END LOOP;
    xmldom.freeDocument (feedXML);

    END;

    Above codes generate result:
    (1)
    (2)
    (3)
    (4)
    (5)
    (6)
    (7)
    (8)
    (9)
    (10)
    (11) 150
    * (12) H0OH18101 *.
    (13) < span class = "vivbold qt0" > </span > HOOD, RONALD E
    (14)
    (15)
    (16) 155
    * (17) H8OH07073 *.
    (18) < span class = "vivbold qt0" > </span >, RONALD EDWARD HOOD
    (19)
    (20)
    (21)
    (22)
    (23) H0oh18101, hood, Ronald
    (24)
    (25) Edward, Hood, Ronald
    PL/SQL procedure successfully completed.

    You can see by browsing, oracle shows all items in the feed url. From the results above, I need to display only items 12 and 17, and ignore the rest. I also provide XML feed below:

    <? XML version = "1.0"? >
    -vce >
    < param name = "v: sources" value = "cansumtest" / >
    < param name = "v: project ' value = 'query-meta' / >
    < param name = "query" value = "HOOD" / >
    < param name = "render.function" value = "xml-feed-display" / > "
    < param name = "content-type" value = "text/xml" / >
    -added source = test-strictly 'test-strictly"name ="cansumtest"type ="vse"modified"1355412925"="1.3"over-request = num = '200' status 'questioned' = asked ="200"query-xml-Jack in charge ="query-xml-support' vse - vse = 'vse - vse"total-results = '2' admin-url ="http://velocity/vivisimo/cgi-bin/admin"stem"depluralize"stem2 = 'none' = list of stopwords = 'none' search-ms ="1"recovery-ms = '0' total-results-with-duplicates = '2' retrieved '2' = >
    < parse url = "http://127.0.0.1:7205/search?query-xml=%3cterm%20field%3d%22query%22%20str%3d%22HOOD%22%20position%3d%220%22%20processing%3d%22strict%22%20input-type%3d%22user%22%20%2f%3e & mode = normal & strength-binning binning = 0 & max = 300 & start = 0 & num = 200 & staging = 0 & collection = cansumtest & r-o-p = 0 & sort keys = 1 & shingles = 1 & sum = 1 & = 1 & cache-data cache = 0 & score = 0 & show-duplicates =" 0 & gen - key = 0 & n-collapse = 0 & is is collapsed binning = 0 "start time"57"end of time = = http ="64"status" 200 OK"status =" "read treated analysis ' recovered '2' = / >" "
    < / source added >
    -< path list = "" num = "2" level = '0' start '0' by = '10' = > "
    -document url = "oracle://192.168.2.19:1521 / orcl /?" key - val = 9' rank = '0' source = "cansumtest" score = "0.111111" truncated url = "oracle://192.168.2.19:1521 / orcl /?" key - val = 9"context =" 3astate % http://192.168.2.30/cgi-bin/query-meta?v%3afile=viv_MLtzUk & v = % 28root % 29% 7croot & v % 3aframe = tree & subquery = id % 3aNdoc0 & % active 3d = root & v % 3asubsearch = 1 & ">
    < = "size" type = "text" > 150 happy name < / content >
    < happy name = "CAND_ID" type = "text" > H0OH18101 < / content >
    < happy name = "CAND_NM" type = "text" > < span class = "vivbold qt0" > </span > HOOD, RONALD E < / content >
    < happy name = "extract" type = "html" / >
    < / document >
    -document url = "oracle://192.168.2.19:1521 / orcl /?" key - val = 4015"="1"source ="cansumtest"rank score = '0.1' truncated url =" oracle://192.168.2.19:1521 / orcl /? " key - val = 4015"context =" 3astate % http://192.168.2.30/cgi-bin/query-meta?v%3afile=viv_MLtzUk & v = % 28root % 29% 7croot & v % 3aframe = tree & subquery = id % 3aNdoc1 & % active 3d = root & v % 3asubsearch = 1 & ">
    < happy name = "size" type = "text" > 155 < / content >
    < happy name = "CAND_ID" type = "text" > H8OH07073 < / content >
    < happy name = "CAND_NM" type = "text" > < span class = "vivbold qt0" > </span >, RONALD EDWARD HOOD < / content >
    < happy name = "extract" type = "html" / >
    < / document >
    < / list >
    -< tree base-url = "" http://192.168.2.30/cgi-bin/query-meta?v%3afile=viv_MLtzUk & v: state = ' recluster-base-url = "http://192.168.2.30/cgi-bin/query-meta?v%3afile=viv_MLtzUk &" > "
    -< node type = 'high' level = '0' Sindocs = '2' active = '1' subnodes = '0' ts = "|" root' ls = "root |" root' bs = "|" root">
    -< node type = 'document' level = '1' Sindocs = '1' ts = "(root) |" root' ls = "root |" N0"bs =" (root) | " N0 ">"
    < description > H0oh18101, hood, Ronald < / description >
    < / node >
    -< node type = 'document' level = '1' Sindocs = '1' ts = "(root) |" root' ls = "root |" N1"bs =" (root) | " N1 ">"
    < description > Edward, Hood, Ronald < / description >
    < / node >
    < / node >
    < / tree >
    < / vce >

    The easiest way is probably to apply a regular expression, either by post-processing of the column:

    SQL> select cand_id
      2       , regexp_replace(cand_nm, '<[^>]+>') as cand_nm
      3  from xmltable(
      4         '/vce/list/document'
      5         passing xdburitype('/public/feed.xml').getxml()
      6         columns
      7           cand_id   varchar2(30)  path 'content[@name="CAND_ID"]'
      8         , cand_nm   varchar2(80)  path 'content[@name="CAND_NM"]'
      9       )
     10  ;
    
    CAND_ID                        CAND_NM
    ------------------------------ --------------------------------------------------------------------------------
    H0OH18101                      HOOD, RONALD E
    H8OH07073                      HOOD, RONALD EDWARD
     
    

    or directly in XMLTable:

    SQL> select cand_id
      2       , cand_nm
      3  from xmltable(
      4         '/vce/list/document'
      5         passing xdburitype('/public/feed.xml').getxml()
      6         columns
      7           cand_id   varchar2(30)  path 'content[@name="CAND_ID"]'
      8         , cand_nm   varchar2(80)  path 'ora:replace(content[@name="CAND_NM"], "<[^>]+>", "")'
      9       )
     10  ;
    
    CAND_ID                        CAND_NM
    ------------------------------ --------------------------------------------------------------------------------
    H0OH18101                      HOOD, RONALD E
    H8OH07073                      HOOD, RONALD EDWARD
     
    
  • 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

Maybe you are looking for