Trying to assign an XML attribute value to a button label

I have a Flex app (developed in FLEX 2) that reads from
multiple XML files and populates datagrids with element values.
What I'm trying to do now, is to create a second column with a
button, enabling users to view archived versions for each current
report.
My problem is: I can't get the <mx:Button> label to
accept the attribute "name". I've tried atleast 10 - 20 different
syntax.
My XML file looks like this:
<metrics>
<report name="test">
<link>test Report 10/28/2008</link>
<url>test-10_28_2008.zip</url>
<status>active</status>
</report>
</metrics>
The mxml looks like this:
<mx:Button buttonMode="true" useHandCursor="true"
click="handleClick()" label="{data.@name}" width="80">
<mx:Script>
<![CDATA[
public function handleClick():void{
var url:URLRequest = new
URLRequest([L=http://new.test.com/pages/r_archive_apps/"+data.link+".html");[/L]]http://n ew.test.com/pages/r_archive_apps/"+data.link+".html");[/L][/L]
navigateToURL(url,"_blank");
]]>
</mx:Script>
</mx:Button>
When I try to label a button with an element it works fine.
Some of the other sytax I've used are:
- label="{data.report.@name}"
- label="{data.report.(@name=='test')}"
- label="{data.report.(@name='test')}"
- label="{data.@name}"
- label="{data.metrics.report.@name}"
- label="{data.metrics.report.(@name=='test')}"
- label="{data.metrics.report.(@name='test')}"

quote:
Originally posted by:
rtalton
Can you post some code so we can see how you are using the
button? I think you may be using the button within a datagrid
itemRenderer, which might make a difference.
You're right, the button is in a datagrid itemRenderer. I've
pasted more dataGrid code below - thanks again.
<mx:DataGrid id="dgCatalog" dataProvider="{_xlcCatalog}"
rowCount="4" editable="false" sortableColumns="false"
left="148" top="65" bottom="42" borderStyle="solid"
alternatingItemColors="[#ecf8ff, #ffffff]"
themeColor="#ffff80" alpha="1.0" cornerRadius="0"
dropShadowEnabled="true" dropShadowColor="#000000" width="549"
creationCompleteEffect="{glow3}">
<mx:columns>
<mx:Array>
<mx:DataGridColumn editable="false" headerText="Daily -
Report Names" dataField="link" textAlign="left" width="200">
<mx:itemRenderer>
<mx:Component>
<mx:LinkButton click="handleClick()" label="{data.link}"
>
<mx:Script>
<![CDATA[
public function handleClick():void{
var url:URLRequest = new URLRequest("
http://test.new.com/test/"+data.url);
navigateToURL(url,"_blank");
]]>
</mx:Script>
</mx:LinkButton>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn editable="false" headerText="Daily -
Report Archives" dataField="link" textAlign="left" width="80">
<mx:itemRenderer>
<mx:Component>
<mx:Button buttonMode="true" useHandCursor="true"
click="handleClick()" label="{data.report.@name}" width="80">
<mx:Script>
<![CDATA[
public function handleClick():void{
var url:URLRequest = new URLRequest("
http://test.new.com/pages/test_apps/"+data.link+".html");
navigateToURL(url,"_blank");
]]>
</mx:Script>
</mx:Button>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<!--mx:DataGridColumn headerText="URL" dataField="url"
width="350"/>
<mx:DataGridColumn headerText="Status" dataField="status"
width="70"/-->
</mx:Array>
</mx:columns>
</mx:DataGrid>

Similar Messages

  • How to remove the XML attribute value in Indesign file by javascript

    Hi all,
    How to remove the XML attribute value in Indesign file.

    Try this,
    if(elm.xmlElements[i].xmlAttributes[j].name == "aid:pstyle" || elm.xmlElements[i].xmlAttributes[j].name == "aid:cstyle")
    Vandy

  • Extract XML attribute value for multi-item sequence

    Guys,
    I have already posted this in the XML DB forum, but am relying that some of you might help me.
    I have been searching for a solution for this and couldn't quite get it. I'm trying to get attribute values from multiple entries in a Node. It workes for a single node, but for multiple nodes, it fails. Could you please give me a solution?
    SQL> select extractvalue(column_value, '/WORLD/COUNTRY/@NAME') COUNTRY_NAME
      2        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@NAME') CITY_NAME
      3        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@POPULATION') POPULATION
      4  from xmltable('WORLD' passing xmltype('
      5  <WORLD>
      6  <COUNTRY NAME="INDIA">
      7  <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
      8  </COUNTRY>
      9  </WORLD>'
    10  ));
    COUNTRY_NAME CITY_NAME POPULATION
    INDIA MUMBAI 10000When I execute the same for multiple nodes, it fails, please guide me. Please also let me know how to handle if I have an XML file containing this data.
    SQL> select extractvalue(column_value, '/WORLD/COUNTRY/@NAME') COUNTRY_NAME
      2        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@NAME') CITY_NAME
      3        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@POPULATION') POPULATION
      4  from xmltable('WORLD' passing xmltype('
      5  <WORLD>
      6  <COUNTRY NAME="INDIA">
      7  <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
      8  <CITY NAME="CHENNAI" POPULATION="2000"></CITY>
      9  <CITY NAME="BANGALORE" POPULATION="13000"></CITY>
    10  <CITY NAME="HYDERABAD" POPULATION="14000"></CITY>
    11  </COUNTRY>
    12  </WORLD>'
    13  ));
    select extractvalue(column_value, '/WORLD/COUNTRY/@NAME') COUNTRY_NAME
    ERROR at line 1:
    ORA-19025: EXTRACTVALUE returns value of only one nodeCheers
    Sarma.

    So, this is the first step:
    SQL> with test as
      2  (select xmltype('<WORLD>
      3                 <COUNTRY NAME="INDIA">
      4                 <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
      5                 <CITY NAME="CHENNAI" POPULATION="2000"></CITY>
      6                 <CITY NAME="BANGALORE" POPULATION="13000"></CITY>
      7                 <CITY NAME="HYDERABAD" POPULATION="14000"></CITY>
      8                 </COUNTRY>
      9  </WORLD>') resp from dual)
    10  select country
    11       , cities
    12  from xmltable('WORLD/COUNTRY' passing (select resp from test)
    13                         columns country varchar2(50) path '/COUNTRY/@NAME'
    14                               , cities xmltype path '/COUNTRY/CITY') world
    15  /
    COUNTRY         CITIES
    INDIA           <CITY NAME="MUMBAI" POPULATION="10000"/><CITY NAME
                    ="CHENNAI" POPULATION="2000"/><CITY NAME="BANGALOR
                    E" POPULATION="13000"/><CITY NAME="HYDERABAD" POPU
                    LATION="14000"/>two columns, one varchar2 and one xmltype.
    Then do the same thing with the second column, pass the XML to an XMLTABLE function
    SQL> with test as
      2  (select xmltype('<WORLD>
      3                 <COUNTRY NAME="INDIA">
      4                 <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
      5                 <CITY NAME="CHENNAI" POPULATION="2000"></CITY>
      6                 <CITY NAME="BANGALORE" POPULATION="13000"></CITY>
      7                 <CITY NAME="HYDERABAD" POPULATION="14000"></CITY>
      8                 </COUNTRY>
      9  </WORLD>') resp from dual)
    10  select country
    11       , cit.name
    12       , cit.population
    13  from xmltable('WORLD/COUNTRY' passing (select resp from test)
    14                         columns country varchar2(50) path '/COUNTRY/@NAME'
    15                               , cities xmltype path '/COUNTRY/CITY') world
    16     , xmltable ('CITY' passing cities
    17                columns name varchar2(50) path '@NAME'
    18                      , population number path '@POPULATION'
    19                ) cit
    20  ;
    COUNTRY         NAME                                               POPULATION
    INDIA           MUMBAI                                                  10000
    INDIA           CHENNAI                                                  2000
    INDIA           BANGALORE                                               13000
    INDIA           HYDERABAD                                               14000

  • Assign Master data Attribute value to PARENTH1

    Dear All,
    I have the requirement to load Employee master data from BI to BPC system using data manager package.
    Dimension Name (BPC)            InfoObject  Name(BI)
    Employee                                      0EMPLOYEE
    In Employee master data there is an Attribute, now need to assign this Attribute value to PARENTH1 in BPC.
    Waiting for your valuable answers

    Hi Edwin,
    After making the changes as u suggested, i tried to activate the transfer rule, but Iam getting the following eerror msg
    Error generating program
    Message no. RSAR245
    Diagnosis
    An error occurred in the program generation:
    Program / Template:   RSTMPL80
    Error code / Action: 6
    Row:        6,083
    Message:    Statement is not accessible.
    Procedure
    If the problem occurred during the data load or transport, activate the transfer rule.
    If the problem persists, search in the SAP note system under 'RSAR 245'.
    How can Iresolve this?/ Why is this happening??
    DV
    Any Help???
    null

  • Xml attribute value

    I'm having trouble getting a specific attribute value when
    parsing the xml tree. I need to get the chidNode that matches
    my attribute
    request. Is there an easy way to say if the attribute value =
    1234 then return
    its nodevalue
    myXML = new XML();
    myXML.load("sample.xml");
    myXML.ignoreWhite = true;
    myXML.onLoad=feeds;
    function feeds(){
    myroot = myXML.firstChild;
    people = myroot.firstChild;
    students = people.childNodes;
    if(students.attributes.id == '1234')
    trace('yes record found')
    the xml at the students level lookss like this
    <student id="2214">
    <name></name>
    </student>
    <student id="1234">
    <name></name>
    </student>
    <student id="4567">
    <name></name>
    </student>
    thanks

    Well, assuming there is an associated end tag (aka </TEST>) somewhere in your XML, then the XML fragment you show is well-formed XML.
    If by "XML functions", you mean something like XMLElement/XMLForest/XMLAgg, then you can be safe to know that it generates well-formed XML.
    What is this "xml editor" that you mention but don't name. It sounds as if the issue lies with that tool, based off what little you have provided.
    The more details you provide, the better answer you get.

  • InDesign CS3 crash during document open (at XML Attribute Value update for locked item)

    OS: Windows XP
    InDesign: InDesign Release 5.0.0.458   
    Plugins: No additional plugins
    I am facing crash in InDesign at following workflow
    Steps:
    1. Create a new document.
    2. Create a graphic frame.
    3. Place an Image (C:\TESTDIR\images\test-image.jpg)
    4. Tag the graphic frame (Right Click -> Autotag).
    5. Lock the layer.
    6. Save the doc at (C:\TESTDIR\files\test-doc.indd).
    7. Move the image file to (C:\TESTDIR\)
    8. Open the same document.
    9. InDesign Crash.
    Crash log:
    Adobe InDesign Protective Shutdown Log
    06/01/09 14:48:51
    Unhandled error condition
    Session started up at 2:44 PM on Monday, June 01, 2009
    Version: 5.0.0 - Build: 458
    Error Code 0xbfcd: "Cannot modify elements that contain locked content, or are contained by locked content. Please unlock or check out the content and try again."
    Command Sequence:
    > kOpenFileWithWindowCmdBoss = ""
    > kOpenFileCmdBoss = ""
      > kOpenDocCmdBoss = ""
       > kSetDocNameCmdBoss = ""
       > kSetDocNameCmdBoss = ""
    > kSetAllUsedStyleCmdBoss = ""
      > kSetAllUsedStyleCmdBoss = ""
    > kRestoreLinkCmdBoss = "Restore Link" : kBeforeDoMessageBoss @ kDocBoss (IID_ICOMMANDMGR)
    > kSetAssetAttributesCmdBoss = "" : kBeforeDoMessageBoss @ kDocBoss (IID_ICOMMANDMGR)
      > kSetAssetAttributesCmdBoss = "" : kAfterDoMessageBoss @ kDocBoss (IID_ICOMMANDMGR)
    > kXMLSetAttributeValueCmdBoss = "Set Attribute Value" : kBeforeDoMessageBoss @ kDocBoss (IID_ICOMMANDMGR)
      > kXMLSetAttributeValueCmdBoss = "Set Attribute Value" : kAfterDoMessageBoss @ kDocBoss (IID_ICOMMANDMGR)
    > kRestoreLinkCmdBoss = "Restore Link" : kAfterDoMessageBoss @ kDocBoss (IID_ICOMMANDMGR)
    Please let me know how to stop XML tag updation (execution of  kXMLSetAttributeValueCmdBoss) at document open.

    Is the first time one of these files crashes always on one system or another, or is it random across systems?
    It is random and it's not related to a file (one time i can open the file andanother time it cause an InDesign crash);
    It sounds very much like a font problem. Are you using a font manager, and if so, which one?
    We have reproduced the problem also on machine with only system's fonts.
    I forgot to say that the crashes happen only with InDesign files with InCopy files linked in.
    Thanks
    Alessandro

  • How to Get xml Attribute value from a given  xpath

    i'm building an xml from 3 columns a,b,c using 'SELECT EXTRACT (XMLELEMENT ("ROOT",.........)'
    and my xml looks something like this
    <ROOT>
    <categories>
    <catogory value="col a value" display="true"/>
    <catogory value="col b value" display="false"/>
    <catogory value="col c value" display="false"/>
    </categories>
    <DATAS>
    </DATA>
    </ROOT>
    now under the datas node i want to use xpath like this
    (case when '/root/categories/catogory/[@display="true"]' then '/root/categories/catogory/@value' else 0 end)
    so tat i get values under data node based on display attributes.... is it possible..
    if not is ther any alternative way of using xpath

    What version of Oracle (4 digits)?
    Are you trying to populate the Data node when you are building the XML originally via your SQL/XML statement or are you talking about modifying some existing XML to add more nodes to it based on data in the XML already?

  • Assign master data attribute value to Time Infoobject in Transfer Rule Rout

    Hi Experts,
    I want to assign value for Time Infoobject ZTIME from a Master data Infoobject's attr.  The value for this ZTIME exists as an attr of Infooject ZMMM. I want to do at Transfer Structure level so that the assigned value can be used for another calculation in the update rule..
    Any help on the routine is highly appreciated.
    Thanks,
    DV

    Hi Edwin,
    After making the changes as u suggested, i tried to activate the transfer rule, but Iam getting the following eerror msg
    Error generating program
    Message no. RSAR245
    Diagnosis
    An error occurred in the program generation:
    Program / Template:   RSTMPL80
    Error code / Action: 6
    Row:        6,083
    Message:    Statement is not accessible.
    Procedure
    If the problem occurred during the data load or transport, activate the transfer rule.
    If the problem persists, search in the SAP note system under 'RSAR 245'.
    How can Iresolve this?/ Why is this happening??
    DV
    Any Help???
    null

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

  • Setting the XML tag value in Java script

    Hi,
       I am trying to set a XML tag value in the initialize event of a text field.. The code works fine in FormCalc but I needed it to work in java script.
         FormCalc:
         $record.prospectApplication.typeName = "namedInsured";
         Java Script:
         xfa.record.prospectApplication.typeName = "namedInsured";
         The above JavaScript does not work. Can any one help on this?
    Thanks
    Srini

    Hi Srini,
    In JavaScript you don't get any default properties so you need to say;
    xfa.record.prospectApplication.typeName.value = "namedInsured";
    That is assign the value to the "value" property not the dataValue object.

  • Storing XML attribute

    I'm trying to store an XML attribute into a variable but the value of the variable is always null. I'm using the SAX parser and displaying the attribute is no problem.
    Here is the content of my xml file:
    <config>
      <param name="saTerminalId" value="63"/>
    <config>And here is the code snippet that I have:
    public class XMLReader extends DefaultHandler{
    public String termnumber;
       public void startElement(String namespaceURI,
                String sName, String qName, Attributes attrs) throws SAXException
             if (attrs.getQName(0) != null) {
                  if (attrs.getQName(0).equals("name") && attrs.getValue(0).equals("saTerminalId")) {
                       this.termnumber = attrs.getValue(1);
                       System.out.println("termn: " + this.termnumber);
    ...Whenever I try to use the termnumber variable, I get null. But if I use the variable inside the startElement, I get the correct value. Any ideas what the problem can be?

    Have you tried:
    this.termnumber = attrs.getValue("value");
    System.out.println("termn: " + this.termnumber);
    Also, your code is risky because there is no requirement that the sequence of items in the Attributes list is the same as the sequence of the way the attributes are coded. It may even vary from parser to parser.
    Dave Patterson

  • Xml Attributes with ADG

    Hi all,
    i'm new to flex.I have a problem regarding XML
    attributes."How to get the XML attribute value from the xml file to
    Flex application using HTTPService".I tried but it is coming only
    one attribute value.
    First i have to get the attribute values from the XML file
    and display in AdvancedDataGrid with tree structure.
    Here i will send my XML file and MXML file...
    Can u see and check my code............plzzz
    XML file................
    <?xml version="1.0" encoding="UTF-8"?>
    <todolist>
    <folder state="" label="Today todo list" isBranch="true"
    >
    <folder cat="Travel" state="High" duedate="3/09/2008"
    isBranch="false" label="book tickets" />
    <folder cat="Social" state="Low" duedate="4/09/2008"
    isBranch="false" label="Meeting at 7pm" />
    <folder state="" isBranch="true" label="Home " >
    <folder cat="Home" state="High" duedate="3/09/2008"
    isBranch="false" label="Pay power bill" />
    <folder cat="Home" state="High" duedate="3/09/2008"
    isBranch="false" label="Pay rent" />
    <folder cat="Home" state="Low" duedate="3/09/2008"
    isBranch="false" label="Call parents" />
    <folder cat="Home" state="Low" duedate="3/09/2008"
    isBranch="false" label="Attend John birthday party" />
    <folder cat="Home" state="Medium" duedate="3/09/2008"
    isBranch="false" label="Special Updates" />
    <folder cat="Home" state="high" isBranch="false"
    label="get Dr. appointment" />
    </folder>
    <folder state="" isBranch="true" label="Office " >
    <folder cat="Off" state="High" isBranch="false"
    label="Meeting at 5pm" />
    <folder cat="Off" state="Low" isBranch="false"
    label="Complete document and send to client" />
    <folder cat="Off" state="Low" isBranch="false"
    label="Interviews and Transcripts" />
    <folder cat="Off" state="High" isBranch="false"
    label="Set Deployment machine" />
    <folder cat="Off" state="High" isBranch="false"
    label="send status reports" />
    </folder>
    </folder>
    </todolist>
    MXML file............
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    initialize="adgService.send()">
    <mx:HTTPService id="adgService" url="adg.xml"/>
    <mx:AdvancedDataGrid
    dataProvider="{adgService.lastResult.todolist.folder}">
    <mx:columns>
    <mx:AdvancedDataGridColumn headerText="Name"
    dataField="label"/>
    <mx:AdvancedDataGridColumn headerText="Age"
    dataField="state"/>
    </mx:columns>
    </mx:AdvancedDataGrid>
    </mx:Application>
    Thnaks & Regards
    edeewan

    "edeewan" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hi all,
    > i'm new to flex.I have a problem regarding XML
    attributes."How to
    > get
    > the XML attribute value from the xml file to Flex
    application using
    > HTTPService".I tried but it is coming only one attribute
    value.
    >
    > First i have to get the attribute values from the XML
    file and display in
    > AdvancedDataGrid with tree structure.
    > Here i will send my XML file and MXML file...
    > Can u see and check my code............plzzz
    >
    > XML file................
    >
    > <?xml version="1.0" encoding="UTF-8"?>
    > <todolist>
    > <folder state="" label="Today todo list"
    isBranch="true" >
    >
    > <folder cat="Travel" state="High" duedate="3/09/2008"
    isBranch="false"
    > label="book tickets" />
    > <folder cat="Social" state="Low" duedate="4/09/2008"
    isBranch="false"
    > label="Meeting at 7pm" />
    >
    > <folder state="" isBranch="true" label="Home " >
    >
    > <folder cat="Home" state="High" duedate="3/09/2008"
    isBranch="false"
    > label="Pay power bill" />
    > <folder cat="Home" state="High" duedate="3/09/2008"
    isBranch="false"
    > label="Pay rent" />
    > <folder cat="Home" state="Low" duedate="3/09/2008"
    isBranch="false"
    > label="Call parents" />
    > <folder cat="Home" state="Low" duedate="3/09/2008"
    isBranch="false"
    > label="Attend John birthday party" />
    > <folder cat="Home" state="Medium" duedate="3/09/2008"
    > isBranch="false"
    > label="Special Updates" />
    > <folder cat="Home" state="high" isBranch="false"
    label="get Dr.
    > appointment" />
    >
    > </folder>
    >
    > <folder state="" isBranch="true" label="Office " >
    >
    > <folder cat="Off" state="High" isBranch="false"
    label="Meeting
    > at
    > 5pm" />
    > <folder cat="Off" state="Low" isBranch="false"
    label="Complete
    > document and send to client" />
    > <folder cat="Off" state="Low" isBranch="false"
    > label="Interviews
    > and Transcripts" />
    > <folder cat="Off" state="High" isBranch="false"
    label="Set
    > Deployment
    > machine" />
    > <folder cat="Off" state="High" isBranch="false"
    label="send status
    > reports" />
    >
    > </folder>
    >
    > </folder>
    > </todolist>
    >
    >
    > MXML file............
    >
    > <?xml version="1.0" encoding="utf-8"?>
    > <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    > layout="absolute"
    > initialize="adgService.send()">
    >
    > <mx:HTTPService id="adgService" url="adg.xml"/>
    > <mx:AdvancedDataGrid
    >
    dataProvider="{adgService.lastResult.todolist.folder}">
    > <mx:columns>
    > <mx:AdvancedDataGridColumn headerText="Name"
    dataField="label"/>
    > <mx:AdvancedDataGridColumn headerText="Age"
    dataField="state"/>
    > </mx:columns>
    > </mx:AdvancedDataGrid>
    >
    > </mx:Application>
    >
    > Thnaks & Regards
    > edeewan
    Try
    <mx:AdvancedDataGrid
    dataProvider="{adgService.lastResult.folder}">

  • XML attribute Undefined?!?

    Hey Flashers!!
    I need some help on the following:
    I am on AS2.0, CS4:
    i am trying to extract the following data from the XML attribute:
    <?xml version="1.0" encoding="utf-8"?>
    <mytext>
    < text ida="Hello world!" idb= "bye World!">
    </mytext>
    Here's my AS2.0 code, i tried to load the xml attributes into the two separate dinamic text fields:
    //load css
    var styles:TextField.StyleSheet = new TextField.StyleSheet();
    styles.setStyle("a:link",{textDecoration:'underline'});
    styles.setStyle("a:hover",{color:'#FF0000'});
    _parent.home_text.styleSheet = styles;
    //load in XML
    var meuXML:XML = new XML();
    meuXML.load("xml/content.php");
    meuXML.ignoreWhite = true;
    meuXML.onLoad = function() {
    _parent.home_text.htmlText = this.childNode[0].childNodes[0].attributes.ida;
    _parent.contacts_text.htmlText = this.childNodes[0],childNode[0].attributes.idb;
    I keep getting an Undefined error...
    Anyone??
    Thanks!!
    Cheers!

    Is this correct? i can't get it work anyway...
    <?xml version="1.0" encoding="utf-8"?>
    <mytext>
    <text ida="Hello world!" idb= "bye World!"></text>
    </mytext>
    AS2.0 code:
    //load css
    var styles:TextField.StyleSheet = new TextField.StyleSheet();
    styles.setStyle("a:link",{textDecoration:'underline'});
    styles.setStyle("a:hover",{color:'#FF0000'});
    _parent.home_text.styleSheet = styles;
    //load in XML
    var meuXML:XML = new XML();
    meuXML.load("xml/content.php");
    meuXML.ignoreWhite = true;
    meuXML.onLoad = function() {
    _parent.home_text.htmlText = this.childNodes[0].childNodes[0].attributes.ida;
    _parent.contacts_text.htmlText = this.childNodes[0],childNodes[0].attributes.idb;

  • Use jsp tag output as another tag's attribute value

    I don't know anyone has ever tried this, one tag's attribute value needs to be dynamically set using another tag's output. Something like
    <layout:grid cols="<layout:write name="element" property="value"/>'' space='false'>
    </layout:grid>
    I want the cols attribute of grid tag to be the output of <layout:write name="element" property="value"/>
    The way I wrote is of course not working.
    But I know PHP can do things similar to this, JSP should be able to achieve something like this too.
    If anyone knows how to do this or using any alternative way to do this, please let me know.
    Shane

    something like this...
              OuterTag qParent = null;
              try {
                        Tag myParent = getParent();
                        while (myParent != null ) {
                          // loop up through tags until you find the one you want
                             if (myParent instanceof OuterTag) {
                                  qParent = (OuterTag) myParent;
                                  data = qParent.getSomeData();
                             } else {
                                  myParent = myParent.getParent();
                   }

  • ASSIGN VALUE TO XML ATTRIBUTE DYNAMICALLY

    how can we create and asign value to an XML attribute dynamically?

    Hi Harshit,
    In this case you should use append xml instead of assign in the assignment action block.
    Assigfn values to local variables from sql query say "Local.Shift", "Local.Quantity" and "Local.Total" then append it to your output as:
    <root  Shift="#Local.Shift#" Qty="#Local.Quantity#" Total="#Local.Total#" />
    Append it to parent of <root /> element.
    Regards,
    Swaroop

Maybe you are looking for