flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harbs <harbs.li...@gmail.com>
Subject Re: XMLList - find specific attribute
Date Thu, 20 Nov 2014 06:58:10 GMT
You need to check for xml.@attr.length() to see if it exists.

On Nov 19, 2014, at 11:25 PM, mark goldin <markzolotoy@gmail.com> wrote:

> But I only want to check if both attr1 and attr1 exist. No value is known.
> 
> On Wed, Nov 19, 2014 at 3:15 PM, Alex Harui <aharui@adobe.com> wrote:
> 
>> I’m not sure your example was valid.  If you instead had:
>> 
>> Var xml:XML = <Project Name="Project1">
>>  <Subproject Name=“Subproject1" ID="2293" attr1="1.00" attr2="2.00"/>
>>  <Subproject Name=“Subproject2" ID="2294" attr1="1.00" attr2=“3.00"/>
>>  <Subproject Name=“Subproject3" ID="2295" attr1=“2.00" attr2="2.00"/>
>> </Project>
>> 
>> Then I think you would use
>>        xml.SubProject.(@attr1==“1.00” && @attr2==“2.00”).@ID
>> 
>> 
>> 
>> On 11/19/14, 11:19 AM, "mark goldin" <markzolotoy@gmail.com> wrote:
>> 
>>> Let's say I have the following code:
>>> <Project Name="Project1" ID="2293" attr1="1.00" attr2="2.00">
>>> <Subproject Name="Subproject1"/>
>>> <Subproject Name="Subproject2"/>
>>> <Subproject Name="Subproject3"/>
>>> </Project>
>>> 
>>> I'd lit to find ID="2293" based on a fact that the element has both attr1
>>> and attr2.
>>> 
>>> Thanks for help.
>> 
>> 


Mime
View raw message