RE: [Flashcoders] flash and xpath
I'm still getting the value returned as amp;. I'm starting to pull my hair out cause of this. Could there be any other reason why this is occurring? When I look at the file being loaded in from the output as a var I see that even in there the ampersand is being shown as amp;. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kerem Iseri Sent: Wednesday, May 16, 2007 5:55 PM To: flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] flash and xpath Use CDATA for that node inside the XML to make flash recognise everything you write inside CDATA as html text. You can even use font size=12 color='#171717'/font or br for new line etc. For example .. item![CDATA[Field Stream]]/item Kerem İŞERİ Trafo Intractive www.trafo.com.tr -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jason Law Sent: Wednesday, May 16, 2007 11:38 PM To: flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] flash and xpath Ok, so I was able to get it to work, but now I'm coming across another issue. I'm loading in xml using the old new XML() object and using xpath to parse. One of the fields I have looks like this. itemField Stream/item. The issue is that the value I'm getting back from xpath is Field amp; Stream and not Field Stream. The textfield that is being used to display is not showing the text as html and fontEmbed is false. Is there anything that I could do to fix this? Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Johannes Nel Sent: Wednesday, May 16, 2007 12:45 PM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] flash and xpath it seems you want to get the text value of a node. try this var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign']/text() )toString(); notice the text() On 5/16/07, Jason Law [EMAIL PROTECTED] wrote: I'm wondering if this is possible within flash 8 using the xpath api to do something like this. var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign'][2] ).firstChild.toString(); now I know this works var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign'] ).firstChild.toString(); but it seems that when you add any kind of nodeItem to the end of an item flash returns undefined. jason law, detroit organic, inc. | www.organic.com http://www.organic.com/ retail tech lead | interface engineer e: [EMAIL PROTECTED] | p: 248.454.3387 | aim: jaylaw81 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Dissemination, distribution or copying of this email or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this email in error, please immediately notify us by calling our Help Desk at (415) 581-5552 or by e-mailing us at [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- j:pn http://www.lennel.org ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Dissemination, distribution or copying of this email or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this email in error, please immediately notify us by calling our Help Desk at (415) 581-5552 or by e-mailing us at [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training
Re: [Flashcoders] flash and xpath
set it as html text On 5/17/07, Jason Law [EMAIL PROTECTED] wrote: I'm still getting the value returned as amp;. I'm starting to pull my hair out cause of this. Could there be any other reason why this is occurring? When I look at the file being loaded in from the output as a var I see that even in there the ampersand is being shown as amp;. -Original Message- From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] On Behalf Of Kerem Iseri Sent: Wednesday, May 16, 2007 5:55 PM To: flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] flash and xpath Use CDATA for that node inside the XML to make flash recognise everything you write inside CDATA as html text. You can even use font size=12 color='#171717'/font or br for new line etc. For example .. item![CDATA[Field Stream]]/item Kerem İŞERİ Trafo Intractive www.trafo.com.tr -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jason Law Sent: Wednesday, May 16, 2007 11:38 PM To: flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] flash and xpath Ok, so I was able to get it to work, but now I'm coming across another issue. I'm loading in xml using the old new XML() object and using xpath to parse. One of the fields I have looks like this. itemField Stream/item. The issue is that the value I'm getting back from xpath is Field amp; Stream and not Field Stream. The textfield that is being used to display is not showing the text as html and fontEmbed is false. Is there anything that I could do to fix this? Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Johannes Nel Sent: Wednesday, May 16, 2007 12:45 PM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] flash and xpath it seems you want to get the text value of a node. try this var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign']/text() )toString(); notice the text() On 5/16/07, Jason Law [EMAIL PROTECTED] wrote: I'm wondering if this is possible within flash 8 using the xpath api to do something like this. var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign'][2] ).firstChild.toString(); now I know this works var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign'] ).firstChild.toString(); but it seems that when you add any kind of nodeItem to the end of an item flash returns undefined. jason law, detroit organic, inc. | www.organic.com http://www.organic.com/ retail tech lead | interface engineer e: [EMAIL PROTECTED] | p: 248.454.3387 | aim: jaylaw81 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Dissemination, distribution or copying of this email or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this email in error, please immediately notify us by calling our Help Desk at (415) 581-5552 or by e-mailing us at [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- j:pn http://www.lennel.org ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Dissemination, distribution or copying of this email or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this email in error, please immediately notify us by calling our Help Desk at (415) 581-5552 or by e-mailing us at [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you
RE: [Flashcoders] flash and xpath
Make sure that your file is saved as the encoding type you specified for the XML. For instance, if you have UTF-8 specified, ensure that the file type saved is also UTF-8. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jason Law Sent: Thursday, May 17, 2007 10:48 AM To: flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] flash and xpath I'm still getting the value returned as amp;. I'm starting to pull my hair out cause of this. Could there be any other reason why this is occurring? When I look at the file being loaded in from the output as a var I see that even in there the ampersand is being shown as amp;. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kerem Iseri Sent: Wednesday, May 16, 2007 5:55 PM To: flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] flash and xpath Use CDATA for that node inside the XML to make flash recognise everything you write inside CDATA as html text. You can even use font size=12 color='#171717'/font or br for new line etc. For example .. item![CDATA[Field Stream]]/item Kerem İŞERİ Trafo Intractive www.trafo.com.tr -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jason Law Sent: Wednesday, May 16, 2007 11:38 PM To: flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] flash and xpath Ok, so I was able to get it to work, but now I'm coming across another issue. I'm loading in xml using the old new XML() object and using xpath to parse. One of the fields I have looks like this. itemField Stream/item. The issue is that the value I'm getting back from xpath is Field amp; Stream and not Field Stream. The textfield that is being used to display is not showing the text as html and fontEmbed is false. Is there anything that I could do to fix this? Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Johannes Nel Sent: Wednesday, May 16, 2007 12:45 PM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] flash and xpath it seems you want to get the text value of a node. try this var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign']/text() )toString(); notice the text() On 5/16/07, Jason Law [EMAIL PROTECTED] wrote: I'm wondering if this is possible within flash 8 using the xpath api to do something like this. var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign'][2] ).firstChild.toString(); now I know this works var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign'] ).firstChild.toString(); but it seems that when you add any kind of nodeItem to the end of an item flash returns undefined. jason law, detroit organic, inc. | www.organic.com http://www.organic.com/ retail tech lead | interface engineer e: [EMAIL PROTECTED] | p: 248.454.3387 | aim: jaylaw81 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Dissemination, distribution or copying of this email or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this email in error, please immediately notify us by calling our Help Desk at (415) 581-5552 or by e-mailing us at [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- j:pn http://www.lennel.org ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Dissemination, distribution or copying of this email or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this email in error, please
RE: [Flashcoders] flash and xpath
Jason, I came across this problem recently... Unless you use the nodeValue property, the returned node will be escaped when converted to string (and no,unescape doesn't help a bit...). It's not a full url-encoding that you get with the escape() function, but ampersands and html tags will be converted to entities such as amp;. Now I haven't used xpath, so I don't know if it implements nodeValue, but even if it doesn't, there's got to be a way of extracting it. Karina -Original Message- From: Jason Law [mailto:[EMAIL PROTECTED] Sent: 17 May 2007 15:48 To: flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] flash and xpath I'm still getting the value returned as amp;. I'm starting to pull my hair out cause of this. Could there be any other reason why this is occurring? When I look at the file being loaded in from the output as a var I see that even in there the ampersand is being shown as amp;. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kerem Iseri Sent: Wednesday, May 16, 2007 5:55 PM To: flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] flash and xpath Use CDATA for that node inside the XML to make flash recognise everything you write inside CDATA as html text. You can even use font size=12 color='#171717'/font or br for new line etc. For example .. item![CDATA[Field Stream]]/item Kerem İŞERİ Trafo Intractive www.trafo.com.tr -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jason Law Sent: Wednesday, May 16, 2007 11:38 PM To: flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] flash and xpath Ok, so I was able to get it to work, but now I'm coming across another issue. I'm loading in xml using the old new XML() object and using xpath to parse. One of the fields I have looks like this. itemField Stream/item. The issue is that the value I'm getting back from xpath is Field amp; Stream and not Field Stream. The textfield that is being used to display is not showing the text as html and fontEmbed is false. Is there anything that I could do to fix this? Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Johannes Nel Sent: Wednesday, May 16, 2007 12:45 PM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] flash and xpath it seems you want to get the text value of a node. try this var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign']/text() )toString(); notice the text() On 5/16/07, Jason Law [EMAIL PROTECTED] wrote: I'm wondering if this is possible within flash 8 using the xpath api to do something like this. var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign'][2] ).firstChild.toString(); now I know this works var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign'] ).firstChild.toString(); but it seems that when you add any kind of nodeItem to the end of an item flash returns undefined. jason law, detroit organic, inc. | www.organic.com http://www.organic.com/ retail tech lead | interface engineer e: [EMAIL PROTECTED] | p: 248.454.3387 | aim: jaylaw81 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Dissemination, distribution or copying of this email or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this email in error, please immediately notify us by calling our Help Desk at (415) 581-5552 or by e-mailing us at [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- j:pn http://www.lennel.org ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] flash and xpath
I came across this problem recently... Unless you use the nodeValue property, the returned node will be escaped when converted to string Uh, yeah, I posted this earlier. It uses nodeValue to escape: /*decodes any character entities in a string. For example, it converts amp; to . */ function decodeEntities(entityString:String):String { var x:XML = new XML(n+entityString+/n); x.parseXML(); return x.firstChild.firstChild.nodeValue; } Just send that function your dirty string you got from the XML and it should come back clean. Jason Merrill Bank of America GTO Learning Leadership Development eTools Multimedia Team ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] flash and xpath
it seems you want to get the text value of a node. try this var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign']/text() )toString(); notice the text() On 5/16/07, Jason Law [EMAIL PROTECTED] wrote: I'm wondering if this is possible within flash 8 using the xpath api to do something like this. var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign'][2] ).firstChild.toString(); now I know this works var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign'] ).firstChild.toString(); but it seems that when you add any kind of nodeItem to the end of an item flash returns undefined. jason law, detroit organic, inc. | www.organic.com http://www.organic.com/ retail tech lead | interface engineer e: [EMAIL PROTECTED] | p: 248.454.3387 | aim: jaylaw81 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Dissemination, distribution or copying of this email or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this email in error, please immediately notify us by calling our Help Desk at (415) 581-5552 or by e-mailing us at [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- j:pn http://www.lennel.org ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] flash and xpath
Ok, so I was able to get it to work, but now I'm coming across another issue. I'm loading in xml using the old new XML() object and using xpath to parse. One of the fields I have looks like this. itemField Stream/item. The issue is that the value I'm getting back from xpath is Field amp; Stream and not Field Stream. The textfield that is being used to display is not showing the text as html and fontEmbed is false. Is there anything that I could do to fix this? Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Johannes Nel Sent: Wednesday, May 16, 2007 12:45 PM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] flash and xpath it seems you want to get the text value of a node. try this var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign']/text() )toString(); notice the text() On 5/16/07, Jason Law [EMAIL PROTECTED] wrote: I'm wondering if this is possible within flash 8 using the xpath api to do something like this. var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign'][2] ).firstChild.toString(); now I know this works var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign'] ).firstChild.toString(); but it seems that when you add any kind of nodeItem to the end of an item flash returns undefined. jason law, detroit organic, inc. | www.organic.com http://www.organic.com/ retail tech lead | interface engineer e: [EMAIL PROTECTED] | p: 248.454.3387 | aim: jaylaw81 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Dissemination, distribution or copying of this email or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this email in error, please immediately notify us by calling our Help Desk at (415) 581-5552 or by e-mailing us at [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- j:pn http://www.lennel.org ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Dissemination, distribution or copying of this email or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this email in error, please immediately notify us by calling our Help Desk at (415) 581-5552 or by e-mailing us at [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] flash and xpath
One of the fields I have looks like this. itemField Stream/item. The issue is that the value I'm getting back from xpath is Field amp; Stream and not Field Stream. Use this: /*decodes any character entities in a string. For example, it converts amp; to . */ private function decodeEntities(entityString:String):String { var x:XML = new XML(n+entityString+/n); x.parseXML(); return x.firstChild.firstChild.nodeValue; } Jason Merrill Bank of America GTO Learning Leadership Development eTools Multimedia Team ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] flash and xpath
Use CDATA for that node inside the XML to make flash recognise everything you write inside CDATA as html text. You can even use font size=12 color='#171717'/font or br for new line etc. For example .. item![CDATA[Field Stream]]/item Kerem İŞERİ Trafo Intractive www.trafo.com.tr -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jason Law Sent: Wednesday, May 16, 2007 11:38 PM To: flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] flash and xpath Ok, so I was able to get it to work, but now I'm coming across another issue. I'm loading in xml using the old new XML() object and using xpath to parse. One of the fields I have looks like this. itemField Stream/item. The issue is that the value I'm getting back from xpath is Field amp; Stream and not Field Stream. The textfield that is being used to display is not showing the text as html and fontEmbed is false. Is there anything that I could do to fix this? Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Johannes Nel Sent: Wednesday, May 16, 2007 12:45 PM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] flash and xpath it seems you want to get the text value of a node. try this var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign']/text() )toString(); notice the text() On 5/16/07, Jason Law [EMAIL PROTECTED] wrote: I'm wondering if this is possible within flash 8 using the xpath api to do something like this. var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign'][2] ).firstChild.toString(); now I know this works var item:String = XPathAPI.selectSingleNode(doc.firstChild, /html/body/[EMAIL PROTECTED]'data']/[EMAIL PROTECTED]'campaign'] ).firstChild.toString(); but it seems that when you add any kind of nodeItem to the end of an item flash returns undefined. jason law, detroit organic, inc. | www.organic.com http://www.organic.com/ retail tech lead | interface engineer e: [EMAIL PROTECTED] | p: 248.454.3387 | aim: jaylaw81 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Dissemination, distribution or copying of this email or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this email in error, please immediately notify us by calling our Help Desk at (415) 581-5552 or by e-mailing us at [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- j:pn http://www.lennel.org ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Dissemination, distribution or copying of this email or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this email in error, please immediately notify us by calling our Help Desk at (415) 581-5552 or by e-mailing us at [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com __ NOD32 2267 (20070515) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http