Re: [Flashcoders] html in XML
Hi there, It's a restriction in XML that you cannot have markop, nor the open-angle bracket in an attribute value. or ; If you really want to use the attribute you have to escape the content, and unescaope while parsing in flash. W3.org: The ampersand character () and the left angle bracket () /MUST NOT/ appear in their literal form, except when used as markup delimiters, or within a comment http://www.w3.org/TR/2006/REC-xml11-20060816/#dt-comment, a processing instruction http://www.w3.org/TR/2006/REC-xml11-20060816/#dt-pi, or a CDATA section http://www.w3.org/TR/2006/REC-xml11-20060816/#dt-cdsection. If they are needed elsewhere, they /MUST/ be escaped http://www.w3.org/TR/2006/REC-xml11-20060816/#dt-escape using either numeric character references http://www.w3.org/TR/2006/REC-xml11-20060816/#dt-charref or the strings |amp;| and |lt;| respectively. The right angle bracket () may be represented using the string |gt;|, and /MUST/, for compatibility http://www.w3.org/TR/2006/REC-xml11-20060816/#dt-compat, be escaped using either |gt;| or a character reference when it appears in the string |]]| in content, when that string is not marking the end of a CDATA section http://www.w3.org/TR/2006/REC-xml11-20060816/#dt-cdsection. In the content of elements, character data is any string of characters which does not contain the start-delimiter of any markup or the CDATA-section-close delimiter, |]]|. In a CDATA section, character data is any string of characters not including the CDATA-section-close delimiter. *CDATA sections* may occur anywhere character data may occur; they are used to escape blocks of text containing characters which would otherwise be recognized as markup. CDATA sections begin with the string |![CDATA[| and end with the string |]]|:] you open the cdata with ![CDATA[ and close it with ]] inbetween the html. source check: http://www.w3.org/TR/2006/REC-xml11-20060816/#syntax promo+biboune.net wrote: hi there i am having trouble to parse Html tags in a Xml file that is loaded in a flash file can anyone help here is the XML ?xml version=1.0 encoding=UTF-8 ? icons icon image=gif/images.gif tooltip=tooltip content= here i want to have HTML tags like a href=somewhere.comclick here to go somewhere /a / /icons best jeanphy ___ 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 ___ 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] html in XML
You won't be able to put special characters within attribute elements of a node. Instead, place it within a CDATA node: ?xml version=1.0 encoding=UTF-8 ? icons icon image=gif/images.gif tooltip=tooltip content![CDATA[here i want to have HTML tags like a href=somewhere.comclick here to go somewhere/a]]/content /icon /icons -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of promo+biboune.net Sent: Saturday, June 09, 2007 10:20 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] html in XML hi there i am having trouble to parse Html tags in a Xml file that is loaded in a flash file can anyone help here is the XML ?xml version=1.0 encoding=UTF-8 ? icons icon image=gif/images.gif tooltip=tooltip content= here i want to have HTML tags like a href=somewhere.comclick here to go somewhere /a / /icons best jeanphy ___ 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 ___ 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] html in XML
well i tried this but it does not work either ?xml version=1.0 encoding=UTF-8 ? icons icon image=gif/guillaume.gif tooltip=tooltip content=![CDATA[ a href=http://www.google.com;link/a ]] / /icons any idea?? thanlks for your help jeanphy Le 07-06-09 à 11:00, David Ngo a écrit : You won't be able to put special characters within attribute elements of a node. Instead, place it within a CDATA node: ?xml version=1.0 encoding=UTF-8 ? icons icon image=gif/images.gif tooltip=tooltip content![CDATA[here i want to have HTML tags like a href=somewhere.comclick here to go somewhere/a]]/content /icon /icons -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of promo+biboune.net Sent: Saturday, June 09, 2007 10:20 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] html in XML hi there i am having trouble to parse Html tags in a Xml file that is loaded in a flash file can anyone help here is the XML ?xml version=1.0 encoding=UTF-8 ? icons icon image=gif/images.gif tooltip=tooltip content= here i want to have HTML tags like a href=somewhere.comclick here to go somewhere /a / /icons best jeanphy ___ 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 ___ 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 ___ 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] html in XML
?xml version=1.0 encoding=UTF-8 ? icons icon image=gif/images.gif tooltip=tooltip ![CDATA[HTML content here/a]] /icon /icons hi there i am having trouble to parse Html tags in a Xml file that is loaded in a flash file can anyone help here is the XML ?xml version=1.0 encoding=UTF-8 ? icons icon image=gif/images.gif tooltip=tooltip content= here i want to have HTML tags like a href=somewhere.comclick here to go somewhere /a / /icons best jeanphy ___ 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] HTML in XML
Crazy talk my arse! ;-) I've used XML with HTML and CSS to drive several commercial products I've developed. So long as all tags are correctly terminated it makes sense to use XML; where do you think XHTML came from? XML is, by nature, a portable document that can be used and interpreted by other programs. You only use CDATA as a last resort as it can be a real pain to process in some other languages. Flash Player doesn't even recognise CDATA nodes as a type; only element and text nodes. With XML, you know the structure of the document you're working with as it is defined at some point. If I know that all data inside my content element is XHTML then I only need to fetch its contents or rather its child nodes. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Geoff Stearns Sent: 10 August 2006 17:31 To: Flashcoders mailing list Subject: Re: [Flashcoders] HTML in XML this advice is all crazy talk. the proper way to do it is to use CDATA tags. On Aug 9, 2006, at 12:04 PM, Ryan Potter wrote: Another way that works pretty well is to do a join on the child nodes. So your trace would look like this: trace(newsNode.childNodes[i].childNodes.join()); As long as your html is xml compliant (br/ instead of br) it will work just fine. ___ 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] HTML in XML
you just need to put the html content inside a cdata tag: newsitem date=8/5/2006 headline=Some headline![CDATA[ Body of the news article. a href=http://www.google.com;Google/a More body of the article/newsitem newsitem date=8/1/2006 headline=Another headlineBody of the second article ]]/newsitem On Aug 8, 2006, at 4:15 PM, Burns, John D wrote: I'm having a very weird problem and I'm hoping it's something simple that I'm overlooking. I have an xml document similar to this: news newsitem date=8/5/2006 headline=Some headlineBody of the news article. a href=http://www.google.com;Google/a More body of the article/newsitem newsitem date=8/1/2006 headline=Another headlineBody of the second article/newsitem /news The problem I'm having is that on the first article where the link is, flash is seeing that as the end of the first node and then it skips to the next one. I'm looping over the nodes in news and using this code: trace(newsNode.childNodes[i].firstChild.nodeValue); and all I would see for the first record is Body of the news article and then it goes on to the next one. A client is maintaining news through a flat xml file and wants to be able to add links. Am I missing something simple? Is there something else I need to do? Please help. John Burns ___ 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 ___ 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] HTML in XML
Another way that works pretty well is to do a join on the child nodes. So your trace would look like this: trace(newsNode.childNodes[i].childNodes.join()); As long as your html is xml compliant (br/ instead of br) it will work just fine. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lucy Thomson Sent: Wednesday, August 09, 2006 9:56 AM To: Flashcoders mailing list Subject: [Flashcoders] HTML in XML Yep use cdata tags, except I think you have 2 nodes there, so open and close them within each one. They basically tell flash to treat everything defined between them as html, so your symbols and don't mess up the xml format. newsitem date=8/5/2006 headline=Some headline![CDATA[ Body of the news article. a href=http://www.google.com;Google/a More body of the article]]/newsitem newsitem date=8/1/2006 headline=Another headline![CDATA[ Body of the second article ]]/newsitem -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Geoff Stearns Sent: 09 August 2006 15:22 To: Flashcoders mailing list Subject: Re: [Flashcoders] HTML in XML you just need to put the html content inside a cdata tag: newsitem date=8/5/2006 headline=Some headline![CDATA[ Body of the news article. a href=http://www.google.com;Google/a More body of the article/newsitem newsitem date=8/1/2006 headline=Another headlineBody of the second article ]]/newsitem On Aug 8, 2006, at 4:15 PM, Burns, John D wrote: I'm having a very weird problem and I'm hoping it's something simple that I'm overlooking. I have an xml document similar to this: news newsitem date=8/5/2006 headline=Some headlineBody of the news article. a href=http://www.google.com;Google/a More body of the article/newsitem newsitem date=8/1/2006 headline=Another headlineBody of the second article/newsitem /news The problem I'm having is that on the first article where the link is, flash is seeing that as the end of the first node and then it skips to the next one. I'm looping over the nodes in news and using this code: trace(newsNode.childNodes[i].firstChild.nodeValue); and all I would see for the first record is Body of the news article and then it goes on to the next one. A client is maintaining news through a flat xml file and wants to be able to add links. Am I missing something simple? Is there something else I need to do? Please help. John Burns ___ 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 ___ 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 ___ 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 ___ 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] HTML in XML
Hi John, The actual internal structure of the XML comes out as follows: news +-- newsitem |+-- TEXT NODE (Body of the news article.) |+-- a | | +-- TEXT NODE (Google) |+-- TEXT NODE (More body of the news article.) +-- newsitem etc. (I hope the formatting comes out) As you can see, you have to iterate through all the children of newsitem, rather than just using the firstchild. An alternative strategy would be to surround the body of the news item (including the anchor tags) with a CDATA section (look it up in any decent XML format reference) which would mean that all of the body would be treated as one node - as one string - and your anchor tags would be passed through the parser in the way I think you want. HTH, Ian On 8/8/06, Burns, John D [EMAIL PROTECTED] wrote: I'm having a very weird problem and I'm hoping it's something simple that I'm overlooking. I have an xml document similar to this: news newsitem date=8/5/2006 headline=Some headlineBody of the news article. a href=http://www.google.com;Google/a More body of the article/newsitem newsitem date=8/1/2006 headline=Another headlineBody of the second article/newsitem /news The problem I'm having is that on the first article where the link is, flash is seeing that as the end of the first node and then it skips to the next one. I'm looping over the nodes in news and using this code: trace(newsNode.childNodes[i].firstChild.nodeValue); and all I would see for the first record is Body of the news article and then it goes on to the next one. A client is maintaining news through a flat xml file and wants to be able to add links. Am I missing something simple? Is there something else I need to do? Please help. John Burns ___ 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 ___ 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] HTML in XML
As you can see, you have to iterate through all the children of newsitem, rather than just using the firstchild. newsNode.childNodes[i].firstChild.nodeValue.toString() should work also, since it would render the node and all of its children as a string. ryanm ___ 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] HTML in XML
Le 6 déc. 05, à 19:20, Mike Boutin a écrit : I am bring in some html text to show in flash in an xml file like this: description id=0 title![CDATA[bpicture 0/b]]/title /description When i trace it back in flash, it shows up like this: lt;bgt;picture 0lt;/bgt; Isn't it the expected behavior : to escape the html tags ? If you want to display the html in a textfield, be sure to give it his html to true. That should work as is. HTH --- erixtekila http://blog.v-i-a.net/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] HTML in XML
Make sure your XML document is in Unicode. I use Unicode-8, but our ASP pages write Unicode-16. You don¹t need any CDATA tags. I have XHTML info bubbles with CSS and images; text is like this: bubble id=0 p class='titel'Network Address Translation/pbr/ pNAT or Network Address Translation takes place on the boundary img src='texts/kaart.jpg' align='right' hspace='6' vspace='8'/between public and private networks. /bubble Just be sure to close all tags. Sander. I am bring in some html text to show in flash in an xml file like this: description id=0 title![CDATA[bpicture 0/b]]/title /description When i trace it back in flash, it shows up like this: lt;bgt;picture 0lt;/bgt; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] HTML in XML
You want to use .nodeValue when accessing CDATA or the data will be escaped. JOR ___ === James O'Reilly === === SynergyMedia, Inc. === www.synergymedia.net Mike Boutin wrote: I am bring in some html text to show in flash in an xml file like this: description id=0 title![CDATA[bpicture 0/b]]/title /description When i trace it back in flash, it shows up like this: lt;bgt;picture 0lt;/bgt; How can I keep it show it shows the html tags because it wont show up in flash as bolded... Thanks! ___ 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