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

Tags: Flex

Similar Questions

  • My event.result may or may not return a node in the xml file. How can I avoid that TypeError: Error #1009:

    My event.result may or may not return a node in the xml file. How can I avoid that TypeError: Error #1009: cannot access a property or method of a null object reference.

    I have a very simple question. I want to take the value of

    Event.Result.Item.nodeindex1.nodeindex2.Row.MyValue;

    and assign it to a text field

    mytextTi.text = event.result.item.nodeindex1.nodeindex2.row.myvalue;

    But if a part of the tree is missing, which is also valid, so I get TypeError: Error #1009: cannot access a property or method of a null object reference.

    I tried various solutions such as the following. Is there any simple way to do this?

    If (event.result.item.nodeindex1.nodeindex2.row.myvalue! = undefined)-does not work

    Unfortunately, one must test all levels to ensure that it is not null before the reference to it. You can take advantage of the short-circuit evaluation in tying together, for example

    if (event.result.item
        && event.result.item.nodeindex1
        && event.result.item.nodeindex1.nodeindex2
        && event.result.item.nodeindex1.nodeindex2.row
        && event.result.item.nodeindex1.nodeindex2.row.myvalue)
    {
        // access the variable
    }
    else
    {
        // one of the XML nodes in the path is null
    }
    

    Or you could stay away from her a little hacky and wrap the reference in a try/catch block.

    -Tom

    Flex SDK engineer

  • Developer Mode error: outdated., the xxAM.xxVO1 view object contained no trace. The records displayed may have been deleted, or the current record of the view object is not properly initialized.

    Hi all

    I'm creating a Maunal search page.

    To do this, I created a view based on a custom display object.

    Page contains 2 parameters.

    If I give all settings and click the OK button.

    It gives the following error.

    Developer Mode error: outdated data


    This page contains outdated information. This error could have been caused by the use of the buttons of the browser (the browser back button, for example). If the browser navigation buttons were not used, this error may result from coding errors in the application code. Please check press the back button on the browser developer guide - view primary key object comparison section to review the main cause of this error and correct the mistakes of coding.


    Cause:
    The view BLTrinDisplayAM.ViewVO1 object did not contain any record. The records displayed may have been deleted, or the current record of the view object is not properly initialized.

    To visit, please click on the Home link at the top of the application page to return to the main menu. Next, go to this page using the app's navigation controls (menu, links and so on) rather than use the controls of the browser as rear or front.

    If I don't give any parameter and click go Button.The content of the view are displayed.

    So if I pass all parameters and click Go, then the corresponding record is displayed.

    Why, for the first time, if I give the parameter and click Go, obsolete data error is coming?

    Please help me.

    Grateful for your help!

    -Aren

    You use the object of the view for the search criteria and search results fields.

    I suggest you to remove references of VO fields of search criteria, item1 and item2.

    And in the event of the button 'Go' in the processFormRequest, get the criteria for field values entered by the user as below and run the object (ViewVO1) of the view by using these values.

    String buCode = pageContext.getParameter ("item1");

    String lsiCode = pageContext.getParameter ("item2");

    Thank you

  • Retrieve / search a specific node of the XML file

    Hello

    I have a question about reading the XML (search) in PL SQL file:

    There is an XML file with the following structure:
    <root>
      <Hnode1 attr1="value1" />
      <Hnode2 attr1="value1" /> 
         <node1_of_Hnode2 id="10" personname="Steven"/>
         <node2_of_Hnode2 id="20" personname="Christian"/>
         <node3_of_Hnode2 id="30" personname="Arnold"/>
         .
         .
      <Hnode2/>
    <root/>
    How it is possible to filter a node by one of its attribute value. For example:
    The id of a person - I guess that id = 20. In this case I would like to get the whole node (in this case node2_of_Hnode2) to get the personname = > 'Christian '.
    Just like a SELECT statement (WHERE ID = 20)

    Is it possible to get it in a single order or should it be buckled on all the lines in the Document. Can you please provide an example for me.

    Thank you for advice!

    The basic version is 10.

    Sorry, this is not a version.
    For example:

    SQL> select * from v$version;
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE     10.2.0.5.0     Production
    TNS for 64-bit Windows: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
     
    

    The use of the extraction of the values?
    1. better in a Select statement. assignment directli in a variable, or by using the xmlquery function?

    PL/SQL or SQL calls to the XMLType methods such as getStringVal() or extract() function should be equivalent (save the change of context).
    However, none of them are the right way to retrieve a scalar value of a given node.
    You must use the rather extractValue() function (SQL only) for immediate release< 11.2="" and="" xmlcast/xmlquery="" starting="" with="">

    Another Question:

    I've seen a lot of options for dealing with XML files.

    In my case only query data in XML files is relevant.

    I've seen to many API called XMLDOM, DMBS_XMLDOM, XMLTYPE...

    When to use these APIs. Can you give me feedback on this please?

    It is a broad topic.
    An appropriate response will depend on your condition.

    -You have to deal with large files and if so what size?
    -Performance/memory management is a concern for you?
    -You want to extract unique values or process the XML content in the form of relational data?

    If you have any specific test cases to show us, please post in the {forum: id = 34} forum and make sure to include all the necessary details (see the FAQ).

    Published by: odie_63 on 23 Feb. 2012 11:35

  • 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

  • PS CS6 video editing, change in position of the dynamic object

    Hello

    Correct me if I am mistaken in my project, I want to make a couple of small clips to appear on the screen and the change of position. I so in order for me resize a clip to convert object dynamic, right? But it seems that I can't use a 'position' function more on dynamic objects, (it disappeared). So, how can I transform an object while being able to use the tool "position? Is it work around?

    Kind regards

    Bart

    Instead of position, you will see " transformed" in the timeline that contains the positions and all other transformations.

    Transform of use both on the smart object

  • 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) == «»

  • analysis to get only the first node of the XML.

    Hello
    I'm trying to parse the following xml tag. I want only the first node in the ORDER_PAYMENT_DETAIL element, and then the other node element.
    I would appreciate your help.

    ---
    < ORDER_PAYMENTS >
    < ORDER_PAYMENT >
    < ORDER_NO > 20000404 < / ORDER_NO >
    < PAYMENT_METHOD_ID > 5 < / PAYMENT_METHOD_ID >
    < PAYMENT_SEQ_NO > 0 < / PAYMENT_SEQ_NO >
    < CHARGE_AMOUNT > 50 < / CHARGE_AMOUNT >
    USD < CHARGE_CURRENCY > < / CHARGE_CURRENCY >
    < ORDER_PAYMENT_DETAILS >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 2 < / ATTRIBUTE_ID >
    Test1 < ATTRIBUTE_VALUE > < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 1 < / ATTRIBUTE_ID >
    < ATTRIBUTE_VALUE > CC < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 3 < / ATTRIBUTE_ID >
    < > 4222222222222 ATTRIBUTE_VALUE < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 4 < / ATTRIBUTE_ID >
    < > 01 ATTRIBUTE_VALUE < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 5 < / ATTRIBUTE_ID >
    < > 2012 ATTRIBUTE_VALUE < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 10 < / ATTRIBUTE_ID >
    < ATTRIBUTE_VALUE > AP53-7457490 < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < > 11 ATTRIBUTE_ID < / ATTRIBUTE_ID >
    ID575754W34623525SDT < ATTRIBUTE_VALUE > < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < > 12 ATTRIBUTE_ID < / ATTRIBUTE_ID >
    KEY111222333444555FSDRT < ATTRIBUTE_VALUE > < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 2 < / ATTRIBUTE_ID >
    Test2 < ATTRIBUTE_VALUE > < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 1 < / ATTRIBUTE_ID >
    < ATTRIBUTE_VALUE > CC < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 3 < / ATTRIBUTE_ID >
    < ATTRIBUTE_VALUE > 4444444444444448 < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 4 < / ATTRIBUTE_ID >
    < > 02 ATTRIBUTE_VALUE < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 5 < / ATTRIBUTE_ID >
    < > 2013 ATTRIBUTE_VALUE < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 10 < / ATTRIBUTE_ID >
    < ATTRIBUTE_VALUE > AP53-7457490 < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < > 11 ATTRIBUTE_ID < / ATTRIBUTE_ID >
    ID575754W34623525SDT < ATTRIBUTE_VALUE > < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < > 12 ATTRIBUTE_ID < / ATTRIBUTE_ID >
    KEY111222333444555FSDRT < ATTRIBUTE_VALUE > < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < / ORDER_PAYMENT_DETAILS >
    < / ORDER_PAYMENT >
    < ORDER_PAYMENT >
    < ORDER_NO > 20000404 < / ORDER_NO >
    < PAYMENT_METHOD_ID > 1 < / PAYMENT_METHOD_ID >
    < PAYMENT_SEQ_NO > 1 < / PAYMENT_SEQ_NO >
    < CHARGE_AMOUNT > 10.47 < / CHARGE_AMOUNT >
    USD < CHARGE_CURRENCY > < / CHARGE_CURRENCY >
    < ORDER_PAYMENT_DETAILS >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 2 < / ATTRIBUTE_ID >
    Test1 < ATTRIBUTE_VALUE > < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 1 < / ATTRIBUTE_ID >
    < ATTRIBUTE_VALUE > CC < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 3 < / ATTRIBUTE_ID >
    < > 4222222222222 ATTRIBUTE_VALUE < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 4 < / ATTRIBUTE_ID >
    < > 01 ATTRIBUTE_VALUE < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 5 < / ATTRIBUTE_ID >
    < > 2012 ATTRIBUTE_VALUE < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 10 < / ATTRIBUTE_ID >
    < ATTRIBUTE_VALUE > AP53-7457490 < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < > 11 ATTRIBUTE_ID < / ATTRIBUTE_ID >
    ID575754W34623525SDT < ATTRIBUTE_VALUE > < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < > 12 ATTRIBUTE_ID < / ATTRIBUTE_ID >
    KEY111222333444555FSDRT < ATTRIBUTE_VALUE > < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 2 < / ATTRIBUTE_ID >
    Test2 < ATTRIBUTE_VALUE > < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 1 < / ATTRIBUTE_ID >
    < ATTRIBUTE_VALUE > CC < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 3 < / ATTRIBUTE_ID >
    < ATTRIBUTE_VALUE > 4444444444444448 < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 4 < / ATTRIBUTE_ID >
    < > 02 ATTRIBUTE_VALUE < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 5 < / ATTRIBUTE_ID >
    < > 2013 ATTRIBUTE_VALUE < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < ATTRIBUTE_ID > 10 < / ATTRIBUTE_ID >
    < ATTRIBUTE_VALUE > AP53-7457490 < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < > 11 ATTRIBUTE_ID < / ATTRIBUTE_ID >
    ID575754W34623525SDT < ATTRIBUTE_VALUE > < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < ORDER_PAYMENT_DETAIL >
    < > 12 ATTRIBUTE_ID < / ATTRIBUTE_ID >
    KEY111222333444555FSDRT < ATTRIBUTE_VALUE > < / ATTRIBUTE_VALUE >
    < / ORDER_PAYMENT_DETAIL >
    < / ORDER_PAYMENT_DETAILS >
    < / ORDER_PAYMENT >
    < / ORDER_PAYMENTS >

    Do you mean the full xml, excluding all the ORDER_PAYMENT_DETAIL elements, but the first?

    SQL> select deletexml(colx,'//ORDER_PAYMENT_DETAIL[position()>1]').extract('/*')
      2  from tabx;
    
    DELETEXML(X,'//ORDER_PAYMENT_DETAIL[POSITION()>1]').EXTRACT('/*')
    -------------------------------------------------------------------------------
    
      
        20000404
        5
        0
        50
        USD
        
          
            2
            test1
          
        
      
      
        20000404
        1
        1
        10.47
        USD
        
          
            2
            test1
          
        
      
    
    

    Note that the ".extract('/*')" is there only for the formatting...

    Max
    http://oracleitalia.WordPress.com

  • Add the node to the xml file

    Hello

    I'm trying to scan a file xml in the following way:

    // read the content
        var xml_file = File(xml_file_path);
        xml_file.open('r');
        var content = xml_file.read();
        xml_file.close();
    
        // add the node
        var root = new XML(content);
        var unit_test_resolution = <unit-test>{resolution}</unit-test>;
        root.appendChild(unit_test_resolution);
    
        // replace the file
        var my_file = new File(xml_file_path);
        var edit_content = root.toXMLString();
        my_file.open('w');
        my_file.writeln('<?xml version="1.0" encoding="UTF-8"?>');
        my_file.writeln(edit_content);
    

    I'm not sure it's a good solution can someone help me? For example, my file already has the ' <? XML version = "1.0" encoding = "UTF-8"? > ' header. But if I read it this way I must put it each time egain...

    Thank you in advance for your help.

    Best regards.
    Bastien

    It's xtools/xlib/stdlib.js. I used it to manage my file xml reading and writing for several years.

    Stdlib.readXMLFile = function(fptr) {
      var rc;
      var file = Stdlib.convertFptr(fptr);
      if (!file.exists) {
        Error.runtimeError(48); // File/Folder does not exist
      }
      file.encoding = "UTF8";
      file.lineFeed = "unix";
      rc = file.open("r", "TEXT", "????");
      if (!rc && Stdlib.IOEXCEPTIONS_ENABLED) {
        Error.runtimeError(Stdlib.IO_ERROR_CODE, Stdlib.fileError(file));
      }
      var str = file.read();
      rc = file.close();
      if (!rc && Stdlib.IOEXCEPTIONS_ENABLED) {
        Error.runtimeError(Stdlib.IO_ERROR_CODE, Stdlib.fileError(file));
      }
      return new XML(str);
    };
    Stdlib.writeXMLFile = function(fptr, xml) {
      var rc;
      if (!(xml instanceof XML)) {
        Error.runtimeError(19, "xml"); // "Bad XML parameter";
      }
      var file = Stdlib.convertFptr(fptr);
      file.encoding = "UTF8";
      rc = file.open("w", "TEXT", "????");
      if (!rc && Stdlib.IOEXCEPTIONS_ENABLED) {
        Error.runtimeError(Stdlib.IO_ERROR_CODE, Stdlib.fileError(file));
      }
      // unicode signature, this is UTF16 but will convert to UTF8 "EF BB BF"
      // optional
      //file.write("\uFEFF");
      file.lineFeed = "unix";
      file.writeln('');
      rc = file.write(xml.toXMLString());
      if (!rc && Stdlib.IOEXCEPTIONS_ENABLED) {
        Error.runtimeError(Stdlib.IO_ERROR_CODE, Stdlib.fileError(file));
      }
      rc = file.close();
      if (!rc && Stdlib.IOEXCEPTIONS_ENABLED) {
        Error.runtimeError(Stdlib.IO_ERROR_CODE, Stdlib.fileError(file));
      }
      return file;
    };
    

    A lot of paranoia coding in there, but after having done PSJS coding for a decade or so paranoia is a more secure state of mind.

    X

  • 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");
    }
    }

  • How to check if a node exists in the XML file?

    I was asked to program a method to import data from xml files in our Coldfusion 8 Web site, I am new to the use of XML.

    My method worked however I encountered the following error:

    Element NETWORKORDER. SECONDARYADDRESS. CONTACTNAME is undefined in MYDOC.

    Investigation on the node in the XML file was not present.

    Is there a method I can use to resolve this error by checking if a node exists in the xml file, which works with my current code below?

    <!--> reading XML file
    < cffile action = "read" file = "D:\website\XML\#FileName#" variable = "myxml" >
    < cfset mydoc = XmlParse (myxml) >

    <!--> to extract data from the XML of NDS file
    < cfset aPrimaryContactName =(#mydoc.NetworkOrder.PrimaryAddress.ContactName#) >
    < cfset aPrimaryContactNumber =(#mydoc.NetworkOrder.PrimaryAddress.ContactNumber#) >
    < cfset aPrimaryContactNumber = tostring(#mydoc.NetworkOrder.PrimaryAddress.ContactNumber#) >
    < cfset aPrimaryContactAddressLine1 =(#mydoc.NetworkOrder.PrimaryAddress.line1#) >
    < cfset aPrimaryContactAddressLine2 =(#mydoc.NetworkOrder.PrimaryAddress.line2#) >
    < cfset aPrimaryContactAddressLine3 =(#mydoc.NetworkOrder.PrimaryAddress.line3#) >
    < cfset aPrimaryContactAddressLine4 =(#mydoc.NetworkOrder.PrimaryAddress.line4#) >
    < cfset aPrimaryContactAddressLine5 =(#mydoc.NetworkOrder.PrimaryAddress.line5#) >
    < cfset aPrimaryContactCity =(#mydoc.NetworkOrder.PrimaryAddress.City#) >
    < cfset aPrimaryContactPostcode =(#mydoc.NetworkOrder.PrimaryAddress.PostalCode#) >
    < cfset aPrimaryContactCounty =(#mydoc.NetworkOrder.PrimaryAddress.CountrySubdivision#) >
    < cfset aPrimaryContactCountryCode =(#mydoc.NetworkOrder.PrimaryAddress.CountryCode#) >
    < cfset aPrimaryContactCountry =(#mydoc.NetworkOrder.SecondaryAddress.Country#) >
    < cfset aSecondaryContactName =(#mydoc.NetworkOrder.SecondaryAddress.ContactName#) >
    < cfset aSecondaryAttentionOfName =(#mydoc.NetworkOrder.SecondaryAddress.AttentionOfName#) >
    < cfset aSecondaryContactNumber =(#mydoc.NetworkOrder.SecondaryAddress.ContactNumber#) >
    < cfset aSecondaryContactAddressLine1 =(#mydoc.NetworkOrder.SecondaryAddress.line1#) >
    < cfset aSecondaryContactAddressLine2 =(#mydoc.NetworkOrder.SecondaryAddress.line2#) >
    < cfset aSecondaryContactAddressLine3 =(#mydoc.NetworkOrder.SecondaryAddress.line3#) >
    < cfset aSecondaryContactAddressLine4 =(#mydoc.NetworkOrder.SecondaryAddress.line4#) >
    < cfset aSecondaryContactAddressLine5 =(#mydoc.NetworkOrder.SecondaryAddress.line5#) >
    < cfset aSecondaryContactCity =(#mydoc.NetworkOrder.SecondaryAddress.City#) >
    < cfset aSecondaryContactPostcode =(#mydoc.NetworkOrder.SecondaryAddress.PostalCode#) >
    < cfset aSecondaryContactCounty =(#mydoc.NetworkOrder.SecondaryAddress.CountrySubdivision#) >
    < cfset aSecondaryContactCountryCode =(#mydoc.NetworkOrder.SecondaryAddress.CountryCode#) >
    < cfset aSecondaryContactCountry =(#mydoc.NetworkOrder.SecondaryAddress.Country#) >

    Since you already have the XML parsed in a document, the easiest is to use xmlSearch(). Take a look at the doc, it is pretty easy to use. Something as simple as:

    To the most complex as:

    And in both cases:

    Read the doc and google is your friend "coldfusion xmlsearch.

  • Remove the XML node

    Dear adobe experts,

    I have a requirement to remove a node in the XML interface of a form of adobe (not only by removing a subform in the form). It must be a deletion, an empty node does not work (I read this in another post).

    The XML structure looks like this:

    < ITEM >

    < DATA >

    < ROW_IID > 0 < / ROW_IID >

    < PARENT > 0 < / PARENT >

    < CHILD > 0 < / CHILD >

    < / DATA >

    < DATA >

    < ROW_IID > 1 < / ROW_IID >

    < PARENT > 0 < / PARENT >

    < CHILD > 0 < / CHILD >

    < / DATA >

    < / ITEM >

    I want to, for example, to remove the second node of data including the underlying elements: row_iid, parent & child. Already tried: xfa.record.nodes.remove (oRemoveNode); I got it from http://partners.adobe.com/public/developer/en/xml/Adobe_XML_Form_Object_Model_Reference.pd f and several messages in this forum, but I get the following message appears in the error console: remove failed. I know that the somexpression is correct.

    Here's the code I used to try to remove the node.

    var node_loc;

    var del_node;

    [node_loc = ' xfa.record.ELEMENT.DATA [1 '];

    del_node = xfa.resolveNode (node_loc);

    xfa.record.Nodes.Remove (del_node);

    Anyone know what I am doing wrong?

    Kind regards

    Niels

    Hi Steve,.

    I fixed it myself. I adjusted my code a little, so the node, including the elements is successfully deleted.

    Here is the way that I fixed it:

    var node_loc;

    var del_node;

    [node_loc = ' xfa.record.ELEMENT.DATA [1 '];

    del_node = xfa.resolveNode (node_loc);

    xfa.record.ELEMENT.nodes.remove (del_node);

    Thanks for the help!

    Kind regards

    Niels

  • The current node to display all the levels at the atomic scale

    Hi all

    If anyone has example of expand/collapse the current node to display all the levels at the atomic scale. Please post here. I appreciated the help.

    Thank you

    James,

    try adding a condition just before current node if the next node id is null or not.

    Thus, the update procedure will be like that.

    PROCEDURE Expand_Collapse_Node (Tree_Name IN VARCHAR2 , Trigger_Node IN VARCHAR2, Str_Type IN VARCHAR2 DEFAULT 'COLLAPSE') IS
         Item_Id ITEM;
         Current_Node FTREE.NODE;
         Starting_Node_Level NUMBER;
         Current_Node_Level NUMBER;
    BEGIN
         IF Trigger_Node IS NOT NULL THEN
              Item_Id := FIND_ITEM(Tree_Name);
              IF NOT ID_NULL(Item_Id) THEN
                   Current_Node := Trigger_Node;
                   Starting_Node_Level := FTREE.GET_TREE_NODE_PROPERTY(Item_Id, Current_Node, FTREE.NODE_DEPTH);
                   LOOP
                        IF FTREE.ID_NULL(Current_Node) OR (Current_Node_Level = Starting_Node_Level) THEN
                             EXIT;
                        ELSE
                             IF Str_Type = 'EXPAND' THEN
                                  IF FTREE.GET_TREE_NODE_PROPERTY(Item_Id, Current_Node, FTREE.NODE_STATE) = FTREE.COLLAPSED_NODE THEN
                                        FTREE.SET_TREE_NODE_PROPERTY(Item_Id, Current_Node, FTREE.NODE_STATE,      FTREE.EXPANDED_NODE);
                                  END IF;
                             ELSIF Str_Type = 'COLLAPSE' THEN
                                  IF FTREE.GET_TREE_NODE_PROPERTY(Item_Id, Current_Node, FTREE.NODE_STATE) = FTREE.EXPANDED_NODE THEN
                                        FTREE.SET_TREE_NODE_PROPERTY(Item_Id, Current_Node, FTREE.NODE_STATE,      FTREE.COLLAPSED_NODE);
                                  END IF;
                             END IF;
                             Current_Node := FTREE.FIND_TREE_NODE(Tree_Name, '', FTREE.FIND_NEXT, FTREE.NODE_LABEL, '', Current_Node);
                             IF FTREE.ID_NULL(Current_Node) = FALSE THEN
                                  Current_Node_Level := FTREE.GET_TREE_NODE_PROPERTY(Item_Id, Current_Node, FTREE.NODE_DEPTH);
                             END IF;
                        END IF;
                   END LOOP;
              END IF;
         END IF;
    END Expand_Collapse_Node;
    

    Kind regards

    Manu.

    If this answer is useful or appropriate, please mark. Thank you.

  • How to extract the node where the value of the node is the max in all of the XML document?

    Hello

    I have a transaction that refers to an xmltype in iRecruitment, containing multiple versions of the same node as follows:

    (only for the example data)



    {noformat} & lt; Transaction & gt;


    & lt; data & gt;


    & lt; ObjectVersionNumber & gt; 1 & lt; / object_version_number & gt;


    & lt; EO & gt;


    & lt; Attribute1 & gt; A & lt; / Attribute1 & gt;


    & lt; Attribut2 & gt; B & lt; / attribut2 & gt;


    & lt; /EO & gt;


    & lt; / data & gt;


    & lt; data & gt;


    & lt; ObjectVersionNumber & gt; 2 & lt; / object_version_number & gt;


    & lt; EO & gt;


    & lt; Attribute1 & gt; A & lt; / Attribute1 & gt;


    & lt; Attribut2 & gt; C & lt; / attribut2 & gt;


    & lt; /EO & gt;


    & lt; / data & gt;


    & lt; data & gt;


    & lt; ObjectVersionNumber & gt; X & lt; / object_version_number & gt;


    & lt; EO & gt;


    & lt; Attribute1 & gt;? & lt; / Attribute1 & gt;


    & lt; Attribut2 & gt;? & lt; / attribut2 & gt;


    & lt; /EO & gt;


    & lt; / data & gt;


    & lt; / Transaction & gt; {noformat}

    I can extract a value for FULL-TIME 1 or 2, is not a problem.
    However, how can I go on the selection of a value of an attribute below FULL-TIME X, where X is the maximum value of FULL-TIME in any node in the XML document?

    I tried to the last node corresponding to my way, but it is not always the case that the FULL-TIME max will correspond to this scenario.

    Any help would be greatly appreciated!

    Thank you very much, Pete

    Published by: Pete Mahon on February 24, 2009 12:11

    Here's a way

    SQL> set long 100000
    SQL> with XML as (
      2  select XMLTYPE(
      3  '
      4  
      5     
      6             1
      7             
      8                     A
      9                     B
     10             
     11     
     12     
     13             2
     14             
     15                     A
     16                     C
     17             
     18     
     19     
     20             3
     21             
     22                     ?
     23                     ?
     24             
     25     
     26  ') OBJECT_VALUE
     27    from dual
     28  )
     29  select DATA, OVN
     30    from XML,
     31         XMLTable
     32         (
     33           '/Transaction/data'
     34           passing OBJECT_VALUE
     35           columns
     36           DATA XMLType path '.',
     37           OVN  number  path 'ObjectVersionNumber'
     38         )
     39   where OVN = ( select MAX(OVN)
     40                   from XML,
     41                        XMLTable
     42                        (
     43                          '/Transaction/data'
     44                          passing OBJECT_VALUE
     45                          columns
     46                          OVN  number  path 'ObjectVersionNumber'
     47                        )
     48               )
     49
    SQL> /
    
    DATA
    --------------------------------------------------------------------------------
           OVN
    ----------
    3?
    ?
             3
    
    SQL>
    
  • Adding data to XML objects.

    Hello

    I wonder how to add completely new data to the XML data that I hang in a var.

    I am importing XML data in an editor that I've created.  The XML looks like this:

    < itemList_120 >

    < mediaFile order = '1' playTime = '2 ' transIn = transOut '1' = ' 9' > gif.gif < / mediaFile >
    < order = '2' playTime '1' = transIn mediaFile transOut = '6' = "8" > jpg.jpg < / mediaFile >

    < / itemList_120 >

    The code that I put in place to contain the XML data is as follows:

    var theXML:XML;
    var myXML:XMLList;

    function called when the xml file loading is complete
    function onXMLLoaded_120 (e: Event): void {}

    a new instance of the xml object
    Check = new XML (e.target.data);

    Use the object XMLList to children nodes filter thumbnails
    myXML = theXML.itemList_120;

    etc - and it works for importing the XML file - if I trace (myXML), XML data above are displayed.

    I find that you can change the different parts of the XML data in myXML in this way:

    myXML.mediaFile[1].@playTime = 2

    (which changes the second line of XML code for this: < mediaFile order = "2" "2" = transIn playTime transOut = '6' = "8" > jpg.jpg < / mediaFile >)


    My question is:

    Rather than change the existing XML data, how to add completely new data?  That is to say, if the var above who held two lines "mediaFile" of XML, how to add or insert a third?

    Thanks for taking a peek at this.

    Shaun

    check the xml class.  There are all the methods you need to add, insert, and delete nodes, attributes, etc.

Maybe you are looking for

  • My Mac is overheating. How can I solve this problem

    I have an old mac. It is very easy to overheat. Could I can cool down and speed it up?

  • Transfer iTunes balances

    How can I transfer balance iTunes of my son turn it back on for the family account?  We have home sharing enabled.  Can I transfer the balance or just buy him for me and content to share?

  • 12 Firefox will maximize itself whenever I click on an item, help

    I reloaded FF 12 and still no change, no matter what I do the browser goes to the max when I click on, let's say the e-mail to read. I need to get my mouse and go to the top of the browser and move it down and then it comes back to the normal display

  • E-mail account name

    I deleted one of my email accounts, such as it was suspended.  To reset, I deleted the account and now I can't set it up again.  It shows not just anywhere, but when I get the name and the password it says that the account is already there.  How can

  • Satellite L500: I am able to connect to wifi but no internet access

    A week ago, I bought Toshiba L500 laptop. I am able to connect to my wireless network, but there is no internet access. I have to manually enter my IP address as Auto search does not find my wireless network. I tried to disable firewall and still no