Edit XML node using actionscript?

How would I go about editing an XML node from within
actionscript?
I load the XML from a file, and before I pass it to an
HTTPService I would like to set the field DateTime. The XML file
that I am using can be seen here:
XML Document
When I try doing something like
myXML.fiAPI.fiHeader.Service.DateTime="time here", it creates a new
fiAPI node with all new children. However, I wish to edit the
current DateTime field without creating a new one.
All help is appreciated.

Thanks to both of you.
ctzn99: I tried that as well, after realizing my mistake.
However, it still does not work. I'm certain I have the path right,
but nothing is set (or in other cases, returned). Even when I use
myXML.fiHeader..., It creates a new fiHeader node and the
corresponding nodes underneath it.
ntsiii: That's a very complex example, like you said...
almost overkill for my problem?
Thanks though!

Similar Messages

  • Convertion of String to XML node using Xquery transformation in OSB

    How to convert string to XML node elementusing a built in function using Xquery transformation in OSB?

    check this out - http://www.javamonamour.org/2011/06/fn-beainlinedxml.html
    if in SOA (BPEL & Mediator) you can use oraext:parseXML.
    you should thoroughly analyse where to implement your requirement as some good practices advise to implement more complex logic in SOA and leave OSB to only connect to the services' endpoints.
    Hope this helps,
    A.

  • Can't convert string element to XML node using XSL

    We have a source XML with a node that contains another XML as string. Like this:
    "<imp1:payload>&lt;?xml version = '1.0' encoding = 'ISO-8859-15' standalone = 'no'?>
    &lt;!-- Oracle eXtensible Markup Language Gateway Server -->&lt;!DOCTYPE PROCESS_PO_007 SYSTEM "003_process_po_007.dtd">&lt;PROCESS_PO_007>&lt;CNTROLAREA>" etc
    And we have a target XML that has the schema inside the string in the source file, like this:
    "<PROCESS_PO_007>
    <CNTROLAREA>"....etc.
    How can we "parse" the string to a node using an XSL transformation file?

    Hi,
    Can you tell me which code are you using currently for transferrring the data? It might help me to figure out what your problem is.

  • Retrieve xml attribute value of nth xml node using xpath query

    I have an xml with following stucture...
    <xml>
    <header>
     <DocumentReference OrderId="order001">
     <DocumentReference OrderId="order002">
     <DocumentReference OrderId="order003">
    I have to loop through this xml and retrieve the orderId values inside Biztalk orchestration.
    In the expression shape, I get the count of 'DocumentReference' nodes using an xpath query and then
    Added a loopshape to make sure it loops thru all nodes
    Loop condition:   n<=nodeCount     (where n is an integer variable, n=0 to begin with, incremented by 1 thru each loop, nodeCount is # of DocumentReference nodes)
     I try retrieve to the orderId in the following expression shape using the below xpath query
      xpathQuery = System.String.Format("//*[local-name()='OrderReference'][{0}]/@orderID)",n);
      sOrderId = xpath(MsgSingleInvoice,xpathQuery);
    And I get the following exception:
    Inner exception: '//*[local-name()='OrderReference'][1]/@orderID)' has an invalid token.
    Exception type: XPathException
    Appreciate any help!   thanks!

    Thanks for the quick response. I got rid of it.
    And I see a different error:
    Inner exception: Specified cast is not valid. Exception type: InvalidCastException
    Source: Microsoft.XLANGs.Engine  
    Target Site: System.Object XPathLoad(Microsoft.XLANGs.Core.Part, System.String, System.Type)
    Since variable 'n' is of integer type, I suspected it and changed it to n.ToString() and tested again and still see the same error.

  • Remove XML node using Xpath

    Hello,
    I'm using J Developer/SOA Suite 11.1.1.6.0 and BPEL 2.0
    I am trying to remove datetime nodes from xml, where the datetime value equals a certain value.  So far I have the following BPEL code:
      <assign name="RemoveEmptyDates">
          <extensionAssignOperation>
            <bpelx:remove>
              <bpelx:target>$GetNewHires_GetWrittenOffersReadyForUpload_OutputVariable.parameters//*[ . instance of xsd:dateTime and xsd:dateTime(.) = xsd:dateTime('0001-01-01T00:00:00')]</bpelx:target>
            </bpelx:remove>
          </extensionAssignOperation>
        </assign>
    I have tried multiple variations of the predicate, but I can't seem to figure it out.  Right now I am getting an error in J Developer that specifies it is expecting an "]" right after the "//*[." portion of the predicate.  Any ideas on this would be greatly appreciated.
    Thanks

    You can't use spaces.
    you have wrong this part of your text:
    [ . instance of xsd:dateTime and xsd:dateTime(.) = xsd:dateTime('0001-01-01T00:00:00')]
    check it.

  • ACLs and editing XML files using OEM

    Hi,
    How to edit the registered schema file using OEM?
    I tried, but did not allow to edit.
    What previliges do a user need to update? In my case, even the user with DBA, XDBADMIN roles can not edit the content of the schema in OEM. Is it possible?
    In case of acls, there are four xml files. Are they assigned to resources or is it possible to assign them to users as well?
    I mean to say is it possible that different users have diifernt access to resources?
    Thanks.

    Hi
    It is not possible to update a schema via OEM.
    The only way (except via SQL) is to use an editor that supports WebDAV.
    Notice that no schema evolution is supported in 9i, i.e. you should have no types or tables that depend from it.
    In the ACL you can specify which user or role has access to the resource associated to it.
    Chris

  • How to edit xml using jdom

    hi
    how to read and edit xml file using jdom, i tried using
    javax.xml.transform.*; // JAXP
    javax.xml.transform.dom.DOMSource; //
    i can read xml file . but iam not able to edit the xml file.
    how to achive this

    1. Select nodes to be modified with the JDom XPath class selectSingleNode and selectNodes methods.
    SAXBuilder saxBuilder=new SAXBuilder("org.apache.xerces.parsers.SAXParser");
    org.jdom.Document jdomDocument=saxBuilder.build(new File("c:/input.xml"));
    org.jdom.Element node= (org.jdom.Element)(XPath.selectSingleNode(jdomDocument,"/root/node"));
    2. Modify the node values with the Element class setter methods.
    3. Output document with the XMLOutputer class.

  • Convertion of XML node to string using Xquery transformation in OSB

    How to convert XML node to string using a built in function using Xquery transformation in OSB? In BPEL we have the Xpath extension function ora:getContentAsString() to do the same.

    fn:bea-serialize() function converts xml node to string. but it assigns namespace prefix in every xml node during the conversion. So is there any function to remove the namespace prefix from XML node using Xquery built in function?

  • Create an attribute on an xml node

    Hello,
    I can't find how to make an attribute on an xml node using javascript.
    I have found assignNode() to create a node but nothing about attribute.
    Does anybody know about this ?
    Thanks by advance
    Samuel

    To use the assignNode, you will need to create the node first. You can use the xfa.form.createNode() method to create an object from the XFA object model hierarchy. This method returns an object reference which you then pass to assignNode() of the appropriate parent object

  • Depth of a xml node

    Hi;
    I have to write an java code, which calculates the maximal depth of a xml node, using DOM.
    Has anyone an idea?

    YouY wrote:
    your code implies that the depth count begin from the children to the parent. But in my case I know the parent node (root) but I dont know how many children and grandchildren it has.You basically have to search for your Node from the root and keep track of a 'depth' number. Recursion is your friend:
    public int getNodeDepth(Node node, Node wanted, int depth) {
       if (node == null) return -1; // nothing to look for here, please walk on
       if (node == wanted) return depth; // found it
       for (Node child : node.getChildren()) {
          int found= getNodeDepth(child, wanted, depth+1)
          if (found >= 0) return found;
       return -1; // not found
    }You have to call this method as getNodeDepth(root, wanted, 0) to start the circus.
    kind regards,
    Jos
    ps. warning, untested code

  • How to Edit the xml node value using flex from the front end UI

    Hi All,
    I am having a use case with flex 4.6
    1> To read the external xml file
    2> Display the tree structure in the front end UI
    3> Edit the node values of the xml file from the front end UI and save it back
    How to go about the above use case, any blogs or links on the above case will be help
    Thanks,
    Alok

    Check this is example:
    http://blog.flexexamples.com/2009/07/23/deleting-nodes-from-an-xml-object-in-flex/

  • How to edit/update data into an XML file using Flex and Actionscript

    I can read an external xml file, please see the code below:
    protected function button1_clickHandler(event:MouseEvent):void
    var GrowthChartsDataGrid:XML;
    var loader:URLLoader = new URLLoader();
    var request:URLRequest = new URLRequest("../GrowthChartsDataGrid.xml");
        loader.load(request);
        loader.addEventListener(Event.COMPLETE, onComplete)
    function onComplete (event:Event)
         var loader:URLLoader = URLLoader(event.target);
         GrowthChartsDataGrid = new XML(loader.data);
         GrowthChartsDataGrid.GrowthChartGridView += <Month> {txtMonth.text} <Weight> {txtWeight.text} </Weight> </Month>
         texttesting.text = GrowthChartsDataGrid.toString();
    I can read an XML file and can add an extra node and can display it in a text filed. But I want to update the XML file contents which will come from the txtMonth and txtWeight text boxes.
    Please any suggestions???

    First of all thanks for your quick reply .
    I actually want to add another node inthe xml file. Files is at a local location and i can read the file and add an extra node (but I cant store this extra node in the actual XML file). But I want to save XML with the extra node.
    For exmaple,
    my current xml is:
    <?xml version="1.0" encoding="utf-8"?>
    <GrowthChartGridView>
        <Month> 1
        <Weight>3.5</Weight></Month>
    <Month> 2
        <Weight>3.9</Weight></Month>
    <Month> 3
        <Weight>4.5</Weight></Month>
    </GrowthChartGridView>
    and at run time, I can create a new node using the data from two textboxes at button click event.
         GrowthChartsDataGrid.GrowthChartGridView += <Month> {txtMonth.text} <Weight> {txtWeight.text} </Weight> </Month>
    Now what I want to do is, I want to add this node back in to my XML. Therefore, the result I am looking for is, my local XML should update like this.
    <?xml version="1.0" encoding="utf-8"?>
    <GrowthChartGridView>
        <Month> 1
        <Weight>3.5</Weight></Month>
    <Month> 2
        <Weight>3.9</Weight></Month>
    <Month> 3
        <Weight>4.5</Weight></Month>
    <Month> {txtMonth.text} <Weight> {txtWeight.text} </Weight> </Month>  //I can read data from text boxes so its fine but I can not store this in to                                                                                                          my original XML
    </GrowthChartGridView>
    Thanks

  • How to Edit perticular node in XML

    How to edit Perticular XML node ?
    <root>
    <node1>
    <data1>   dsfs  </data1>
    <data2>   dsfs  </data2>
    <data3>   dsfs  </data3>
    <data4>   dsfs  </data4>
    </node1>
    </root>What should i do to change data3 value, means edit data of <data3> ??
    help me

    Retriece data3 node with XPath or DOM. Set node value with setNodeValue() method.

  • SSMS 2012:FOR XML PATH Using XPath Node Tests-Columnn name 'test()' contains an invalid XML identifier as required by FOR XML?

    Hi all,
    I am learning XPATH and XQUERY from the Book "Pro T-SQL 2008 Programmer's Guide" written by Michael Coles, (published by apress). I copied the Code Listing 12-8 FOR XML PATH Using XPath Node Tests (listed below) and executed it in my
    SQL Server 2012 Management Studio:
    --Coles12_8.sql // saved in C:/Documemnts/SQL Server Management Studio
    -- Coles Listing 12-8 FOR XML PATH Using XPATH Node Tests
    -- Retrieving Name and E-mail Addresses with FOR XML PATH in AdvantureWorks
    -- 16 March 2015 0935 AM
    USE AdventureWorks;
    GO
    SELECT
    p.NameStyle AS "processing-instruction(nameStyle)",
    p.BusinessEntityID AS "Person/@ID",
    p.ModifiedDate AS "comment()",
    pp.PhoneNumber AS "test()",
    FirstName AS "Person/Name/First",
    MiddleName AS "Person/Name/Middle",
    LastName AS "Person/Name/Last",
    EmailAddress AS "Person/Email"
    FROM Person.Person p
    INNER JOIN Person.EmailAddress e
    ON p.BusinessEntityID = e.BusinessEntityID
    INNER JOIN Person.PersonPhone pp
    ON p.BusinessEntityID = pp.BusinessEntityID
    FOR XML PATH;
    I got the following error message:
    Msg 6850, Level 16, State 1, Line 2
    Column name 'test()' contains an invalid XML identifier as required by FOR XML; '('(0x0028) is the first character at fault.
    I have no ideas why I got this error message.  Please kindly help and advise me how to resolve this error.
    Thanks in advance,  Scott Chang

    Hi Michelle, Thanks for your nice response.
    I corrected the mistake and executed the revised code. It worked nicely.
    I just have one question to ask you about the appearance of the xml output of my Co;les12_8.sql:
    <row>
    <?nameStyle 0?>
    <Person ID="1" />
    <!--2003-02-08T00:00:00-->697-555-0142<Person><Name><First>Ken</First><Middle>J</Middle><Last>Sánchez</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="2" />
    <!--2002-02-24T00:00:00-->819-555-0175<Person><Name><First>Terri</First><Middle>Lee</Middle><Last>Duffy</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="3" />
    <!--2001-12-05T00:00:00-->212-555-0187<Person><Name><First>Roberto</First><Last>Tamburello</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="4" />
    <!--2001-12-29T00:00:00-->612-555-0100<Person><Name><First>Rob</First><Last>Walters</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="5" />
    <!--2002-01-30T00:00:00-->849-555-0139<Person><Name><First>Gail</First><Middle>A</Middle><Last>Erickson</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="6" />
    <!--2002-02-17T00:00:00-->122-555-0189<Person><Name><First>Jossef</First><Middle>H</Middle><Last>Goldberg</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="7" />
    <!--2003-03-05T00:00:00-->181-555-0156<Person><Name><First>Dylan</First><Middle>A</Middle><Last>Miller</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="8" />
    <!--2003-01-23T00:00:00-->815-555-0138<Person><Name><First>Diane</First><Middle>L</Middle><Last>Margheim</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="9" />
    <!--2003-02-10T00:00:00-->185-555-0186<Person><Name><First>Gigi</First><Middle>N</Middle><Last>Matthew</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="10" />
    <!--2003-05-28T00:00:00-->330-555-2568<Person><Name><First>Michael</First><Last>Raheem</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="11" />
    <!--2004-12-29T00:00:00-->719-555-0181<Person><Name><First>Ovidiu</First><Middle>V</Middle><Last>Cracium</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    I feel this xml output is not like the regular xml output.  Do you know why it is diffrent from the regular xml xml output?  Please comment on this matter.
    Thanks,
    Scott Chang
    What do you mean by regular xml document? Are you referring to fact that its missing a root element? if yes it can be added as below
    USE AdventureWorks;
    GO
    SELECT
    p.NameStyle AS "processing-instruction(nameStyle)",
    p.BusinessEntityID AS "Person/@ID",
    p.ModifiedDate AS "comment()",
    pp.PhoneNumber AS "text()",
    FirstName AS "Person/Name/First",
    MiddleName AS "Person/Name/Middle",
    LastName AS "Person/Name/Last",
    EmailAddress AS "Person/Email"
    FROM Person.Person p
    INNER JOIN Person.EmailAddress e
    ON p.BusinessEntityID = e.BusinessEntityID
    INNER JOIN Person.PersonPhone pp
    ON p.BusinessEntityID = pp.BusinessEntityID
    FOR XML PATH('ElementName'),ROOT('RootName');
    replace ElementName and RootName with whatever name you need to set for element as well as the root element
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Reading an xml file in actionscript using flex3

    plzz tell me how to read an xml file in actionscript using flex3.......

    One possible option to parse an xml-file to a flex XML object:
    public function parseConXML(source:String):void
                    xmlLoader = new URLLoader();
                    xmlLoader.load(new URLRequest(source));
                      // Eventlistener: if URL loaded --> onLoadComplete function
                      xmlLoader.addEventListener(Event.COMPLETE, xmlLoadComplete);
                public function xmlLoadComplete(evt:Event):void{               
                    var xml:XML = new XML();
                     // ignore comments in XML-File
                    XML.ignoreComments = true;  
                       //ignore whitespaces in XML-File
                     XML.ignoreWhitespace = true;
                    // XML-Objekt erstellen
                    xml = new XML(evt.target.data);
                   //AFTERWARDS use your xml as your wish

Maybe you are looking for

  • BOOTMGR is missing in Windows Server 2008 R2

    I have tried putting the dvd in and then running the recovery console via the command prompt.  I only have the options for "system Image Recovery", "Windows Memory Diagnostic" and Command Prompt. I ran Bootrec /RebuildBcd, Bootrec /FixMbr and Bootrec

  • Laptop no longer can mount my external hard drive

    After updating to Mavericks, my laptop no longer can mount my external hard drive. What on earth is going on here and how can I fix this?

  • Dust inside my Nokia lumia 820 camera

    Dusts accumulate inside my camera (both back and front). What can I do to remove them and to prevent it from happening again? My camera has become useless now. Solved! Go to Solution.

  • There is NO "Deauthorize All" option.

    Trying to set up a new laptop and want it to have authorization for my iTunes account.  Yet I received a message that there are already 5 auth's currently in use.  I want to Deauthorize All and start fresh, yet I do NOT see that option (as I'm told I

  • No rear speaker sound with Audigy 4 and Vista x64

    I recently upgraded to Vista x64. I downloaded the 6.0..24 driver for x64. I also loaded MediaSource for x64. I am using analog 5. surround speakers from Dell. This setup works fine when I boot into XP pro (with the XP drivers), but I only get front,