Did you try "text()"?  All e4x expressions return an XMLList, but often the 
default toString() will return the text you want.  However, not always, and I 
have gotten in the habit of always using text() when I want the text node.

 

In this case, children(), works because you only have a text node child.  I 
would advise text() because it is more readable then children().

 

While we are here, text() returns an XMLList too.  If you want to set the text 
node you would need to use ...text()[0] = "my text";

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of David 
Pariente
Sent: Friday, August 29, 2008 10:15 AM
To: [email protected]
Subject: Re: [flexcoders] Re: cannot get ONLY the value of an XML element...

 

got it!
when i said about it looks like getting the parent...i noticed and just put a 
.children() at the end, now it works!
:)

 

----- Mensaje original ----
De: Josh McDonald <[EMAIL PROTECTED]>
Para: [email protected]
Enviado: viernes, 29 de agosto, 2008 5:33:19
Asunto: Re: [flexcoders] Re: cannot get ONLY the value of an XML element...

Hmmm, you could be right... 

rIngredients. currentItem. ingredient might be returning an XMLList instead of 
an XML, which is why you're getting that. Try replacing 

text="{rIngredients. currentItem. ingredient. quantity}"

with:

text="{rIngredients. currentItem. ingredient. quantity[ 0]}"

Instead? If it works, then that's the problem. You might get a compiler warning 
though. Dunno :)

On Fri, Aug 29, 2008 at 1:11 PM, David Pariente <xxmapachexx@ yahoo.es 
<mailto:[EMAIL PROTECTED]> > wrote:

i guess it has something to be with the repeater or it's dataprovider. ..
....i use that xml to show other info without a problem

i don't know whats wrong about it :(


Josh McDonald escribió:

> you want .text
>
> What you're getting there is the toString() for the quantity node.
>
> On Fri, Aug 29, 2008 at 10:58 AM, David Pariente <xxmapachexx@ yahoo.es 
> <mailto:[EMAIL PROTECTED]> 

> <mailto:xxmapachexx@ yahoo.es <mailto:[EMAIL PROTECTED]> >> wrote:
>
>     hi,
>
>     that's the first i tried...but got same result...:(
>
>     thnx for answer
>
>     Tim Hoff escribió:
>     >
>     > Hi David,
>     >
>     > text="{rIngredients. currentItem. ingredient. quantity. *valueOf( )}"*
>     >
>     > -TH
>     >
>     > --- In [EMAIL PROTECTED] ups.com <mailto:[email protected]> 

>     <mailto:[EMAIL PROTECTED] ups.com <mailto:[email protected]> >, 
> David Pariente

>     <xxmapachexx@ ...> wrote:
>     > >
>     > > hi, here i am again with a newbie problem...
>     > >
>     > > I made a repeater to show me text lines from an XML, but for some
>     > reason
>     > > it doesnt show me the value ONLY.
>     > >
>     > > <mx:Repeater id="rIngredients" dataProvider="{rXML.ingredients}">
>     > > <mx:Text x="0" y="10"
>     > > text="{rIngredients. currentItem. ingredient. quantity}" width="518"
>     > > fontFamily="petitam" fontSize="12" enabled="true"
>     color="#000000"/>
>     > >
>     > > </mx:Repeater>
>     > >
>     > > it works, but shows: "<quantity>1 pc.</quantity>", in stead on
>     just
>     > "1pc."
>     > >
>     > > Also...i wanna join 2 XML values inside that text line, like this:
>     > >
>     > > {rIngredients. currentItem. ingredient. quantity} -
>     > > {rIngredients. currentItem. ingredient. ingname}
>     > >
>     > > so i get: "tomatoes - 2".
>     > >
>     > > Now if i do like that i get first a list of all
>     quantities.. .then a
>     > list
>     > > of all ingredients after that :(
>     > >
>     > > Any idea of how to solve the 2 things?
>     > > thnx a lot for ur help
>     > >
>     >
>     >
>
>
>
>     ------------ --------- --------- ------
>
>     --
>     Flexcoders Mailing List
>     FAQ:
>     http://groups. yahoo.com/ group/flexcoders /files/flexcoder sFAQ.txt 
> <http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt> 
>     <http://groups. yahoo.com/ group/flexcoders /files/flexcoder sFAQ.txt 
> <http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt> >
>     Search Archives:
>     http://www.mail- archive.com/ flexcoders% 40yahoogroups. comYahoo 
> <http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo> 
>     <http://www.mail- archive.com/ flexcoders% 40yahoogroups. comYahoo 
> <http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo> >!
>     Groups Links
>
>

>        (Yahoo! ID required)

>
>        mailto:flexcoders-fullfeat [EMAIL PROTECTED] .com <mailto:[EMAIL 
> PROTECTED]> 
>     <mailto:flexcoders-fullfeat [EMAIL PROTECTED] .com <mailto:[EMAIL 
> PROTECTED]> >
>
>
>
>
>
>

> --
> "Therefore, send not to know For whom the bell tolls. It tolls for thee."
>
> :: Josh 'G-Funk' McDonald

> :: 0437 221 380 :: [EMAIL PROTECTED] com <mailto:[EMAIL PROTECTED]>  
> <mailto:[EMAIL PROTECTED] com <mailto:[EMAIL PROTECTED]> >

>



------------ --------- --------- ------

--
Flexcoders Mailing List
FAQ: http://groups. yahoo.com/ group/flexcoders /files/flexcoder sFAQ.txt 
<http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt> 
Search Archives: http://www.mail- archive.com/ flexcoders% 40yahoogroups. 
comYahoo <http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo> ! 
Groups Links






-- 
"Therefore, send not to know For whom the bell tolls. It tolls for thee."

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED] com <mailto:[EMAIL PROTECTED]> 


__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.yahoo.es 

 

Reply via email to