Re: [Flashcoders] Getting attributes out of a node with : in it
Thanks all - I had it correct, but the Yahoo! specs in regards to sample XML fed back was wrong... and thus my namespace URI was wrong - so I never got anything. Thanks for your help - working great now. On Mon, Feb 9, 2009 at 4:19 PM, Merrill, Jason < jason.merr...@bankofamerica.com> wrote: > This should work: > > private function loadedXML( e:Event ):void { >var myXML:XML = new XML( e.target.data ); > var ywNS:Namespace = myXml.namespace("yweather"); >trace( myXML.channel.item.ywNS::conditi...@temp ); > } > > > Jason Merrill > > Bank of America > Learning Performance Solutions Instructional Technology & Media > > Learn about the Adobe Flash platform for rich media experiences - join the > Bank of America Flash Platform Community > > > > > > > -Original Message- > From: flashcoders-boun...@chattyfig.figleaf.com [mailto: > flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Eric E. Dolecki > Sent: Monday, February 09, 2009 4:10 PM > To: Flash Coders List > Subject: Re: [Flashcoders] Getting attributes out of a node with : in it > > Ok, so in my XML loaded function I have this: > private function loadedXML( e:Event ):void > { > > var myXML:XML = new XML( e.target.data ); > var yweather:Namespace = new Namespace( " > http://weather.yahooapis.com/ns/rss/1.0"; ); > trace( myXML.channel.item.yweather::conditi...@temp ); > > } > > I get nothing. I'm pretty sure my scope is correct. As long as the > namespace > var name matches the tag I'm after, I should be able to get to it, correct? > > > On Mon, Feb 9, 2009 at 3:27 PM, Taka Kojima wrote: > > > I just realized that the link I sent doesn't mention the namespace > > operator, which is the main thing you need... > > > > The following example uses the :: operator to identify XML properties > > with specified namespaces: > > > > var soap:Namespace = new Namespace(" > http://schemas.xmlsoap.org/wsdl/soap/ > > "); > > var w:Namespace = new Namespace("http://weather.example.org/forecast";); > > var myXML:XML = > >http://schemas.xmlsoap.org/wsdl/soap/";> > > > > http://weather.example.org/forecast";> > > Quito > > Ecuador > > 2006-01-14 > > > > > >; > > > > trace(myXML.soap::Body.w::forecast.w::city); // Quito > > > > > > so in your case, try doing... > > > > trace(myXML.yweather::conditi...@text); > > > > should work. > > > > - Taka > > > > On Mon, Feb 9, 2009 at 12:20 PM, Taka Kojima wrote: > > > I take it this is from an rss feed? > > > > > > Look into the Namespace class... > > > > > > > http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Namespace.html > > > > > > Unfortunately, you didn't paste the entire XML doc so I can't guide you > > > further. > > > > > > - Taka > > > > > > On Mon, Feb 9, 2009 at 10:36 AM, Eric E. Dolecki > > wrote: > > >> > > >> For example I have a node like so: > > >> > > >> date="Mon, > > 09 > > >> Feb 2009 12:56 pm EST"/> > > >> > > >> > > >> How can I get into that node to pull attributes out? The ":" in the > node > > >> name is screwing my up at the moment. > > >> > > >> Eric > > >> ___ > > >> Flashcoders mailing list > > >> Flashcoders@chattyfig.figleaf.com > > >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > > > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > > -- > http://ericd.net > Interactive design and development > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- http://ericd.net Interactive design and development ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Getting attributes out of a node with : in it
This should work: private function loadedXML( e:Event ):void { var myXML:XML = new XML( e.target.data ); var ywNS:Namespace = myXml.namespace("yweather"); trace( myXML.channel.item.ywNS::conditi...@temp ); } Jason Merrill Bank of America Learning Performance Solutions Instructional Technology & Media Learn about the Adobe Flash platform for rich media experiences - join the Bank of America Flash Platform Community -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Eric E. Dolecki Sent: Monday, February 09, 2009 4:10 PM To: Flash Coders List Subject: Re: [Flashcoders] Getting attributes out of a node with : in it Ok, so in my XML loaded function I have this: private function loadedXML( e:Event ):void { var myXML:XML = new XML( e.target.data ); var yweather:Namespace = new Namespace( " http://weather.yahooapis.com/ns/rss/1.0"; ); trace( myXML.channel.item.yweather::conditi...@temp ); } I get nothing. I'm pretty sure my scope is correct. As long as the namespace var name matches the tag I'm after, I should be able to get to it, correct? On Mon, Feb 9, 2009 at 3:27 PM, Taka Kojima wrote: > I just realized that the link I sent doesn't mention the namespace > operator, which is the main thing you need... > > The following example uses the :: operator to identify XML properties > with specified namespaces: > > var soap:Namespace = new Namespace("http://schemas.xmlsoap.org/wsdl/soap/ > "); > var w:Namespace = new Namespace("http://weather.example.org/forecast";); > var myXML:XML = >http://schemas.xmlsoap.org/wsdl/soap/";> > > http://weather.example.org/forecast";> > Quito > Ecuador > 2006-01-14 > > >; > > trace(myXML.soap::Body.w::forecast.w::city); // Quito > > > so in your case, try doing... > > trace(myXML.yweather::conditi...@text); > > should work. > > - Taka > > On Mon, Feb 9, 2009 at 12:20 PM, Taka Kojima wrote: > > I take it this is from an rss feed? > > > > Look into the Namespace class... > > > > http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Namespace.html > > > > Unfortunately, you didn't paste the entire XML doc so I can't guide you > > further. > > > > - Taka > > > > On Mon, Feb 9, 2009 at 10:36 AM, Eric E. Dolecki > wrote: > >> > >> For example I have a node like so: > >> > >> > >> > >> > >> How can I get into that node to pull attributes out? The ":" in the node > >> name is screwing my up at the moment. > >> > >> Eric > >> ___ > >> Flashcoders mailing list > >> Flashcoders@chattyfig.figleaf.com > >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- http://ericd.net Interactive design and development ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Getting attributes out of a node with : in it
Ok, so in my XML loaded function I have this: private function loadedXML( e:Event ):void { var myXML:XML = new XML( e.target.data ); var yweather:Namespace = new Namespace( " http://weather.yahooapis.com/ns/rss/1.0"; ); trace( myXML.channel.item.yweather::conditi...@temp ); } I get nothing. I'm pretty sure my scope is correct. As long as the namespace var name matches the tag I'm after, I should be able to get to it, correct? On Mon, Feb 9, 2009 at 3:27 PM, Taka Kojima wrote: > I just realized that the link I sent doesn't mention the namespace > operator, which is the main thing you need... > > The following example uses the :: operator to identify XML properties > with specified namespaces: > > var soap:Namespace = new Namespace("http://schemas.xmlsoap.org/wsdl/soap/ > "); > var w:Namespace = new Namespace("http://weather.example.org/forecast";); > var myXML:XML = >http://schemas.xmlsoap.org/wsdl/soap/";> > > http://weather.example.org/forecast";> > Quito > Ecuador > 2006-01-14 > > >; > > trace(myXML.soap::Body.w::forecast.w::city); // Quito > > > so in your case, try doing... > > trace(myXML.yweather::conditi...@text); > > should work. > > - Taka > > On Mon, Feb 9, 2009 at 12:20 PM, Taka Kojima wrote: > > I take it this is from an rss feed? > > > > Look into the Namespace class... > > > > http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Namespace.html > > > > Unfortunately, you didn't paste the entire XML doc so I can't guide you > > further. > > > > - Taka > > > > On Mon, Feb 9, 2009 at 10:36 AM, Eric E. Dolecki > wrote: > >> > >> For example I have a node like so: > >> > >> > >> > >> > >> How can I get into that node to pull attributes out? The ":" in the node > >> name is screwing my up at the moment. > >> > >> Eric > >> ___ > >> Flashcoders mailing list > >> Flashcoders@chattyfig.figleaf.com > >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- http://ericd.net Interactive design and development ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Getting attributes out of a node with : in it
Use the namespace feature. Something (if not exactly) like this: var ywNS:Namespace = xml.namespace("yweather"); trace(myXml.ywNS::conditi...@text); trace(myXml.ywNS::conditi...@code); trace(myXml.ywNS::conditi...@temp); Jason Merrill Bank of America Learning Performance Solutions Instructional Technology & Media Learn about the Adobe Flash platform for rich media experiences - join the Bank of America Flash Platform Community -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Robert Leisle Sent: Monday, February 09, 2009 3:17 PM To: 'Flash Coders List' Subject: RE: [Flashcoders] Getting attributes out of a node with : in it Check out the Namespace class, as it applies to XML, in the Flash docs. There's also a good explanation in this tutorial by Lee Brimelow: http://gotoandlearn.com/play?id=65 hth, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Eric E. Dolecki Sent: Monday, February 09, 2009 10:37 AM To: Flash Coders List Subject: [Flashcoders] Getting attributes out of a node with : in it For example I have a node like so: How can I get into that node to pull attributes out? The ":" in the node name is screwing my up at the moment. Eric ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Getting attributes out of a node with : in it
I just realized that the link I sent doesn't mention the namespace operator, which is the main thing you need... The following example uses the :: operator to identify XML properties with specified namespaces: var soap:Namespace = new Namespace("http://schemas.xmlsoap.org/wsdl/soap/";); var w:Namespace = new Namespace("http://weather.example.org/forecast";); var myXML:XML = http://schemas.xmlsoap.org/wsdl/soap/";> http://weather.example.org/forecast";> Quito Ecuador 2006-01-14 ; trace(myXML.soap::Body.w::forecast.w::city); // Quito so in your case, try doing... trace(myXML.yweather::conditi...@text); should work. - Taka On Mon, Feb 9, 2009 at 12:20 PM, Taka Kojima wrote: > I take it this is from an rss feed? > > Look into the Namespace class... > > http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Namespace.html > > Unfortunately, you didn't paste the entire XML doc so I can't guide you > further. > > - Taka > > On Mon, Feb 9, 2009 at 10:36 AM, Eric E. Dolecki wrote: >> >> For example I have a node like so: >> >> >> >> >> How can I get into that node to pull attributes out? The ":" in the node >> name is screwing my up at the moment. >> >> Eric >> ___ >> Flashcoders mailing list >> Flashcoders@chattyfig.figleaf.com >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Getting attributes out of a node with : in it
when you refer to the node write it like this: yweather::condition with double colons HTH/Christoffer Robert Leisle skrev: Check out the Namespace class, as it applies to XML, in the Flash docs. There's also a good explanation in this tutorial by Lee Brimelow: http://gotoandlearn.com/play?id=65 hth, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Eric E. Dolecki Sent: Monday, February 09, 2009 10:37 AM To: Flash Coders List Subject: [Flashcoders] Getting attributes out of a node with : in it For example I have a node like so: How can I get into that node to pull attributes out? The ":" in the node name is screwing my up at the moment. Eric ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Getting attributes out of a node with : in it
Check out the Namespace class, as it applies to XML, in the Flash docs. There's also a good explanation in this tutorial by Lee Brimelow: http://gotoandlearn.com/play?id=65 hth, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Eric E. Dolecki Sent: Monday, February 09, 2009 10:37 AM To: Flash Coders List Subject: [Flashcoders] Getting attributes out of a node with : in it For example I have a node like so: How can I get into that node to pull attributes out? The ":" in the node name is screwing my up at the moment. Eric ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Getting attributes out of a node with : in it
I take it this is from an rss feed? Look into the Namespace class... http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Namespace.html Unfortunately, you didn't paste the entire XML doc so I can't guide you further. - Taka On Mon, Feb 9, 2009 at 10:36 AM, Eric E. Dolecki wrote: > For example I have a node like so: > > > > > How can I get into that node to pull attributes out? The ":" in the node > name is screwing my up at the moment. > > Eric > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Getting attributes out of a node with : in it
Cheers - thanks ;) On Mon, Feb 9, 2009 at 3:17 PM, Robert Leisle wrote: > Check out the Namespace class, as it applies to XML, in the Flash docs. > There's also a good explanation in this tutorial by Lee Brimelow: > http://gotoandlearn.com/play?id=65 > > hth, > Bob > > -Original Message- > From: flashcoders-boun...@chattyfig.figleaf.com [mailto: > flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Eric E. Dolecki > Sent: Monday, February 09, 2009 10:37 AM > To: Flash Coders List > Subject: [Flashcoders] Getting attributes out of a node with : in it > > For example I have a node like so: > > > > > How can I get into that node to pull attributes out? The ":" in the node > name is screwing my up at the moment. > > Eric > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- http://ericd.net Interactive design and development ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Getting attributes out of a node with : in it
For example I have a node like so: How can I get into that node to pull attributes out? The ":" in the node name is screwing my up at the moment. Eric ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders