Re: [WebDNA] XML parsing issue with cdata

This WebDNA talk-list message is from

2012


It keeps the original formatting.
numero = 109138
interpreted = N
texte = --0016e6d58c3a50fc8604c106716b Content-Type: text/plain; charset=ISO-8859-1 The solution to getting CDATA out of an xml feed goes back to a post I read by Stuart Tremain in the ancient archives. I've never used XSL but it is pretty easy to use - this is straight out of the example: I used tcpconnect to get the xml feed, then created an xsl variable with the named path, and then I set a variable for the one item I need - in this test I am easily able to get the encoded cdata, in the "text" node, at which point II can easily use it in a variety of ways - such as creating a text variable. [xsl var=xsl_var1] [text]myItem=[/text] myItem: [myItem]
[/xsl] [xslt xslref=xsl_var1][MyTestVariable][/xslt] On Sat, May 26, 2012 at 2:07 PM, Donovan Brooke wrote: > David Bastedo wrote: > >> Hi, has anybody run into the following xml parsing issue? >> >> The node: > ones at Snow City.]]> >> >> I can see the content I want in an xml file. in the CDATA abvoe - being >> the content of a tweet "RT @BoyTopi: I want to feel snow! Not the fake >> ones at Snow City." >> >> the value of the "text" node returns a blank. >> >> if I get a node attribute of "text" then I get a return name value of >> "#cdata-section" and no "value" >> >> How do I get to the CDATA information in the following example. >> >> Any ideas? Is there something I am missing? >> >> thanks. >> >> d. >> >> sample: xml >> >> >> >> tweets_locarea >> 206405518925905920 >> 1338045885 >> >> >> >> 803 >> >> Hesperia_WX >> 25 >> unknown >> >> > >> >> >> US >> United States Of America >> 1 >> USCA0481 >> CA >> Hesperia >> >> >> >> >> >> sample parse >> >> --tweet: >> ---klass: tweets_locarea >> ---tweetId: 206405503587328000 >> ---date: 1338045881 >> ---text: >> ----#cdata-section: ------------------> the offending line >> ---sentiment: >> ---dma: 803 >> ---tweeter: >> ----screenName: HeyAbbie_ >> ----influence: 27 >> ----gender: female >> ----profileImageURL: >> -----#cdata-section: ------------------> the offending line >> ---location: >> ----countryCode: US >> ----country: United States Of America >> ----type: 1 >> ----id: USCA0638 >> ----state: CA >> ----name: Los Angeles >> > > > > Hi David, not sure this matters, but the syntax I use is: > > '' > > (as apposed to >> >> >> 803 >> >> Hesperia_WX >> 25 >> unknown >> >> > >> >> >> US >> United States Of America >> 1 >> USCA0481 >> CA >> Hesperia >> >> >> >> >> >> sample parse >> >> --tweet: >> ---klass: tweets_locarea >> ---tweetId: 206405503587328000 >> ---date: 1338045881 >> ---text: >> ----#cdata-section: ------------------> the offending line >> ---sentiment: >> ---dma: 803 >> ---tweeter: >> ----screenName: HeyAbbie_ >> ----influence: 27 >> ----gender: female >> ----profileImageURL: >> -----#cdata-section: ------------------> the offending line >> ---location: >> ----countryCode: US >> ----country: United States Of America >> ----type: 1 >> ----id: USCA0638 >> ----state: CA >> ----name: Los Angeles >> > > > > Hi David, not sure this matters, but the syntax I use is: > > '' > > (as apposed to