How to bind XML in Actionscript?

I'm having difficulty working with binding in actionscript.  In MXML I can use the following line:
<mx:Label x="117" y="40" text=" {stationXML.getItemAt(Station-1).CDL0.@value}" id="lblTest"/>
However, in actionscript, I cannot seem to get the binding to work! I tried the following:
BindingUtils.bindProperty(lblTest,"text",stationXML.getItemAt(Station-1).CDL0,"value");
Any ideas how I can do this in Actionscript?  I need to do it in ActionScript becuase the "CDL0" value will need to be replaced at times with "CDL1", "CDL2", etc...

I solved the issue, so if anyone else has the same problem, here's what I did (after much aggravation):
The reason I didnt use MXML binding was because I wanted to be able to change it from "CDL0" to "CDL1" to "CDL3" without manually changing bindings.
What I set in MXML for the text was:
{stationXML.getItemAt(Station-1).child(cdlstr).@value}
where 'cdlstr' was a public string declared (and set) elsewhere in the program.
So I could make 'cdlstr' = "CDL0" or "CDL1" or even "CDL" + i (if I wanted to make life easy).  Just needed to remember to make 'cdlstr' a bindable variable or else it all falls apart.
Hope it helps someone else.

Similar Messages

  • How to bind XML to Datagrid?

    My xml is here:
    <?xml version="1.0"?><ITRequests><CallInfo><id type="INT UNSIGNED">42</id><request_no type="VARCHAR">1313_IT_220520100709</request_no><requester_uid type="VARCHAR">administrator</requester_uid><request_date type="VARCHAR">22-May-2010 07:09:34 PM</request_date><title type="VARCHAR">Printer Installation</title><status type="VARCHAR">Closed</status></CallInfo><CallInfo><id type="INT UNSIGNED">43</id><request_no type="VARCHAR">1314_IT_220520100718</request_no><requester_uid type="VARCHAR">administrator</requester_uid><request_date type="VARCHAR">22-May-2010 07:17:49 PM</request_date><title type="VARCHAR">Software Installation</title><status type="VARCHAR">In Progress</status></CallInfo><CallInfo></ITRequests>
    I don't know how to bind this to a simple datagrid.
    Can someone help me please?
    PS: The data is in a String variable.
    Thanks,
    Nith

    Getting your data in the form a string is a PITA. Can you just use the XML itself, and convert it to an ArrayCollection? Then you could just use an HTTP request, for instance, to retrieve it.
    Anyway, here is the code you need. It also demonstrates using E4X syntax to filter out the root node.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"creationComplete="initApp()"
    >
    <mx:Script>
    <![CDATA[
    import mx.collections.XMLListCollection; 
    import mx.collections.ArrayCollection; 
    private var strData:String = "<?xml version='1.0'?><ITRequests><CallInfo><id type='INT UNSIGNED'>42</id><request_no type='VARCHAR'>1313_IT_220520100709</request_no><requester_uid type='VARCHAR'>administrator</requester_uid><request_date type='VARCHAR'>22-May-2010 07:09:34 PM</request_date><title type='VARCHAR'>Printer Installation</title><status type='VARCHAR'>Closed</status></CallInfo><CallInfo><id type='INT UNSIGNED'>43</id><request_no type='VARCHAR'>1314_IT_220520100718</request_no><requester_uid type='VARCHAR'>administrator</requester_uid><request_date type='VARCHAR'>22-May-2010 07:17:49 PM</request_date><title type='VARCHAR'>Software Installation</title><status type='VARCHAR'>In Progress</status></CallInfo></ITRequests>";[
    Bindable] 
    private var acData:ArrayCollection; 
    private function initApp():void{     getCallInfo();
    private function getCallInfo():void{ 
    //Convert string to XML:
    var sxml:XML = new XML(strData); 
    //Create an ArrayCollection.
    //Just get the 'CallInfo' nodes (ignoring the root node, 'ITRequests'):
    acData =
    new ArrayCollection(new XMLListCollection(new XMLList(sxml..CallInfo)).toArray()); 
    trace(acData);}
    ]]>
    </mx:Script>
    <mx:DataGrid 
    dataProvider="{acData}">
         <mx:columns>
              <mx:DataGridColumn dataField="id" width="50"/>
              <mx:DataGridColumn dataField="request_no" width="180"/>
         </mx:columns></mx:DataGrid>
    </mx:Application>

  • How to bind xml generated by guide in Soap request message and then unbind it?

    Hi
    I have issue in "invoke web service" in adobe LC process ?
    Actually , i have process, a long lived, which take input as xml . this xml(data) it get from guide data submission in browser by user?
    Now , what i need to achieve here is that i have to invoke this long lived process in one of my other process via "invoke web service" option.And to do that, i need to bind the xml into Soap message and then it unbind to back same xml in the other process to use it?
    so, my question here is how can i achieve that?

    Hello Iñaki
    Thanks for your reply.
    I had read the blog about the XMLAnonymizerBean. It looks very straightforward, and in theory should do just what I need.
    I've added the anonymizer bean as the first module as the SOAP message is asynchronous, and I want to remove the namespaces from the request.
    I want to exclude all namespaces so I haven't set any parameters.
    The SOAP channel in Communication Channel monitor has a status of 'Channel Started but inactive'. I cannot see any messages in the Processing Details for this channel, even though I have sent test messages from Java code and from RWB (the message from RWB without the namespace does reach the receiver). This makes me wonder if I have not configured the interface to use the new SOAP channel correctly, although I can see it in the Receiver Determination configuration overview.
    I can see the messages in SXMB_MONI but can't find which communication channel is being used by the sender.
    I'm using PI 7.1.
    regards
    Steve

  • How to bind xml or any data to a mobile list in Dreamweaver?

    I am trying to figure out what should be a simple thing in Dreamweaver.
    That is while using jquery mobile, how do I attach an xml file to the attribute list elements?
    If that isn't possible, would someone be able to tell me or direct me to a way to handle data within Dreamweaver for mobile apps. I'm over the top trying to figure out all of the technologies. It appears that HTML5, xml, sqlite, and json all have possibilities. I have a simple database of maybe 300 items: an image and a description. The data will reside and be read client side on the mobile app.
    I want to read the items into a list. Then call up individual items on a new "page" based on the user's list item selection. This is so easy in Dashcode under Mac. Surely, I must be missing something in Dreamweaver 5.5.
    TIA to anyone who tries to point me in the right direction.

    Have a look here http://books.google.com.au/books?id=kJ5ZWFZtWFgC&pg=PA113&lpg=PA113&dq=spry+datasets+and+j query+mobile&source=bl&ots=l8vMEvoRZn&sig=rZYgQGSdsxX64jCQPnFFqJdMwFg&hl=en&sa=X&ei=xpwPT8 GRIumiiAeztrQK&sqi=2&ved=0CF4Q6AEwBw#v=onepage&q=spry%20datasets%20and%20jquery%20mobile&f =false (apologies for the lenth of the URL) and here http://foundationphp.com/dwmobile/
    Gramps

  • How to bind list data to XML Web service request

    How do I bind specific columns in a DataGrid to the Web
    service request? I'm having trouble finding any documentation that
    addresses that specific pattern, i.e. sending a complex list to the
    server via a Flex Web service send() command. I'm fairly new to
    Flex programming and don't know if what I want to do is possible.
    Here what I've been able to do so far.
    1. Using a Web service called a service on the server and
    retrieved a complex list.
    2. Poplulated a DataGrid with the result
    3. The user has selected multiple rows from the DataGrid
    using a checkbox column
    4. The user pressed a button that calls a Web service send().
    This Web service should only send data from only two columns and
    only for those rows the user has checked.
    5. I can loop over the DataGrid and find the selected rows
    and put them in another ArrayCollection called 'selectedRows'.
    The issue is that I don't know how to bind 'selectedRows' to
    the Web service. Right now I'm reading up on "Working with XML" in
    the Programming with ActionScript 3.0 chapter. But I'm just fishing
    here. No bites yet.

    Don't bind. Build the request object programatically, as you
    are doing with your selectedRows AC, and send(myObject) that.
    Tracy

  • ActionScript to bind XML data to components

    How can I use ActionScript to bind XML data to a comboBox
    component instead of using the component inspector? (I have done
    the latter, successfully, but that doesn’t allow access to
    the code - .)
    My ActionScript so far imports the data (the trace picks it
    up) – but the ‘cbType.dataProvider line’
    doesn’t work. It works when I change the data provider to an
    array – so what am I doing wrong?
    MY CODE:
    import mx.data.components.XMLConnector;
    var xcFestival:XMLConnector = new XMLConnector();
    xcFestival.ignoreWhite = true;
    xcFestival.direction = "receive";
    xcFestival.URL = "festivalItems.xml";
    xcFestival.trigger();
    //POPULATE THE COMPONENTS WITH THE DATA
    var festXMLlistener:Object = new Object();
    festXMLlistener.result = function(evt:Object) {
    trace(xcFestival.results);
    cbType.dataProvider = xcFestival.results;
    xcFestival.addEventListener("result",festXMLlistener);

    This is on a stand - alone system
    Using Designer ES ......
    I saved the Form as an xdp form
    and it seems as if all goes well until
    View the data and nothing appears - or
    just the names of the fields appear

  • How to bind korean parameters in XSQL????

    Hi,
    I am binding english parameters in XSQL very well.
    But when I am trying to bind japaneese or korean it is not displaying rows.
    I am giving the sample code.
    hello.xsql
    <?xml version="1.0" encoding="euc-kr"?>
    <xsql:query connection="scs" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:xsql="urn:oracle-xsql" row-element="ADDRESSES_ROW">
    select * from emp where name='{@name}'
    </xsql:query>
    Request: http://hello.xsql?name=JOHN ::: working fine
    Request: http://hello.xsql?name=koreanName :::Not working
    Please help me in this regard.
    How to bind name in korean in XSQL servlet..
    Regards,
    sudhi

    Do you have nlscharset_12.jar in your classpath?
    what web server are you using XSQL with?
    Have you tried using real bind variables like this:
    <xsql:query bind-params="name">
    select * from emp where ename = ?
    </xsql:query>
    Does a query like:
    <xsql:query bind-params="name">
    select * from emp
    </xsql:query>
    return the korean data to the browser correctly?

  • How to receive XML from Flex HTTP POST

    Hi,
    We curreontly have a setup where we have a FLEX frontend send an XML through a HTTP POST and awaiting a response also in XML. On the backend this is handled relatively simply by a PHP script that basically does the following:
    read data (in XML)from FlEX HTTP POST into a new temp XML file.
    execute a c++ program with the XML file as one of the parameter.
    return the result to FLEX
    We have decided to move to BlazeDS for various reasons.
    Looking at the examples bundled with BlazeDS they have a jsp example that returns an XML result to FLEX so that part is fine. I am trying to find an example of JSP (or Servlet) that is able to read the XML data from FLEX and write it into a temp XML file. I would then try to use runtime.exec to invoke a local C++ program to process the XML file the result of which will be sent back to FLEX.
    Any help will be very much appreciated!

    <div class=Section1><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>I&#8217;d avoid calling an executable just to process XML &#8211;your<br />application server would provide enough support for reading and writing XML, no?<br />Also, if you&#8217;re only planning on working with XML then even BlazeDS might<br />be overkill because its focus is on sending strongly typed ActionScript data efficiently<br />to and from a client (it&#8217;s true that it does have a proxy service, but<br />that is not involved with processing the actual XML data).<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>How complex is your XML? Do you need to resolve ids and<br />references or can you parse it top down in a single pass? There are several<br />well known libraries in Java for dealing with XML &#8211; the choice depends on<br />how you need to interact with the XML. Most of them take an InputStream as a<br />source for reading XML and you can get the InputStream from the servlet<br />request. Googling should turn up numerous examples.<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Pete<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><br /><br /><div><br /><br /><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><br /><br /><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span<br />style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> khwong<br />[mailto:[email protected]] <br><br /><b>Sent:</b> Sunday, September 28, 2008 12:09 PM<br><br /><b>To:</b> [email protected]<br><br /><b>Subject:</b> How to receive XML from Flex HTTP POST<o:p></o:p></span></p><br /><br /></div><br /><br /></div><br /><br /><p class=MsoNormal><o:p> </o:p></p><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>A new discussion was started by<br />khwong in <br><br /><br><br /><b>General Discussion</b> --<br><br />  How to receive XML from Flex HTTP POST<br><br /><br><br />Hi, <br><br /><br><br />We curreontly have a setup where we have a FLEX frontend send an XML through a<br />HTTP POST and awaiting a response also in XML. On the backend this is handled<br />relatively simply by a PHP script that basically does the following: <br><br /><br><br />read data (in XML)from FlEX HTTP POST into a new temp XML file. <br><br />execute a c++ program with the XML file as one of the parameter. <br><br />return the result to FLEX <br><br /><br><br />We have decided to move to BlazeDS for various reasons. <br><br /><br><br />Looking at the examples bundled with BlazeDS they have a jsp example that<br />returns an XML result to FLEX so that part is fine. I am trying to find an<br />example of JSP (or Servlet) that is able to read the XML data from FLEX and<br />write it into a temp XML file. I would then try to use runtime.exec to invoke a<br />local C++ program to process the XML file the result of which will be sent back<br />to FLEX. <br><br /><br><br />Any help will be very much appreciated! <o:p></o:p></p><br /><br /><div class=MsoNormal><br /><br /><hr size=2 width=200 style='width:150.0pt' align=left><br /><br /></div><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>View/reply at <a<br />href="http://www.adobeforums.com/webx?13@@.59b69b23">How to receive XML from<br />Flex HTTP POST</a><br><br />Replies by email are OK.<br><br />Use the <a<br />href="http://www.adobeforums.com/webx?280@@.59b69b23!folder=.3c061a83">unsubscribe</a>< br />form to cancel your email subscription.<o:p></o:p></p><br /><br /></div><br /><br /></div>

  • How to bind dynamic data to JNet

    Develop tools: NWDS 7.1
    Server: Windows2000
    Does anyone have experiences with using JNET within Webdynpro Project ?
    In our case, we use JNet to generate a hierachical network diagram in the Webdypro's GUI. The data source is from the tables in a DB. However, till now, we only know how to let JNet generate the network diagram from a static XML file.
    Since the data in the DB changes all the time, how to let the network diagram reflect the newest data status automatically? That is, how to bind JNet to a dynamic data source then?

    Hi,
    Network UI element is related with Jnet. What you need to start up working with this is you need to create a context structure mentioned below.
    Node:Source
    Element--- xml -> this should be of type binary.
    Place the following code in the init.
    ISimpleTypeModifiable mod = wdContext.nodeSource().getNodeInfo().getAttribute("xml").getModifiableSimpleType();
    IWDModifiableBinaryType bin = (IWDModifiableBinaryType)mod;
    bin.setMimeType(new WDWebResourceType("xml", "application/octet-stream", false));
    ISourceElement element =wdContext.nodeSource().createSourceElement();
    wdContext.nodeSource().addElement(element);
    try
    fileName = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), "jnettest.xml");
    element.setXml(readFile(fileName));
    catch (WDAliasResolvingException e)
    You have to place the Jnet test.xml under the mimes folder of your application.
    Place the network element in the view and in the data source specify the context attribute source.xml
    if your xml file complies with the jnet schema your application will render it.
    Pl go through this
    Using the "Network" UI Element
    Regards
    Ayyapparaj

  • How to delete xml tags Urgent

    on release function i am inserting this value
    "(&-box*&", "&*box-&
    " in to my text box,
    in text box will display like this (squarebox), when i am
    trying to delete
    squarebox ,
    box deleting but
    (&-box*&", "&*box-&
    these xml elements are showing , what i have to
    do ? it has to delete,
    it amy have multipule box in my equation. how do delete xml
    elements in this case, this is my xml code. how to delete? any one
    can help me?

    Then you should provide more details on what you want this new script should do.
    To "delete XML tags in already tagged text", all you need is use the "untag" command on an XML Element. But how would the script "know" what XML Element should be untagged?
    Disclaimer: This reply is in no way enforceable, legally binding, a promise or contract, an agreement (written, verbal, or otherwise), a commitment, obligation, or free or paid-for offer of any kind to further help, guide, aid, tip, or not hinder you, or contribute to, correct, investigate, comment on or assist with any existing, forthcoming, or planned project.

  • Clientgen with JAXWS -- how to bind with JAXB?

    I'm using WLS 10.0 "clientgen" to generate Java classes from my WSDL files. All goes well for the simpler WSDL files. Since I'm new to JAXB, I don't quite understand now how to bind the output files using JAXB. It seems this would have been done in the 'clientgen' process, but I don't see any parameters for this in the documentation/help output.
    Here's the ant snippet:
    <target name="wsdl2java" depends="init" >
    <clientgen
    type="JAXWS"
    wsdl="${sitedata.wsdl.file}"
    destDir="${generated.class}"
    serviceName="SiteData"
    packageName="${output.package}.sitedata"/>
    </target>
    How can this be done?

    The <binding> child element of the WLS 10.0 wsdlc Ant task, does in fact allow you to pass a .xjb file to the wsimport Ant task. wsdlc calls wsimport internally.
    When you do this, you want to do all of your namespace-to-Java-package mapping in the .xjb file, and not specify the packageName attribute on the wsdlc Ant task. In fact, doing the latter will override the mapping specified in the .xjb file.
    Here's a sample Ant target that shows what this looks like:
    <target name="run-wsdlc" depends="clean">
    <taskdef name="wsdlc" classname="weblogic.wsee.tools.anttasks.WsdlcTask" classpathref="compile.classpath" />
    <mkdir dir="${src.dir}"/>
    <property name="client.binding" value="custom-client.xjb"/>
    <wsdlc
    type="JAXWS"
    srcWsdl="etc/${wsdl.file.name}.wsdl"
    destJwsDir="WebContent/WEB-INF/lib"
    destImplDir="${src.dir}"
    explode="false"
    verbose="${verbose}"
    debug="${debug}"
    failonerror="true"
    >
    <binding dir="etc" includes="${client.binding}"/>
    <classpath>
    <path refid="compile.classpath"/>
    </classpath>
    </wsdlc>
    </target>
    And here's the contents of the custom-client.xjb file:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <bindings
    xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
    xmlns="http://java.sun.com/xml/ns/jaxws"
    wsdlLocation="DataStagingService2.wsdl"
    >
    <bindings
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    node="wsdl:definitions"
    >
    <package name="services.datastaging">
    <jxb:javadoc>
    <![CDATA[<body>Package level documentation for generated package services.datastaging.</body>]]>
    </jxb:javadoc>
    </package>
    <jxb:schemaBindings>
    <jxb:package name="com.acmeworld.irad.services.datastaging"/>
    </jxb:schemaBindings>
    </bindings>
    </bindings>
    The targetNamespace attribute for the DataStagingService is http://www.acmeworld.com/irad/services/datastaging. The above .xjb file says to map this to the services.datastaging Java package, but the skeleton JAX-WS service endpoint implementation class that wsdlc generates, doesn't currently honor this. The JAXB generated classes will be as specified in the .xjb file, but you'll need to manually refactor the Java package name of the wsdlc generated JAX-WS skeleton class, to be services.datastaging.
    I'll be publishing a series of articles on using JAXB and JAX-WS with WebLogic 10.0, so look out for them in the coming months :-)
    HTH,
    Mike Wooten

  • How to bind soap header using jax-rpc

    To Whom It May Concern:
    I am using Rad7, Ibm Websphere 6.1, on Windows XP.
    I created an SoapHeader first using a string and bind it using jax-ws.
    It works for jax-ws but unfortunately, my work services uses jax-rpc.
    Does anybody know how to bind the soap header using jax-rpc.
    Any help or hint would be greatly appreciated it.
    Here is my code:
    import org.apache.cxf.headers.Header;
    import org.apache.cxf.headers.Header.Direction;
    import org.apache.cxf.helpers.DOMUtils;
    import org.apache.cxf.binding.soap.SoapHeader;
    import javax.xml.namespace.QName;
    import java.io.StringReader;
    import java.util.List;
    import java.util.ArrayList;
    import javax.xml.ws.BindingProvider;
                   @Test
         public void testService() throws Exception {     
                   try
                        URL wsdlURL = new URL("http://localhost:9087/abc/services/ServiceABCService");
                        ServiceRequestServiceService service = new ServiceRequestServiceServiceLocator();
                        ServiceRequestService port = service.getServiceRequestService(wsdlURL);
                   //How to Add Soap Header using jax-ws
              String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><ABCHdrRq "
              + "xmlns=\"http://xmlns.ABCgc.net/ABC/2002/header/\" "
              + ">"
              + "<version>1.0</version><srcInfo><chType>abc</chType><chInst>0124</chInst>" +
                        "<appName>sSAR</appName><hostName>DW70210521</hostName><userId>fxue</userId>" +
                        "</srcInfo><startTimeStamp>2010-06-04T13:44:45.132</startTimeStamp><clientDt>2010-06-04T13:44:53.242</clientDt><serviceInfo><serviceName>ServiceRequestService</serviceName>" +
                        "<serviceFunc>addServiceRequest</serviceFunc></serviceInfo>" +
                   "<prevTransInfo><prevRqUID>BORS2010-06-04T13:41:10.2067f9368d1-8c5c</prevRqUID>" +     
                   "<prevRespTimestamp>2010-06-04T13:41:10.871</prevRespTimestamp>"+
                   "<prevRespEndTimestamp>2010-06-04T13:41:10.902</prevRespEndTimestamp>+</prevTransInfo>"+
                   "</ABCHdrRq>";
              SoapHeader dummyHeader1 = new SoapHeader(new QName("uri:http://xmlns.ABCgc.net/ABC/2002/header/", "ABCHdrRq"),
              DOMUtils.readXml(new StringReader(xml)).getDocumentElement());
              dummyHeader1.setDirection(Direction.DIRECTION_OUT);
              List<Header> headers = new ArrayList<Header>();
                   headers.add(dummyHeader1);
                   ((BindingProvider)port).getRequestContext().put(Header.HEADER_LIST, headers);
                   //How to Add Soap Header to the request using jax-ws
                   catch(Exception e)
                        System.out.println("Exception message:"+e.getMessage());
    Yours,
    Frustrated

    Well, how an attachment is processed depends on your application logic...if your application logic requires to processing attachments and verify it before processing the SOAP message, handlers could be better option.
    If you need to process the attachment while processing the SOAP message, you can do it in the service implementation class.
    In both the cases you need to get access to SOAPMessage object and from there get the attachments with getAttachments method.

  • Howto dynamicly bind XML element to a TextInput using BindingUtils?

    The question is: Howto dynamicly bind XML element to a
    TextInput component using BindingUtils?
    Now I use following codes:
    <!--
    [Bindable] private var xml: XML =
    <item><label>list1</label></item>;
    // initialize code for application's initialize event
    private function init(): void {
    BindingUtils.bindProperty(txtDemo, "text", xml, "label");
    //click event
    private function test(): void {
    xml.label = "something";
    // txtDemo.executeBindings(); //---- no use anymore
    -->
    <mx:TextInput id="txtDemo"/>
    <mx:Button label="Test" click="test()"/>
    My really idea is when bindable xml property is changed, then
    the textinput will be updated as hoped. However, no update happens
    to me when I click the Test button.
    But, if I make codes like that:
    <mx: TextInput id="txtDemo" text="{xml.label}"/>
    the text will updated when xml changs.
    So, what happened, I indeed need the dynamicly bind to the
    textinput compont.
    Help me. thanks.

    You could use an ObjectProxy since all subproperties will
    then be bindable:
    private var _xml:XML =
    <item><label>list1</label></item>;
    private var _opXML:ObjectProxy = new ObjectProxy(_xml);
    then in your init() function you declare _opXML as the host
    object with the bindable property "label"...
    // initialize code for application's initialize event
    public function init(): void {
    BindingUtils.bindProperty(txtDemo, "text", _opXML, "label");
    //click event
    private function test(): void {
    _opXML.label = "something";
    You'll notice that if you check your original _xml.label
    property with ChangeWatcher.canWatch(), it returns false. But if
    you create a dedicated object with a property that can be declared
    as bindable, canWatch() returns true. You'd probably be best off to
    write a lightweight class that can act as your model if you want to
    work with dynamic XML binding using Actionscript. This will allow
    you to use a bindable getter and setter that will give you the
    dynamic functionality you're looking for.
    Hope that helps.

  • How to access XML elements by name in Extendscript??

    I'm almost done the script that I've been working on, but something has been nagging me since I started. When I did start, I looked at the JS Tools Guide CS5 that comes with the extendscript ide to check how to access XML elements, children, attributes etc. It says this:
    The XML object represents an XML element node in an XML tree. The topmost XML object for an XML file
    represents the root node. It acts as a list, which contains additional XML objects for each element. These in
    turn contain XML objects for their own member elements, and so on.
    The child elements of an element tree are available as properties of the XML object for the parent. The
    name of the property corresponds to the name of the element. Each property contains an array of XML
    objects, each of which represents one element of the named type.
    So basically it converts the XML into JSON. And you can access the properties like so:
    <book category="COOKING">
         <title lang="en">The Boston Cooking-School Cookbook</title>
         <author>Fannie Merrit Farmer</author>
         <year>1896</year>
         <price>49.99</price>
    </book>
    The Javascript statement bookstoreXML.book; returns the entire list of books.
    The statement bookstoreXML.book[0]; returns the XML object for the first book.
    The statement bookstoreXML.book[0].author; returns all authors of the first book.
    A couple pages down it talks about Retrieving contained elements using children(), elements(), descendants().
    So now I look through the XML Object properties and I see that I can use:
    xmlObj.child (which) which A String, the element name, or a Number, a 0-based index into this node’s child array.
    or
    xmlObj.descendants ([name])
    name Optional. A String, the element name to match. If not provided, matches all
    elements.
    or
    xmlObj.elements (name);
    name Optional. A String, the element name to match. If not provided, matches all
    elements.
    This is an excerpt of an XML I was working with:
    <ROW xmlns="http://www.filemaker.com/fmpdsoresult"
         MODID="16"
         RECORDID="11128">
       <Sign_Type>251.dr</Sign_Type>
       <fm:Location xmlns:fm="http://www.filemaker.com/fmpdsoresult" xmlns="">5-5024</fm:Location>
       <Line1>Zone
    Floor
    3
    Patient Rooms
    R532 - R436 even
    Patient Rooms
    R522 - R446 even
    Xavier Elevators
    Zone
    Patient Rooms
    R537 - 5757 odd
    Main Elevators
    Zone</Line1>
    </ROW>
    Extendscript will not give me an anything when I try to access elements by name. Instead I have to access by index, which works, but I'd rather search for names!
    Actually the console log returns: <![CDATA[]]>
    What am I doing wrong!?

    First, those E4X XML objects are definitely no JSON (plain data) - they have a multitude of methods, even for tasks that would easily be implemented as property (e.g. the length() function), and they also bind xml element and attribute names onto the objects, allowing to target a multitude of XML nodes with a single statement. Or did you mean your script with that "it"?
    Anyway, as you found out the ExtendScript XML object handles namespaces mostly by hiding them from you.
    You could play around with global namespace settings, see the JavaScript tools guide.
    You could also explicitly specify a namespace. This works for me:
    $.writeln(myXML["fm:Location"]);
    For simple use I had most success with a brute force approach that just strips the namespaces.
    function removeAllNamespace(xml)
              var ns =new Namespace();
              var d=xml.descendants();
              for (var i=0;i<d.length();i++)
        d[i].setNamespace(ns);

  • Binding XML to java types generated using Oracle Class Gen

    Hi,
    how can you bind an XML to the java types generated using the class gen provided byOracle.
    I am using oracle 9i production. as part of my design, i have to read an xml input in my java class and use the contents to create some records and send a response xml back.
    The latter part of i can do as the java types provide setter methods to set the data and conversion to xml.
    Jaxb can be using to bind xml to java datatypes but its not supported in Oracle9i.
    What are the alternatives for achieving the same?
    Thanks
    Ashwin

    Hi Ashwin,
    This is a bit outside my area of expertise, but I did run an older version of TopLink in the Oracle database java VM a few years back so I'll base my advice on that. Hopefully other forum members can correct me if I steer you wrong.
    First you will need to set up your XML environment:
    I believe the Oracle 9i database includes a JDK 1.3 VM. You will first need to determine if the VM includes any JAXP APIs. I believe there is an SQL query that allows you to query the classes available in the VM. First check if javax.xml.parsers.DocumentBuilderFactory is present.
    If the JAXP APIs are already present in the database you will need to do the following. First load the class javax.xml.namespace.QName into the database. You can extract this from xmlparserv2.jar or from Suns Java Web Service Developer Pack jax-qname.jar. Then you will need to load the JAXB APIs. You can load xml.jar or jaxb-api.jar from Sun's JWSDP.
    If the JAXP APIs are not present you will need to load the 10.1.3 version of the XDK jars (these are shipped with the 10.1.3 TopLink install). Load xmlparserv2.jar and xml.jar into the database.
    Second you will need to setup your TopLink environment:
    Load toplink.jar into the database. If the JAXP APIs were already present and you didn't load the 10.1.3 XDK jars into the database you will need to set the following System property.
    toplink.xml.platform=oracle.toplink.platform.xml.jaxp.JAXPPlatform-Blaise

Maybe you are looking for