Re: [Flashcoders] Xpath and HTML tags inside XML bug?
I'm having the same issue even without XPATH, I have a CDATA section in my XML and the text field renders the text and the HTML tags without rendering HTML, if I cut and paste the HTML to a string and set the text field to that it works as expected. I've done this before and it worked, difference now is I'm compiling with MTASC and using flash 8 IDE. I'm going to try a standalone fla test and compile with MM compiler and flash 7 to see what the issue is. Grant - Original Message - From: Merrill, Jason [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: 12/7/05 1:56 PM Subject: [Flashcoders] Xpath and HTML tags inside XML bug? Searched Google, no dice, when the chattyfig servers were down again, I turned to Flexcoders, no luck either. Anyone who has experience with Xpath, I hope you can help. Problem overview: using Xpath, HTML tags inside of XML does not render, even with CDATA tags applied. Problem detail: I am using xfactorstudios' Xpath classes to bring in XML node data which contains text and HTML tags to display in a Flash text area component in the Flash 7 player. Here is a snippet of the XML: http://www.fda.gov/cdrh/'Center for Devices of Radiological Health. More text...]] The text area component IS set to HTML=true, but when it renders, it shows the text plus the HTML: Welcome to the Center for Devices of Radiological Health. More text... Does the same thing with a regular dynamic text field. If I hard code the same string directly in the .fla, it renders properly in the text field and/or component. The string from XPath returns, interestingly enough, looks like this: Welcome to the a href='http://www.fda.gov/cdrh/'Center for Devices of Radiological Health/a. More text... Not sure why Xpath is changing the string from . to /a, but Flash doesn't like it obviously. Anyone come across this before and have a solution? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ 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] Xpath and HTML tags inside XML bug?
Don't know if this helps, but for html, you set: textArea.html = true; then: textArea.text = thestring; ,but for textField, you set: textField.html = true; then: textField.htmlText = thestring; But you probably knew that. I think that's really confusing the way Macromedia coded that. Guess their developers weren't talking to each other enough. What are you using to bring in the XML? Before going to the textfield, the string is being traced out as having the HTML tags intact or no? The CDATA tags are correct in the XML as well? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
yes doing that, when I do a trace when I have a CDATA section with hello and bold tags around it (not typing it as it won't be displayed in the flashlist) I see in the text field the hello with the html tags and the same in the trace, if I set a string to hello with bold tags around it and assign it to the same text field it works... I'll create a demo file and upload soon, I had a deadline so ended up using loadvars for the html content and that worked, but I've done the CDATA section stuff for my old site and it worked then. Grant - Original Message - From: Merrill, Jason [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: 12/9/05 1:36 PM Subject: RE: [Flashcoders] Xpath and HTML tags inside XML bug? Don't know if this helps, but for html, you set: textArea.html = true; then: textArea.text = thestring; ,but for textField, you set: textField.html = true; then: textField.htmlText = thestring; But you probably knew that. I think that's really confusing the way Macromedia coded that. Guess their developers weren't talking to each other enough. What are you using to bring in the XML? Before going to the textfield, the string is being traced out as having the HTML tags intact or no? The CDATA tags are correct in the XML as well? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ 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] Xpath and HTML tags inside XML bug?
Yes this is how I have been fixing the problem. Seems like a pain to have to use both methods, rather than just using the xpath. Morten Barklund Shockwaved wrote: Merrill, Jason wrote: [...] Problem overview: using Xpath, HTML tags inside of XML does not render, even with CDATA tags applied. [...] Does the same thing with a regular dynamic text field. If I hard code the same string directly in the .fla, it renders properly in the text field and/or component. The string from XPath returns, interestingly enough, looks like this: Welcome to the lt;a href=apos;http://www.fda.gov/cdrh/apos;gt;Center for Devices of Radiological Healthlt;/agt;. More text... Not sure why Xpath is changing the string from /a. to lt;/agt;, but Flash doesn't like it obviously. Anyone come across this before and have a solution? If you used the regular XML and XMLNode-classes in Flash, you'd come to the same problem if you tried to insert the node directly - and didn't use the nodeValue-property of the XMLNode-object. If your XPath implementation returns XMLNode-object, just use the my_xmlnode.nodeValue-property and insert this in the textfield. If the XPath implementation returns a string and this string is the toString-value of the XMLNode (which the above is) and *not* the nodeValue-property, then the writer of the XPath implementation should read his manual once again :) Hope that helps. :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Xpath and HTML tags inside XML bug?
Quote: http://www.w3.org/TR/xpath#section-Expressions I can never seem to make heads or tails of the w3.org documentation - maybe I'm just dumb, but it's always information overload to me. Mike, since we seem to be having the exact same problem, did you get it working? If so, can you send a code snippet of what works? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
Still wasnt able to get it working. I had to resort to using nodeValue instead. pain in the ass Mike Boutin Juicy Studios Merrill, Jason wrote: Quote: http://www.w3.org/TR/xpath#section-Expressions I can never seem to make heads or tails of the w3.org documentation - maybe I'm just dumb, but it's always information overload to me. Mike, since we seem to be having the exact same problem, did you get it working? If so, can you send a code snippet of what works? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ 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] Xpath and HTML tags inside XML bug?
Mike Boutin wrote: Still wasnt able to get it working. I had to resort to using nodeValue instead. pain in the ass Why is it a workaround? Doesn't the XPath return the XMLNode? You can't just use the regular toString-method of the XMLNode-object - that'll return the wrong encoding. The nodeValue *is* the only proper way to fetch the correct textdata without encoding. If the XPath-method, that you use, is supposed to return the string value of a text element, then using nodeValue is a hack. But if you only use an XPath-method which is supposed to return an XMLNode, then it is *not* a hack, but doing exactly, what you are supposed to do. I haven't used this XPath-extension, but maybe I should check i out. -- Morten Barklund - Information Architect - Shockwaved Gothersgade 49, 4th floor - DK-1123 Copenhagen K, Denmark Phone: +45 7027 2227 - Fax: +45 3369 1174 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
I was able to use xpath to return titlesome html/title then use nodeValue on that. but I *wish* i could just do /xmlnode/xmlnode/text() and cut nodeValue out but i dont think its possible. Morten Barklund Shockwaved wrote: Mike Boutin wrote: Still wasnt able to get it working. I had to resort to using nodeValue instead. pain in the ass Why is it a workaround? Doesn't the XPath return the XMLNode? You can't just use the regular toString-method of the XMLNode-object - that'll return the wrong encoding. The nodeValue *is* the only proper way to fetch the correct textdata without encoding. If the XPath-method, that you use, is supposed to return the string value of a text element, then using nodeValue is a hack. But if you only use an XPath-method which is supposed to return an XMLNode, then it is *not* a hack, but doing exactly, what you are supposed to do. I haven't used this XPath-extension, but maybe I should check i out. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Xpath and HTML tags inside XML bug?
Why is it a workaround? Doesn't the XPath return the XMLNode? I haven't used this XPath-extension, but maybe I should check i out. Morten, I'm not sure it returns the actual node - it might convert it to another object instead because I too cannot get your suggestions to work. Could you send an xfactorstudio Xpath Actionscript example of what you mean? If you haven't used those classes before, then its interesting that you are giving advice about a product you don't seem to know the details of. I like Mike cannot get your suggestions to work, which if I am interpreting correctly, would mean: myString = XPath.selectNodes(my_xml,rootNode/myChildNodeNode/myChildNode/).nodeVa lue; That returns undefined when I try it. Or are you suggesting something else? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Xpath and HTML tags inside XML bug?
Still wasnt able to get it working. I had to resort to using nodeValue instead. pain in the ass So basically, unless Martin's suggestions prove correct, you simply cannot use the xfactorstudios' xPath classes to bring in HTML formatted strings from XML, right? That SUCKS. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Mike Boutin Sent: Wednesday, December 07, 2005 2:46 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Xpath and HTML tags inside XML bug? Still wasnt able to get it working. I had to resort to using nodeValue instead. pain in the ass Mike Boutin Juicy Studios Merrill, Jason wrote: Quote: http://www.w3.org/TR/xpath#section-Expressions I can never seem to make heads or tails of the w3.org documentation - maybe I'm just dumb, but it's always information overload to me. Mike, since we seem to be having the exact same problem, did you get it working? If so, can you send a code snippet of what works? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ 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] Xpath and HTML tags inside XML bug?
try dropping the last slash in ur xpath statement On 12/7/05, Merrill, Jason [EMAIL PROTECTED] wrote: Why is it a workaround? Doesn't the XPath return the XMLNode? I haven't used this XPath-extension, but maybe I should check i out. Morten, I'm not sure it returns the actual node - it might convert it to another object instead because I too cannot get your suggestions to work. Could you send an xfactorstudio Xpath Actionscript example of what you mean? If you haven't used those classes before, then its interesting that you are giving advice about a product you don't seem to know the details of. I like Mike cannot get your suggestions to work, which if I am interpreting correctly, would mean: myString = XPath.selectNodes(my_xml,rootNode/myChildNodeNode/myChildNode/).nodeVa lue; That returns undefined when I try it. Or are you suggesting something else? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- j:pn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
sorry no, u r doing a query which returns an array, try slectSingleNode, and that will work On 12/7/05, Johannes Nel [EMAIL PROTECTED] wrote: try dropping the last slash in ur xpath statement On 12/7/05, Merrill, Jason [EMAIL PROTECTED] wrote: Why is it a workaround? Doesn't the XPath return the XMLNode? I haven't used this XPath-extension, but maybe I should check i out. Morten, I'm not sure it returns the actual node - it might convert it to another object instead because I too cannot get your suggestions to work. Could you send an xfactorstudio Xpath Actionscript example of what you mean? If you haven't used those classes before, then its interesting that you are giving advice about a product you don't seem to know the details of. I like Mike cannot get your suggestions to work, which if I am interpreting correctly, would mean: myString = XPath.selectNodes(my_xml,rootNode/myChildNodeNode/myChildNode/).nodeVa lue; That returns undefined when I try it. Or are you suggesting something else? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- j:pn -- j:pn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Xpath and HTML tags inside XML bug?
I was able to use xpath to return titlesome html/title then use nodeValue on that. Can you send me an actionscript example of how you did that? I'm not even that far yet. This returns undefined: myNode = XPath.selectNodes(config_xml,config/welcome/introduction); This works and returns the string (but with the unwanted gobbledegook): myNode = XPath.selectNodes(config_xml,config/welcome/introduction/text()); Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
string = XPath.selectNodes(my_xml, /path/to/nodes).nodeValue; This results in undefined. Johannes Nel wrote: try dropping the last slash in ur xpath statement On 12/7/05, Merrill, Jason [EMAIL PROTECTED] wrote: Why is it a workaround? Doesn't the XPath return the XMLNode? I haven't used this XPath-extension, but maybe I should check i out. Morten, I'm not sure it returns the actual node - it might convert it to another object instead because I too cannot get your suggestions to work. Could you send an xfactorstudio Xpath Actionscript example of what you mean? If you haven't used those classes before, then its interesting that you are giving advice about a product you don't seem to know the details of. I like Mike cannot get your suggestions to work, which if I am interpreting correctly, would mean: myString = XPath.selectNodes(my_xml,rootNode/myChildNodeNode/myChildNode/).nodeVa lue; That returns undefined when I try it. Or are you suggesting something else? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- j:pn ___ 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] Xpath and HTML tags inside XML bug?
even in this case the result is undefined string = XPath.selectNodes(my_xml, /pathto[1]/xml).nodeValue; !-- single node Johannes Nel wrote: sorry no, u r doing a query which returns an array, try slectSingleNode, and that will work On 12/7/05, Johannes Nel [EMAIL PROTECTED] wrote: try dropping the last slash in ur xpath statement On 12/7/05, Merrill, Jason [EMAIL PROTECTED] wrote: Why is it a workaround? Doesn't the XPath return the XMLNode? I haven't used this XPath-extension, but maybe I should check i out. Morten, I'm not sure it returns the actual node - it might convert it to another object instead because I too cannot get your suggestions to work. Could you send an xfactorstudio Xpath Actionscript example of what you mean? If you haven't used those classes before, then its interesting that you are giving advice about a product you don't seem to know the details of. I like Mike cannot get your suggestions to work, which if I am interpreting correctly, would mean: myString = XPath.selectNodes(my_xml,rootNode/myChildNodeNode/myChildNode/).nodeVa lue; That returns undefined when I try it. Or are you suggesting something else? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- j:pn -- j:pn ___ 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] Xpath and HTML tags inside XML bug?
use the selectSingleNode method or use the array accessor On 12/7/05, Mike Boutin [EMAIL PROTECTED] wrote: even in this case the result is undefined string = XPath.selectNodes(my_xml, /pathto[1]/xml).nodeValue; !-- single node Johannes Nel wrote: sorry no, u r doing a query which returns an array, try slectSingleNode, and that will work On 12/7/05, Johannes Nel [EMAIL PROTECTED] wrote: try dropping the last slash in ur xpath statement On 12/7/05, Merrill, Jason [EMAIL PROTECTED] wrote: Why is it a workaround? Doesn't the XPath return the XMLNode? I haven't used this XPath-extension, but maybe I should check i out. Morten, I'm not sure it returns the actual node - it might convert it to another object instead because I too cannot get your suggestions to work. Could you send an xfactorstudio Xpath Actionscript example of what you mean? If you haven't used those classes before, then its interesting that you are giving advice about a product you don't seem to know the details of. I like Mike cannot get your suggestions to work, which if I am interpreting correctly, would mean: myString = XPath.selectNodes (my_xml,rootNode/myChildNodeNode/myChildNode/).nodeVa lue; That returns undefined when I try it. Or are you suggesting something else? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- j:pn -- j:pn ___ 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 -- j:pn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
Where is the documentation on selectSingleNode It doesnt seem to be in flash 8 help files. Johannes Nel wrote: use the selectSingleNode method or use the array accessor On 12/7/05, Mike Boutin [EMAIL PROTECTED] wrote: even in this case the result is undefined string = XPath.selectNodes(my_xml, /pathto[1]/xml).nodeValue; !-- single node Johannes Nel wrote: sorry no, u r doing a query which returns an array, try slectSingleNode, and that will work On 12/7/05, Johannes Nel [EMAIL PROTECTED] wrote: try dropping the last slash in ur xpath statement On 12/7/05, Merrill, Jason [EMAIL PROTECTED] wrote: Why is it a workaround? Doesn't the XPath return the XMLNode? I haven't used this XPath-extension, but maybe I should check i out. Morten, I'm not sure it returns the actual node - it might convert it to another object instead because I too cannot get your suggestions to work. Could you send an xfactorstudio Xpath Actionscript example of what you mean? If you haven't used those classes before, then its interesting that you are giving advice about a product you don't seem to know the details of. I like Mike cannot get your suggestions to work, which if I am interpreting correctly, would mean: myString = XPath.selectNodes (my_xml,rootNode/myChildNodeNode/myChildNode/).nodeVa lue; That returns undefined when I try it. Or are you suggesting something else? Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- j:pn -- j:pn ___ 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 -- j:pn ___ 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] Xpath and HTML tags inside XML bug?
Mike Boutin wrote: even in this case the result is undefined string = XPath.selectNodes(my_xml, /pathto[1]/xml).nodeValue; I've just gotten the libraries, and it is exactly as I expected. selectNodes returns an Array of XMLNode-objects. Even the notion of /text() is just to get the node, which has no name, as it is a textnode - but it does not mean, that it will return the text. The function will still return an array of XMLNode-objects. So in order to actually get the text, you need to select the corrent index in the array, and then get the nodeValue from the XMLNode. given: var nodes:Array = XPath.selectNodes(my_xml, /pathto[1]/xml/text()); var textnode:XMLNode = XMLNode(nodes[0]); var text:String = textnode.nodeValue; That would be the proper way to do this perfectly and correctly. And rather OOP and nice too :) -- Morten Barklund - Information Architect - Shockwaved Gothersgade 49, 4th floor - DK-1123 Copenhagen K, Denmark Phone: +45 7027 2227 - Fax: +45 3369 1174 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
Perfect, thanks for the help! Morten Barklund Shockwaved wrote: Mike Boutin wrote: even in this case the result is undefined string = XPath.selectNodes(my_xml, /pathto[1]/xml).nodeValue; I've just gotten the libraries, and it is exactly as I expected. selectNodes returns an Array of XMLNode-objects. Even the notion of /text() is just to get the node, which has no name, as it is a textnode - but it does not mean, that it will return the text. The function will still return an array of XMLNode-objects. So in order to actually get the text, you need to select the corrent index in the array, and then get the nodeValue from the XMLNode. given: var nodes:Array = XPath.selectNodes(my_xml, /pathto[1]/xml/text()); var textnode:XMLNode = XMLNode(nodes[0]); var text:String = textnode.nodeValue; That would be the proper way to do this perfectly and correctly. And rather OOP and nice too :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Xpath and HTML tags inside XML bug?
By the way Martin, I hope I didn't come across as being unappreciative - thanks again for your help. Mike too. Mike, if it's any less painful, while not pretty, I knocked it down to a single line and this works: myText=XMLNode((XPath.selectNodes(myxml,myNodePath/mynode())[0])).node Value; Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xpath and HTML tags inside XML bug?
Sweet that works. thanks for the update! ;) Mike Boutin Juicy Studios Merrill, Jason wrote: By the way Martin, I hope I didn't come across as being unappreciative - thanks again for your help. Mike too. Mike, if it's any less painful, while not pretty, I knocked it down to a single line and this works: myText=XMLNode((XPath.selectNodes(myxml,myNodePath/mynode())[0])).node Value; Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ 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