Hi claus , abdul
Thanks for your advice! It works well. I could parse rdf,rss.
Thanks,
Satoshi
Abdul Qabiz wrote:
> Hi,
>
> Use "default xml namespace" directive to solve this problem. Sorry, it
> is not documented in current livedocs for Flex 2 alpha…We are working
> many things, so hopefully you would see it updated soon...
>
> *Solution:*
>
> var nsDefault:Namespace = new Namespace("http://example.com/");
>
> var res:XML = <items xmlns="http://example.com/">
> <item>apple</item><item>orange</item>
> </items>;
>
> default xml namespace = nsDefault; //or default xml namespace =
> "_http://example.com/_";
>
> trace(res.item[0]);
>
>
> *Another way of adding namespace to all XML objects*
>
> var nsDefault:Namespace = new Namespace("http://example.com/");
> default xml namespace = nsDefault;
> var res:XML = <items><item>apple</item><item>orange</item></items>;
>
> trace(res.namespace()); //traces -> _http://example.com/_
>
> trace(res.item[0]);
>
>
> *Note: You know undocumented are subject to change. But I wanted to let
> you know that there is something which solves this issue.*
>
> *What "default xml namespace" does?*
>
> The default xml namespace directive sets the default namespace to use
> for XML objects.
>
> Without setting default xml namespace, the default namespace is the
> unnamed namespace (with the URI set to an empty string). The scope of a
> default xml namespace declaration is within a function block, like the
> scope of a variable:.
>
>
> Hope that helps.
>
>
>
> -abdul
>
>
>
>
>
>
> -----Original Message-----
> From: [email protected] [_mailto:[EMAIL PROTECTED]
> On Behalf Of Yokota Satoshi
> Sent: Saturday, December 03, 2005 2:51 PM
> To: [email protected]
> Subject: [flexcoders] Parsing XML with namespaces in E4X (Flex2)
>
> Hi,
>
> Is there a way in which I could parse XML with namespaces in E4X?
>
> following code, I can see the value without namespace.
>
> var res:XML = <items><item>apple</item><item>orange</item></items>;
> trace(res.item[0]);
>
> but, following code, I could'nt.
>
> var res:XML = <items xmlns="http://example.com/">
> <item>apple</item><item>orange</item>
> </items>;
> trace(res.item[0]);
>
>
> Thanks,
> Yokota Satoshi
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: _http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt_
> Search Archives: _http://www.mail-archive.com/flexcoders%40yahoogroups.com_
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
>
>
>
> SPONSORED LINKS
> Web site design development
> <http://groups.yahoo.com/gads?t=ms&k=Web+site+design+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=L-4QTvxB_quFDtMyhrQaHQ>
>
> Computer software development
> <http://groups.yahoo.com/gads?t=ms&k=Computer+software+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=lvQjSRfQDfWudJSe1lLjHw>
>
> Software design and development
> <http://groups.yahoo.com/gads?t=ms&k=Software+design+and+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=1pMBCdo3DsJbuU9AEmO1oQ>
>
>
> Macromedia flex
> <http://groups.yahoo.com/gads?t=ms&k=Macromedia+flex&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=OO6nPIrz7_EpZI36cYzBjw>
>
> Software development best practice
> <http://groups.yahoo.com/gads?t=ms&k=Software+development+best+practice&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=f89quyyulIDsnABLD6IXIw>
>
>
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
> * Visit your group "flexcoders
> <http://groups.yahoo.com/group/flexcoders>" on the web.
>
> * To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/