[flexcoders] Re: Addressing buried children in XML with default namespace- an easier way?
Not sure what I was doing wrong here but I've got this worked out and documented here: http://www.returnundefined.com/dealing-with-default-namespaces-in-flex-2as3 Hopefully someone will find it useful. Ben --- In flexcoders@yahoogroups.com, "ben.clinkinbeard" <[EMAIL PROTECTED]> wrote: > > That doesn't seem to work for me. I have this file: > > package com.fmr.tests.PSA_Cairngorm.model > { > public namespace CLIENT_SEARCH_NAMESPACE = > "http://site.com/BackOffice/DoSearch";; > } > > and then in my command class, along with all my other import > statements I have: > import com.fmr.tests.PSA_Cairngorm.model.CLIENT_SEARCH_NAMESPACE; > > and then I try to use it like this: > use namespace CLIENT_SEARCH_NAMESPACE; > > Unfortunately I get the same error as usual: > 1004: Namespace was not found or is not a compile-time constant. > Yahoo! Groups Sponsor ~--> Yahoo! Groups gets a make over. See the new email design. http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/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/
[flexcoders] Re: Addressing buried children in XML with default namespace- an easier way?
Has anyone else gotten this to work? Ben --- In flexcoders@yahoogroups.com, "Brian Deitte" <[EMAIL PROTECTED]> wrote: > > You can reference a namespace object if you put this in a file: > > package mypackage { > public namespace DoSearch = > "http://site.com/BackOffice/DoSearch";; > } > > "import mypackage.DoSearch" in each class where you want to use it, and > then "use namespace DoSearch". > > -Brian > > > -Original Message- > > From: flexcoders@yahoogroups.com > > [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard > > Sent: Wednesday, July 12, 2006 9:47 AM > > To: flexcoders@yahoogroups.com > > Subject: [flexcoders] Re: Addressing buried children in XML > > with default namespace- an easier way? > > > > Bumping this up in the hopes that someone (possibly from Adobe?) can > > offer an alternative, or at least an explanation of why this is the > > case. As it stands now, I will have to have these lines: > > > > namespace foo = "http://site.com/BackOffice/DoSearch";; > > use namespace foo; > > > > sprinkled throughout my app, which sucks. Why can't use namespace > > point to an actual Namepsace object? I feel like this is a glaring > > hole in Flex's XML capabilities. > > > > Thanks, > > Ben > > > > > It seems that the only way to use the full functionality of E4X with > > > namespaced XML is by using this method: > > > > > > namespace foo = "http://site.com/BackOffice/DoSearch";; > > > use namespace foo; > > > > > > Unfortunately, that method must be constructed exactly like > > that- with > > > a static string. You cannot even point it to a constant like > > > MyAppClass.SEARCH_NAMESPACE, which is fairly disappointing. > > I suppose > > > the namespaces your app uses aren't something that will change very > > > often but it still seems like this is a shortcoming of the > > > implementation of E4X. I feel like I am being punished for using XML > > > that contains namespaces, as it is so crippled in comparison to > > > namespace-free XML. > > > > > > Adobe, can you fix this in a future release? > > > > > > Thanks, > > > Ben > > > > > > > > > > > > > > > > > > > Yahoo! Groups Sponsor > > ~--> > > Yahoo! Groups gets a make over. See the new email design. > > http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/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 > > > > > > > > > > > > > > > > > -- 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/
[flexcoders] Re: Addressing buried children in XML with default namespace- an easier way?
That doesn't seem to work for me. I have this file: package com.fmr.tests.PSA_Cairngorm.model { public namespace CLIENT_SEARCH_NAMESPACE = "http://site.com/BackOffice/DoSearch";; } and then in my command class, along with all my other import statements I have: import com.fmr.tests.PSA_Cairngorm.model.CLIENT_SEARCH_NAMESPACE; and then I try to use it like this: use namespace CLIENT_SEARCH_NAMESPACE; Unfortunately I get the same error as usual: 1004: Namespace was not found or is not a compile-time constant. Yahoo! Groups Sponsor ~--> See what's inside the new Yahoo! Groups email. http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/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/
RE: [flexcoders] Re: Addressing buried children in XML with default namespace- an easier way?
You can reference a namespace object if you put this in a file: package mypackage { public namespace DoSearch = "http://site.com/BackOffice/DoSearch";; } "import mypackage.DoSearch" in each class where you want to use it, and then "use namespace DoSearch". -Brian > -Original Message- > From: flexcoders@yahoogroups.com > [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard > Sent: Wednesday, July 12, 2006 9:47 AM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Re: Addressing buried children in XML > with default namespace- an easier way? > > Bumping this up in the hopes that someone (possibly from Adobe?) can > offer an alternative, or at least an explanation of why this is the > case. As it stands now, I will have to have these lines: > > namespace foo = "http://site.com/BackOffice/DoSearch";; > use namespace foo; > > sprinkled throughout my app, which sucks. Why can't use namespace > point to an actual Namepsace object? I feel like this is a glaring > hole in Flex's XML capabilities. > > Thanks, > Ben > > > It seems that the only way to use the full functionality of E4X with > > namespaced XML is by using this method: > > > > namespace foo = "http://site.com/BackOffice/DoSearch";; > > use namespace foo; > > > > Unfortunately, that method must be constructed exactly like > that- with > > a static string. You cannot even point it to a constant like > > MyAppClass.SEARCH_NAMESPACE, which is fairly disappointing. > I suppose > > the namespaces your app uses aren't something that will change very > > often but it still seems like this is a shortcoming of the > > implementation of E4X. I feel like I am being punished for using XML > > that contains namespaces, as it is so crippled in comparison to > > namespace-free XML. > > > > Adobe, can you fix this in a future release? > > > > Thanks, > > Ben > > > > > > > > > > Yahoo! Groups Sponsor > ~--> > Yahoo! Groups gets a make over. See the new email design. > http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/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 > > > > > > > > -- 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/
[flexcoders] Re: Addressing buried children in XML with default namespace- an easier way?
Bumping this up in the hopes that someone (possibly from Adobe?) can offer an alternative, or at least an explanation of why this is the case. As it stands now, I will have to have these lines: namespace foo = "http://site.com/BackOffice/DoSearch";; use namespace foo; sprinkled throughout my app, which sucks. Why can't use namespace point to an actual Namepsace object? I feel like this is a glaring hole in Flex's XML capabilities. Thanks, Ben > It seems that the only way to use the full functionality of E4X with > namespaced XML is by using this method: > > namespace foo = "http://site.com/BackOffice/DoSearch";; > use namespace foo; > > Unfortunately, that method must be constructed exactly like that- with > a static string. You cannot even point it to a constant like > MyAppClass.SEARCH_NAMESPACE, which is fairly disappointing. I suppose > the namespaces your app uses aren't something that will change very > often but it still seems like this is a shortcoming of the > implementation of E4X. I feel like I am being punished for using XML > that contains namespaces, as it is so crippled in comparison to > namespace-free XML. > > Adobe, can you fix this in a future release? > > Thanks, > Ben > Yahoo! Groups Sponsor ~--> Yahoo! Groups gets a make over. See the new email design. http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/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/
[flexcoders] Re: Addressing buried children in XML with default namespace- an easier way?
It seems that the only way to use the full functionality of E4X with namespaced XML is by using this method: namespace foo = "http://site.com/BackOffice/DoSearch";; use namespace foo; Unfortunately, that method must be constructed exactly like that- with a static string. You cannot even point it to a constant like MyAppClass.SEARCH_NAMESPACE, which is fairly disappointing. I suppose the namespaces your app uses aren't something that will change very often but it still seems like this is a shortcoming of the implementation of E4X. I feel like I am being punished for using XML that contains namespaces, as it is so crippled in comparison to namespace-free XML. Adobe, can you fix this in a future release? Thanks, Ben Yahoo! Groups Sponsor ~--> See what's inside the new Yahoo! Groups email. http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/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/
[flexcoders] Re: Addressing buried children in XML with default namespace- an easier way?
Sorry, I guess I wasn't clear in what I was looking for- I am trying to figure out how to address deeply buried nodes without having to go one level at a time. Something like the .. operator, but that is compatible with namespaced XML (.. doesn't seem to be). The Web Services I am calling return data that has nodes sometimes 15 levels deep that I need to access and going one step at a time would be quite tedious. There's got to be a better way... hopefully. -- 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/
[flexcoders] Re: Addressing buried children in XML with default namespace- an easier way?
Here's a couple: // namespace constant public namespace default_ns = "http://fmr.com/BackOffice/PseSearch";; // init test public function init () : void { var xml : XML = http://fmr.com/BackOffice/PseSearch";> false 9 Cool Client GARY BUSEY CORE 5 SAVINGS PLAN ; // use namespace prefix var ns : Namespace = xml.namespace (); trace (xml.ns::SearchPlan.ns::Plans); // use namespace constant use namespace default_ns; trace (xml.SearchPlan.Plans); } --- In flexcoders@yahoogroups.com, "ben.clinkinbeard" <[EMAIL PROTECTED]> wrote: > > The struggle against XML with a default namespace continues... > Currently, the only way I am able to get to the first Plans node is by > using QName objects to traverse one level at a time, like this: > > var ns:Namespace = new Namespace("myDefaultNamespaceString"); > var q:QName = new QName(ns.uri, "SearchPlan"); > var q2:QName = new QName(ns.uri, "Plans"); > searchResults = XML(list).child(q).child(q2); > > This is not ideal and would obviously not be practical for deeply > buried nodes. There's got to be a better way but I can't seem to find > it. Can anyone help? > > Thanks, > Ben > Yahoo! Groups Sponsor ~--> Great things are happening at Yahoo! Groups. See the new email design. http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/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/