To access the elements of the XML object

A web service is back from the data to me as an XML object. I can access the items in the XML like this:

& lt; cfset username = #XMLDocument.login.username # & gt; and if I have this dump to screen with cfoutput I get just the user name. But if I try to user the variable username as an attribute within a url cflocation it appears in the attributes with the xml notation, for example in the attributes will be:

username = & amp; Lt;? XML = 20version & amp %; quot; 1.0 & amp; quot; % 20encoding = & amp; quot; UTF-8 & amp; quo t;? & amp; GT;

Any help much appreciated. Thank you

> Username>

> I can't access like this:
> #XMLDocument.login.username # this will show all
> 'User_name '.

Are you sure? If you view the source, don't you get the whole node?

> but if I send these details as attributes, as follows:<>
> url = ' index.cfm? username = #XMLDocument.login.username #... Can I get xml
> formatting instead of just the user name.

Well Yes.

#XMLDocument.login.username # designates the entire node, not just the
xmlText bit between the tags as you seem to expect. You want to
just the xmlText node.

You should probably read the docs on how CF manages XML:
http://livedocs.Adobe.com/ColdFusion/8/htmldocs/help.HTML?content=XML_02.html.

--
Adam

Tags: ColdFusion

Similar Questions

  • Unable to access the doc object

    Hello

    I'm unable to access the doc object, as in doc.mailForm ().

    I tried to access this object as follows, a field event and a global module:

    This.doc (undefined)

    App.doc (undefined)

    Event.Target.doc (undefined)

    doc (blocks JavaScript).

    The app object is OK, I can use app.alert ().

    I use Designer version 8.2.1, using a dynamic XML form.

    Just use event.target which will return the doc object.
    See the code example below
    var doc = event.target;
    doc. Print();
    doc.saveAs ();
    doc.closeDoc ();

    Nith

  • access the document object in the framework

    access the document object in the framework
    ------------------------------------------------
    Hi, MVP!

    There are 2 frames, frame1 and frame2, in my web page. I want to access the document using vb frame1 object and the web browser. How can I write codes front right to do?

    Thank you

    Hi Stanley.K,

    Your question of Windows is more complex than what is generally answered in the Microsoft Answers forums, since it relates to coding in Visual Basic Application Script. It should be better in Visual Basic on MSDN Forums.

    Please post your question in the MSDN Forums by visiting the following link:

    http://social.msdn.Microsoft.com/forums/en-us/vbgeneral/threads

  • To access the XML from a different class

    Hi all

    I have a xml class that loads the xml data, I need to access the data of another class. I imported the xml classinto the new class and created a new instance of it. However when I try to access the xml data it come back as null. I understand that it is certainly because when she is called the xml data has not completed loading. How can I get around this?

    XML class:

    package {}

    flash.xml import. *;
    import flash.events. *;
    import flash.net. *.
    import flash.display. *.

    public class xml extends MovieClip
    {
    public var xmlRequest:URLRequest;
    public var xmlLoader:URLLoader;
    public var xmlImages:XML;

    public void xml()
    {
    xmlRequest = new URLRequest ("images.xml");
    xmlLoader = new URLLoader (xmlRequest)

    xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded);
    xmlLoader.load (xmlRequest);
    }

    private void xmlLoaded(event:Event):void
    {
    trace (xmlLoader.Data);
    xmlImages = new XML (xmlLoader.data);
    }
    }
    }

    Thanks in advance

    Or even better:

    package {     import flash.events.*;     import flash.net.*;     import flash.xml.*;
    
         public class XMLLoader extends URLLoader     {          public var xmlImages:XML;
    
              public function XMLLoader()          {
    
              }
    
              public function loadXML(url:String):void {               this.addEventListener(Event.COMPLETE, xmlLoaded);               this.load(new URLRequest(url));          }
    
              private function xmlLoaded(event:Event):void          {               trace(xmlLoader.data);               xmlImages = newXML(this.data);               dispatchEvent(new Event("loadComplete"));          }     }}
    

    Use:

    var xmlLoader:XMLLoader = new XMLLoader();
    xmlLoader.addEventListener ("loadComplete", onXMLLoad);

    xmlLoader.loadXML ("images.xml");

    function onXMLLoad(e:Event):void {}
    trace (xmlLoader.xmlImages);
    }

  • Cannot access the XML file on localhost.

    Type localhost or 127.0.0.1 in any browser on a Macintosh (os 10.5) does not have access to the host computer.

    The following Actionscript code generates the following error:

    var XMLURL:URLRequest = new URLRequest ("http://localhost/quoteRotator/quotes1.xml");

    Error opening URL ' http://localhost/quoteRotator/quotes1.XML '

    #2044 error: Unhandled IO error...

    How can I access the XML file using Actionscript 3?

    Thanks for your help.

    use:

    var XMLURL:URLRequest = new URLRequest("quotes1.xml");
    
  • Access the main object of a SWF file in memory

    Hey.

    I'm trying to access the main object of a SWF file in memory. Consider the following code:

    package test {}
    import flash.display.Sprite;
    import flash.utils.ByteArray;

    SerializableAttribute public class Main extends Sprite {}
    public void Main (): void {}
    var b:ByteArray = new ByteArray();
    b.writeObject (this); This main object is what I'm trying to access
    }
    }
    }

    However, when I do a trace (b.length), the value I get does not match the length of the actual SWF file, then perhaps that there is another way.

    I am trying to achieve the same type of content that you would get if you load an external SWF using loadBytes, unless I want to access the principal object of SWF (running in memory) in this way.

    I have this even possible?

    Thank you.

    Hey.

    Well, I never knew a solution to it (if it is still possible to what I asked). However, I believe that I've implemented a workaround solution that should be enough for my needs. Perhaps it may help someone else too:

    Although I can not (seem to) get the SWF running access itself to memory, I can load another copy of itself. When I tested the copy loaded (in memory) and compared with the content of the file on the disk, using a hex editor, content match!

    This allows me to do things like control totals and which do not. An implementation is to use this technique to guard against the 'cache-hacking' of sovereign wealth funds.

  • Problem with to access the XML nodes whose namespace

    Hello
    I have a XML file with the following format;

    "" "" "< graphml version ="1.3"xmlns =" http://graphml.graphdrawing.org/xmlns/graphml ' xmlns:y = ' http://www.yworks.com/xml/graphml ' xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance" > "

    < graph id = 'G' edgedefault 'ordered' = >

    < key data 'd11' = >
    < y: SharedData >
    < name there: Brush = "SolidBrush" color = "Black" id = "1" / >
    < / y: SharedData >
    < / data >

    < node id = "G:n0" >
    < y: Labels >
    < y: Text > <! [CDATA [start]] > < / Text: y >
    < / y: Labels >
    < / node >

    < node id = "G:n1" >
    < y: Labels >
    < y: Text > <! [CDATA [end]] > < / Text: y >
    < / y: Labels >
    < / node >

    < / chart >

    < / graphml >


    I access this file as < mx:XML id = "layoutXml" source = "tmp.xml" / > "

    I have no application debugging and found that the layoutXml object contains the xml file as it is. Now when I try to access any child node of layoutXml, every time I found null. Same instruction layoutXml.graph.toXMLString () or layoutXml.graph.toString () returns null.

    I have tryied the following approach as well, but did not work,
    var nameSpace:Namespace = new Namespace (" http://www.yworks.com/xml/graphml");
    var str:String = layoutXml.graph.node. (@id == ' G:n0").nameSpace::Labels.nameSpace::Text.toXMLString();")
    also, this property returns null.

    If anyone has the solution, please answer.

    Thank you.

    Namespace var sets default namespace:
    lack of namespace xml = nameSpace;

    You should then be able to reference nodes normally.

    Tracy

  • Change "current node" of the XML object

    Hello

    I am trying to edit the "current node" of an XML object, but I still don't know what will be the current node.

    My XML object to load an external XML file:

    < mx:XML id = source="assets/article_text.xml"/ "featureData" >

    and I read that data through a < mx:Repeater > create a < mx:TextArea > for each 'currentItem '.

    < mx:Repeater id = dataProvider = "{featureData.body_text.children ('repeatParas')}" >
    "< mx:TextArea htmlText =" {repeatParas.currentItem} "width ="80% "borderStyle ="none"click =" showBodyEditor (event, event.currentTarget.getRepeaterItem ()) "verticalScrollPolicy =" off "creationComplete ="resizeTextArea (event); "updateComplete ="resizeTextArea (event); "/ > < / mx:Repeater >

    A click on < mx:TextArea > event load a pop-up window containing a RichTextEditor that contains the content of currentItem:

    private void showBodyEditor(event:Event,_item:String):void {}
    var pop1:BodyEditor = BodyEditor (PopUpManager.createPopUp (this, BodyEditor, true));
    Set the properties of the custom component BodyEditor.
    POP1.showCloseButton = true;
    POP1.targetBodyText = event.currentTarget;
    POP1. CurrentNode = item;
    PopUpManager.centerPopUp (pop1);
    }

    I then passes the value of everything that has been entered in the return to the initial < mx:TextArea > RichTextEdior via a function on a button click event '' made '' (processBodyText()):

    [Bindable]
    public var targetBodyText:Object;
    [Bindable]
    public var currentNode:String;

    Transfer data to text boxes
    private function processBodyText (): void {}
    targetBodyText.htmlText = String (bodyTextForm.htmlText);
    currentNode = String (bodyTextForm.htmlText);
    Remove pop-up.
    PopUpManager.removePopUp (this);
    }

    But what I can't do is actually updated for that node in the featureData XML object without explicitly saying what node to update (for example, it works: parentApplication.featureData.body_text.p [1] = String (bodyTextForm.htmlText);) I don't necessarily know which node to update, I just want to be able to update some node I happen to be editing at the time.

    Is this possible?

    Thanks to anyone who can enlighten us!

    I'll reply to my own post (where everyone was watching).

    I just changed the parameters/variables currentNode type Object (instead of string) and within the processBodyText function, I replaced

    currentNode = String (bodyTextForm.htmlText);

    with

    currentNode.setChildren (bodyTextForm.htmlText);

    who updates the node in the XML data provider.

    I still need to get rid of some of the gobblygook of html that is passed to the rear (for example < TEXTFORMAT LEADING '2' = >) but as long as I am able to update the current node, I'm happy (for now).

  • How to access the data object of Perl thread


    I am trying to import the OVF. I got like a lease and start download VMDK. I see the data passing by, but connection times out because I need to call HttpNfcLeaseProgress periodically since a thread separate to keep the connection open. The problem is that I can't find a way to share the data of HttpNfcLease corded Perl object, so that the thread can call the HttpNfcLeaseProgress method. I tried to share the fields type and the value of the MOR HttpNfcLease and build a new MOR in the thread and to call get_view, but I get a segmentation fault. Any help or examples on how to proceed would be greatly appreciated!

    It's COW with a fork.  So if your child's name in the API, this will impact the parent API session.

    You want to be sure that you disable the global VIM.  You can initialize a new VIM session using the same id of session of the parent to the child.  So two sockets.  Just be sure you don't disconnect until you're done with it.  You can change the behavior on VIM goes out of scope (UNDEF) with "unset_logout_on_disconnect()" on the VIM object, so it will not close the session if a child or parent is destroyed.  So make sure that you call logout on your own.

  • To access the display object on the stage of another class

    I Googled that nothing helps, I only found how to manipulate the scene itself and not a display on that object and I'm noob enough to not be able to figure it out from there. :/

    I have a clip on the main timeline with the instance name displayName. I created a button that should change this framework displayName will to (in order to... makes you guess? display the name of the button.) Awesome. )

    So, I'm trying to write the code in a reusable manner and have everything related to a class called GeoPuzzle buttons. Inside the GeoPuzzle I instantiate a touch event and run code. However, the function should be able to change displayName in the main part of the timeline and, of course, the compiler says displayName does not exist because I'm in a class and I don't mean the scene.

    Here's the code simplified in the class:

    package com.freerangeeggheads.puzzleography {}
    import flash.display.MovieClip;
    import flash.events.TouchEvent;

    SerializableAttribute public class extends MovieClip {} GeoPuzzle
    declaring variables

    public void setInitial (abbrev:String, fullName:String, isLocked:Boolean): void {}
    Set the parameters
    this.addEventListener (TouchEvent.TOUCH_BEGIN, geoTouchBeginHandler);
    }

    public void GeoPuzzle (): void {}
    }

    public void geoTouchBeginHandler (e:TouchEvent): void {}
    e.target.addEventListener (TouchEvent.TOUCH_END, geoTouchEndHandler);
    other methods
    nameDisplay.gotoAndStop (e.target.abbrev);
    }

    public void geoTouchEndHandler (e:TouchEvent): void {}
    other methods
    nameDisplay.gotoAndStop ("USA");
    }
    }
    }

    The lines in bold are my problem. Now this code does not actually as it is the case if you find an error in it, Yes, I have no idea what the problem is, but he DID run forward and these lines always gave me wrong so I'll try to help out on multiple fronts.

    How can I say displayName to change its current image within the display object class?

    Thank you!

    any display list object can refer to any display list object, but this is not necessarily good OOP.

    in any case, for your class reference displayName:

    . DisplayName MovieClip (this.parent)

  • best way to see the xml objects attribute existence

    "I have the xml node < type mynode ='sometype" >...

    I do: 'item.@type' and I need to check and if the attribute type is not lifting error, but it seems that "item.@type" will never return null, if there is no attribute "type" not specified, it returns a kind of empty xml or something, is there a particular reason, why it is done that way? and especially, what is the best way to check whether the xml node attribute 'type' defined?

    Thanks in advance


    ! point. (hasOwnProperty ("@type")) | «StringUtil.trim (item.@type) == «»

  • Access to the XML object

    In order to have access to all my code parsed XML needing access to it should be within the displayResources function? I am trying to load a XML outside the function of f and is not workinnnnn.

    XMLParser.load ("Q_data/string_assets/string01.xml", null, false, true, onFinish)

    function onFinish ($success: Boolean, $parsedObject: object, $xml: XML) {//This function is called as soon in the code XML load and gets analysis.}
    If {($success)
    displayResources ($parsedObject);
    showImage ($parsedObject);
    trace($parsedObject.Tool);
    } else {}
    trace ("FAILED to load XML");
    }
    }

    var OL: Object = new Object();
    lo.onLoadInit = function(target:MovieClip) {}
    target.forceSmoothing = true;

    holder_mc0.onPress = function() {}
    holder_mc0.StartDrag (false);

    holder_mc0. LineStyle(3,0xcccccc,100);
    holder_mc0. LineTo(_root.myWidth,0);
    holder_mc0. LineTo (_root.myWidth, _root.myHeight);
    holder_mc0. LineTo(0,_root.myHeight);
    holder_mc0. LineTo (0,0);

    }
    holder_mc0.onRelease = function() {}
    holder_mc0.stopDrag ();

    If (this ._droptarget == ' / string02 ') {}
    this.onTarget = true;
    _root.string02.gotoAndStop (2);
    This ._visible = false;
    menu_txt0._visible = false;
    zoom0._visible = false;
    This.main_txt1.setNewTextFormat (mainText);
    This.main_txt1. Text = $parsedObject.tool [0] .name

    } else {}
    this.onTarget = false;
    _root.targetCircle.gotoAndStop (1)
    }}

    Set it is available:

    var parsedObject:Object;

    XMLParser.load ("Q_data/string_assets/string01.xml", null, false, true, onFinish)

    function onFinish ($success: Boolean, $parsedObject: object, $xml: XML) {//This function is called as soon in the code XML load and gets analysis.}

    If {($success)

    parsedObject = $parsedObject;
    displayResources ($parsedObject);
    showImage ($parsedObject);
    trace($parsedObject.Tool);
    } else {}
    trace ("FAILED to load XML");
    }
    }

  • I receive the "could not sign in you [access denied: 530]." Check your user name and password ' problem on Adobe Muse CC 2014 and I can not access the xml file that is supposed to solve this problem?

    I am a PC user and I have Adobe Creative Cloud Muse 2014. I received the "could not sign in you [access denied: 530]." Check your username and password "error. trying to download my muse to my ftp, GoDaddy host site I did it successfully in the past and that recently it has stopped working. I looked online at the Adobe Muse Help FAQ | Download a Site from Muse Adobe on a third-party hosting service and he said to download the ftpprefs.xml file but this file simply leads to a blank page that says / * not found * / / * not found * /.

    Can you direct me to a page to work with this file, or provide an alternative? Thank you!

    Hello

    As you have found the error [access denied: 530] This means that the problem is with access. The user name and password that you enter is incorrect or you don't have the appropriate permissions.

    I suggest you to contact Godaddy to reset the password or reset the permissions.


    Concerning

    Vivek

  • How to access the child object of a movieclip

    Hi, I made the pictures dynamically and I access Bastien is child movieclip

    var totalThumbs:Array = new Array()

    var ThumbMC:MovieClip()

    var childThumb:MovieClip()

    var xpos:Number = 10

    for (var i: Number = 0; i < 10; i ++) {}

    ThumbMC = new thumbOb() //thumbOb is the movieclip in the library class

    addChild (ThumbMC)

    ThumbMC.x = xpos

    childThumb = new animationclip() //animationclip is the movieclip in the library class

    ThumbMC.addChild (childThumb)

    ThumbMC.addEventListener (MouseEvent.Click, thumbClick)

    XPos += 100

    }

    function thumbClick(event:MouseEvent):void {}

    event.target.childThumb.gotoAndPlay ("clicked") < < THIS ERROR SHOWING

    }

    There are a number of errors in what you show so I have to imagine that you are not in strict mode minimum of coding.  You should avoid using event.target and event.currentTarget are using, otherwise you are likely to find the target, it's not what you expect it to be.  currentTarget is always linked to the object that has the assigned listening port, not children of that object (using target may end up doing).

    When you add dynamically content, targeting usual syntax parent.child does not work.  You start to use other means of access to the child.  One way is to store the child in another reference (like a table) and directly target.  Another way would be to use the getChildByName() method... Here is an example of using this approach...

    var xpos:Number = 10;

    for (var i: Number = 0; i<10;>
       
    var ThumbMC = new thumbOb();  thumbOb is the class movieclip in the library
    ThumbMC.num = i;
    addChild (ThumbMC)
    ThumbMC.x = xpos
       
    var childThumb = new animationclip() //animationclip is the movieclip in the library class
    childThumb.name = "childThumb" + String (i)";
    ThumbMC.addChild (childThumb)
       
    ThumbMC.addEventListener (MouseEvent.CLICK, thumbClick)
    XPos += 100
    }

    function thumbClick(event:MouseEvent):void {}
    var childThumb is MovieClip (event.currentTarget) .getChildByName ("childThumb" + String (event.currentTarget.num));.
    childThumb.gotoAndPlay ("clicked");
    }

  • How to access the XML in Flex

    < user >

    < UID = "HR" dept >

    < user >

    mm < fname > < / fname >

    < Email > [email protected] < / email >

    < / user >

    < user >

    SSS < fname > < / fname >

    < Email > [email protected] < / email >

    < / user >

    < / dept >

    < UID = 'Finance' dept >

    < user >

    FFFF < fname > < / fname >

    < Email > [email protected] < / email >

    < / user >

    < user >

    www < fname > < / fname >

    < Email > [email protected] < / email >

    < / user >

    < / dept >

    < / users >

    using the HTTP service with access to the data

    This my user.xml file I want to display all the item in flex datagrid using the function navigator tab... each browser tab contains a grid of data for corresponding like HR, sales, Finance Dept

    the corresponding information will be displayed in the data grid

    first tab navigatore is

    HR-> grid of data such as fname, Email field

    Finance-> fname, E Mail

    Try this if you have problems and the way in which you want to change it:


    <>
    "xmlns:MX ="http://www.adobe.com/2006/mxml"
    Layout = "vertical".
    "" xmlns:local = "*".
    creationComplete = "init ()" > "


           
               
                    
                          mm
                          [email protected]
                    

                    
                          SSS
                          [email protected]
                    

               

               
                    
                          FFFF
                          [email protected]
                    

                    
                          www
                          [email protected]
                    

               

           

       

       
       
           
    dataProvider = "{myXML.dept}" > "
               

                   
                       
                           
                           
                       

                   

                       
           
       
       

    Kind regards

    Adrian

Maybe you are looking for

  • 'Fun' with snapshots do not delete

    Hey everone I am clearly again and I tried to post not unless I really need help. Here's my situation. I spend 4 Bay NAS Bay 6 316 (really like it so far... if I could only utorrent works... but that's another post). I ran out of space during the tra

  • How to restore Windows Vista to factory settings after a format of partition?

    HOW CAN I RESTORE TO FACTORY VISTA NINE AFTER PARTICIPATION FORMAT original title: HOW can I RESTORE FACTORY NEW VISTA AFTER PARTION FORMAT

  • want to screen 4-1080ee cable

    HelloI bought a laptop model HP ENVY 4-1080eeBut the failure has occurred in the shield of the cable and does not "Libya"... Please provide me with the model number and type of cable for this model so that I can buy it on the website, "Amazon", I hop

  • How to exclude search results where the situation is just the right search term was found

    Is there a way to exclude the results of search results where the search term appeared in the path/location of the file? For example, I find the term 'XYZ' and am only interested in results that include XYZ in the name of the file (not the path) or i

  • Mail trouble

    Recently, my mail messages-I phones, in particular, - run out of the screen & a horizontal scroll bar appeared. How can I get rid of this... (I have 'AOL', if that makes a difference)? Thank you.