Don't get me started on default namespaces in Flex/AS3... :) --- In flexcoders@yahoogroups.com, "Tom Lee" <[EMAIL PROTECTED]> wrote: > > Awesome! That's got it! Thanks so much. Seems odd that we have to > manually declare these namespaces just to parse a little XML, doesn't it? > > -----Original Message----- > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of ben.clinkinbeard > Sent: Wednesday, August 16, 2006 2:31 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Re: XML parser chokes on un-typed xmlns > > Hi Tom, > > Sorry, I've not used the descendants method before and I just assumed > the approach I use would work. If you use .. instead it will work as > expected. > > namespace temp = "http://tempuri.org/"; > use namespace temp; > trace("Node B from myXML2: " + myXML2..b); > > HTH, > Ben > > > --- In flexcoders@yahoogroups.com, "Tom Lee" <design@> wrote: > > > > Thanks, Ben - I've seen this before (I believe you directed me to > this page > > on a previous issue). However, I don't understand how it applies to my > > particular problem - how would you fix my example using the namespace > > directive? > > > > -----Original Message----- > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > > Behalf Of ben.clinkinbeard > > Sent: Wednesday, August 16, 2006 12:46 PM > > To: flexcoders@yahoogroups.com > > Subject: [flexcoders] Re: XML parser chokes on un-typed xmlns > > > > > http://www.returnundefined.com/2006/07/dealing-with-default-namespaces-in-fl > > ex-2as3/ > > > > Ben > > http://www.returnundefined.com/ > > > > --- In flexcoders@yahoogroups.com, "Tom Lee" <design@> wrote: > > > > > > Hi everyone, > > > > > > > > > > > > I am having some difficulty parsing .Net web service results. The > > problem > > > lies in the fact that Flex's XML parser doesn't like un-typed xmlns > > > declarations of the type found by default in .Net web services. > Try the > > > following: > > > > > > > > > > > > > > > > > > <?xml version="1.0" encoding="utf-8"?> > > > > > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > > layout="absolute" > > > creationComplete="doIt()"> > > > > > > <mx:Script> > > > > > > <![CDATA[ > > > > > > function doIt(){ > > > > > > var myXML:XML = > > > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > > > > > > > > > <soap:Body> > > > > > > > > > <a xmlns:soap="http://tempuri.org/ "> > > > > > > > > > <b>Hi</b> > > > > > > > > > </a> > > > > > > > > > </soap:Body> > > > > > > > > > </soap:Envelope> > > > > > > trace("Node B from > > myXML: > > > "+myXML.descendants("b")); > > > > > > > > > > > > var myXML2:XML = > > > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > > > > > > > > > <soap:Body> > > > > > > > > > <a xmlns="http://tempuri.org/ "> > > > > > > > > > <b>Hi</b> > > > > > > > > > </a> > > > > > > > > > </soap:Body> > > > > > > > > > </soap:Envelope> > > > > > > trace("Node B from > > myXML2: > > > "+myXML2.descendants("b")); > > > > > > } > > > > > > ]]> > > > > > > </mx:Script> > > > > > > </mx:Application> > > > > > > > > > > > > > > > > > > > > > > > > This code results in the following traces: > > > > > > > > > > > > Node B from myXML: Hi > > > > > > Node B from myXML2: > > > > > > > > > > > > As you can see, the only difference between the two blocks of XML is > > that > > > the successful one uses "xmlns:soap=" while the unsuccessful one uses > > > "xmlns=". While I am no SOAP expert, I don't believe the 2nd one is > > invalid > > > syntax, so there should be no reason for the XML parser to ignore > > it, right? > > > > > > > > > > > > Anyone have a workaround for me that doesn't require modifying the web > > > services? (I don't have administrative access to them). > > > > > > > > > > > > Thanks! > > > > > > > > > > > > -tom > > > > > > > > > > > > > > > > > > > -- > > 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 >
-- 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/