Re: [WebDNA] XML parsing issue with cdata

This WebDNA talk-list message is from

2012


It keeps the original formatting.
numero = 109152
interpreted = N
texte = --f46d043c81bcb6a74404c1106374 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable ok, thanks! I think it is the interpret that is messing me up. i'll have another go. d. On Sun, May 27, 2012 at 10:36 PM, Stuart Tremain wrote= : > [!] -------------- WRITE RESULT TO FILE -------------- [/!] > [WRITEFILE file=3Dinclude/hosom/RESULTDATA/NEWDATA-[DATE %Y%m%d]-[TIME > %H%M].xml][RESULTDATA][/WRITEFILE] > > > [!] -------------- Get Ready to append XML data to a database. > -------------- [/!] > [xsl var=3Dxsl_ORDER1][INCLUDE file=3D^XML/XML-order-stylesheet.inc][/XSL= ] > [text]RESULT=3D[unurl][xslt > xslref=3Dxsl_ORDER1][RESULTDATA][/xslt][/unurl][/text] > > > [!] -------------- Interpret [RESULT] to 'parse' WebDNA code and do the > APPEND. -------------- [/!] > [interpret][RESULT][/interpret] > > > Here is the style sheet, the trick is to write your WebDNA with URL'd > brackets ie %5B/REPLACE%5D instead of [/REPLACE] and check the way that = & > is URL'd. The reason that this is done is that if you use [ or ] it will > interpret the WebDNA before you really want to use it, hence > the [interpret][RESULT][/interpret] > > Sorry, you will have to read around the LISTWORDS stuff. > > > http://www.w3.org/1999/XSL/Transform"> > > > > %5BREPLACE > db=3D^data/HOSOMorders.db[url]&[/url]eqX-AUTOIDdata=3D[url]&[/url]append= =3DT%5D[LISTWORDS > words=3D[INCLUDE file=3D^XML/XML-Fields-C.inc]&delimiters=3D,]X-[WORD][Sh= owIf > [INCLUDE file=3D^XML/duplicate-field-names.inc]^|[WORD]|]-CUSTOMER[/ShowI= f]=3D select=3D"[URL][WORD][/URL]"/>[URL]&[/URL][/LISTWORDS][!] > [/!][LISTWORDS words=3D[INCLUDE > file=3D^XML/XML-Fields-O.inc]&delimiters=3D,]X-[WORD][ShowIf [INCLUDE > file=3D^XML/duplicate-field-names.inc]^|[WORD]|]-ORDER[/ShowIf]=3D select=3D"[If > ("[WORD]"^"COMMENT")][Then][URL][URL][WORD][/URL][/URL][/Then][Else][URL]= [WORD][/URL][/Else][/If]"/>[URL]&[/URL][/LISTWORDS]X-ThisOrder=3D[TEXT > SHOW=3DT]X-ThisOrder=3D- select=3D"ID"/>[URL]&[/URL]X-STOREID-LINEITEM=3D select=3D"StoreID"/>[URL]&[/URL]X-ORDERID=3D > [URL]&[/URL]X-AUTOID=3DCUSTOMER[/TEXT][!] > [/!][!]CLOSES O[/!]%5B/REPLACE%5D > > %5BREPLACE > db=3D^data/HOSOMorders.db[url]&[/url]eqX-AUTOIDdata=3D[url]&[/url]append= =3DT%5DX-ThisOrder=3D select=3D"StoreID"/>-[URL]&[/URL][LISTW= ORDS > words=3D[INCLUDE file=3D^XML/XML-Fields-OE.inc]&delimiters=3D,]X-[WORD][S= howIf > [INCLUDE file=3D^XML/duplicate-field-names.inc]^|[WORD]|]-LINEITEM[/ShowI= f]=3D select=3D"[URL][WORD][/URL]"/>[URL]&[/URL][/LISTWORDS]%5B/REPLACE%5D > > [!]CLOSES O[/!] > > > > > > > > > > > On 28/05/2012, at 12:22 PM, David Bastedo wrote: > > Hmm. i am stuck again it seems, I can get the data via xlst, but writing > it to a db seems really awkward, i think I need to look at another > solution. So how do you use middle to get the value to actually show up? > > d. > > > On Sun, May 27, 2012 at 7:23 PM, Stuart Tremain wrote= : > >> I use MIDDLE to get past the [CDATA >> >> >> On 27/05/2012, at 1:35 AM, 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 o= nes >> 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 206405518= 925905920 1338045885 803 Hesperia_WX 25 unknown <= profileimageurl> US United States Of Americ= a 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 >> >> >> >> --------------------------------------------------------- This message i= s >> sent to you because you are subscribed to the mailing list **. To >> unsubscribe, E-mail to: ** archives: >> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: >> support@webdna.us**** >> >> >> --------------------------------------------------------- This message i= s >> sent to you because you are subscribed to the mailing list **. To >> unsubscribe, E-mail to: ** archives: >> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: >> support@webdna.us > > > > > -- > > > -- > David Bastedo > Ten Plus One Communications Inc. > http://www.10plus1.com > 416.277.4499 > My Profiles [image: LinkedIn] [i= mage: > Delicious] [image: Twitter] [image: > Google] > Find me on [image: Google Talk] davidbmbastedo@gmail.com > My Latest Shared Link is: QR code stickers turn real-world objects into > digital conversations | Springwise > > --------------------------------------------------------- This message is > sent to you because you are subscribed to the mailing list **. To > unsubscribe, E-mail to: ** archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.u= s > **** > > > --------------------------------------------------------- This message is > sent to you because you are subscribed to the mailing list **. To > unsubscribe, E-mail to: ** archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.u= s > --=20 --=20 David Bastedo Ten Plus One Communications Inc. http://www.10plus1.com 416.277.4499 My Profiles [image: LinkedIn] [ima= ge: Delicious] [image: Twitter] [image: Google] Find me on [image: Google Talk] davidbmbastedo@gmail.com My Latest Shared Link is: QR code stickers turn real-world objects into digital conversations | Springwise --f46d043c81bcb6a74404c1106374 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable ok, thanks! I think it is the interpret that is messing me up. i'll = have another go.

d.

On Sun, May 27, 2012 at 10:36 PM, = Stuart Tremain <webdna@idfk.com.au> wrote:
[!] --------------=A0 WRITE RESULT TO FILE -------------- = [/!]
[WRITEFILE file=3Dinclud= e/hosom/RESULTDATA/NEWDATA-[DATE %Y%m%d]-[TIME %H%M].xml][RESULTDATA][/WRIT= EFILE]


[!] ----------= ----=A0 Get Ready to append XML data to a database. -------------- [/!]
[xsl var=3Dxsl_ORDER1][I= NCLUDE file=3D^XML/XML-order-stylesheet.inc][/XSL]
[text]RESULT=3D[unurl][xslt xslref=3Dxsl_ORDER1][RESULTDATA][/xslt][/unurl]= [/text]

<= /div>

[!] --------------=A0 In= terpret [RESULT] to 'parse' WebDNA code and do the APPEND.=A0 -----= --------- [/!]
[interpret][RESULT][/int= erpret]


Here is the style sheet, the trick is to write your WebDNA with URL'd b= rackets ie =A0%5B/REPLACE%5D instead of [/REPLACE] and check the way that &= amp; is URL'd.=A0The reason that this is done is that if you use [ or ]= it will interpret the WebDNA before you really want to use it, hence the= =A0[interpret][RESULT][/interpret]

Sorry, you will have to read around the LISTWORDS stuff.


<xsl:stylesheet version=3D"1.0" xmlns= :xsl=3D"http://www.w3.org/1999/XSL/Transform">
<xsl:template match=3D"/">
<xsl:for-each select=3D&q= uot;HOSOMC/C">

%5BREPLACE db=3D^data/HOSOMorders.db[url]&[/url]eqX-AUTOIDdata=3D[url]&= amp;[/url]append=3DT%5D[LISTWORDS words=3D[INCLUDE file=3D^XML/XML-Fields-C= .inc]&delimiters=3D,]X-[WORD][ShowIf [INCLUDE file=3D^XML/duplicate-fie= ld-names.inc]^|[WORD]|]-CUSTOMER[/ShowIf]=3D&= lt;xsl:value-of select=3D"[URL][WORD][/URL]"/>[URL]&= ;[/URL][/LISTWORDS][!]
[/!]<xsl:for-each select=3D"O">[LISTWORDS word= s=3D[INCLUDE file=3D^XML/XML-Fields-O.inc]&delimiters=3D,]X-[WORD][Show= If [INCLUDE file=3D^XML/duplicate-field-names.inc]^|[WORD]|]-ORDER[/ShowIf]= =3D<xsl:value-of select=3D"[If ("= ;[WORD]"^"COMMENT")][Then][URL][URL][WORD][/URL][/URL][/Then= ][Else][URL][WORD][/URL][/Else][/If]"/>[URL]&[/URL][/LIS= TWORDS]X-ThisOrder=3D[TEXT SHOW=3DT]X-ThisOrder=3D<xsl:value-of select=3D"StoreID"/>-<xsl:value-of select=3D"ID"/>[URL= ]&[/URL]X-STOREID-LINEITEM=3D<xsl:valu= e-of select=3D"StoreID"/>[URL]&[/URL]X-ORDERID=3D<xsl:value-of select=3D"ID"/>[URL]&[/URL]X-AUTOID=3DCUSTOMER[/TEXT][!]
[/!]</xsl:for-each>[!]CLOSES O[/!]%5B/REPLACE%5D

<xsl:for-each select=3D"O"><xsl:for-each= select=3D"OE">%5BREPLACE db=3D^data/HOSOMorders.db[url= ]&[/url]eqX-AUTOIDdata=3D[url]&[/url]append=3DT%5DX-ThisOrder=3D<xsl:value-of select=3D"StoreID"/&g= t;-<xsl:value-of select=3D"Ord= erID"/>[URL]&[/URL][LISTWORDS words=3D[INCLUDE file=3D^X= ML/XML-Fields-OE.inc]&delimiters=3D,]X-[WORD][ShowIf [INCLUDE file=3D^X= ML/duplicate-field-names.inc]^|[WORD]|]-LINEITEM[/ShowIf]=3D<xsl:value-of select=3D"[URL][WORD][/URL]"/>= [URL]&[/URL][/LISTWORDS]%5B/REPLACE%5D

</xsl:for-each></xsl:for-each= >[!]CLOSES O[/!]

</xsl:for-each>
</xsl:template>
</xsl:stylesheet>





=
On 28/05/2012, at 12:22 PM, David Bastedo wrote:

Hmm. i am stuck again it seems, I can get the data v= ia xlst, but writing it to a db seems really awkward, i think I need to loo= k at another solution. So how do you use middle to get the value to actuall= y show up?

d.


On Sun, May 27, 2012 at 7:23 PM, Stuart = Tremain <webdna@idfk.com.au> wrote:
I use MIDDLE to get past the [CDATA

On 27/05/2012, at 1:35 AM, David Ba= stedo wrote:

Hi, has anybody run into the following xml parsing issue?

The n= ode: =A0 <text><![CDATA[RT @BoyTopi: I want to feel snow! Not the = fake ones at Snow City.]]></text>
=A0
I can see the content = I want in an xml file. in the CDATA abvoe - being the content of a tweet &q= uot;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 ge= t a node attribute of "text" then I get a return name value of &q= uot;#cdata-section" and no "value"

How do I get to th= e CDATA information in the following example.

Any ideas? Is there something I am missing?

thanks.

d.
sample: xml
<tweets>  <tweet>    <klass>tweets=_locarea</klass>    <tweetid>2064=05518925905920</tweetid>    <date>1338045=885</date>    <text>=<!--[CDATA[HA: Fair and Breezy and 50 F at Southern California Log=isitics Airport, CA Winds are from the West at 20.7 gusting to 2 http://t.co/KqLrqbuk]]--></text>    <sentiment>    <dma>803</dma>    <tweeter>      <screenname>Hesperia_WX</screenname>      <influence>=25</influence>      <gender>unk=nown</gender>      <profileimageurl>=<!--[CDATA[http=://a0.twimg.com/profile_images/383407737/Official_SWAS_logo_normal.jpg]]--<=/a>></profileimageurl>    </tweeter>    <location>      <countrycode>US</countrycode>      <country>Un=ited States Of America</country>      <type>1</type>      <id>USCA048=1</id>      <state>CA</state>      <name>Hespe=ria</name>    </location>  </sentiment></tweet>  <tweet><=/pre>
sample parse

--tweet:=20
=20 ---klass: tweets_locarea
=20 =20 =20 =20 ---tweetId: 206405503587328000
=20 =20 =20 =20 ---date: 1338045881
=20 =20 =20 =20 ---text:
=20 =20 =20 =20 ----#cdata-section: ------------------> the offending line
=20 =20 =20 ---sentiment:
=20 =20 =20 =20 ---dma: 803
=20 =20 =20 =20 ---tweeter:=20
=20 =20 =20 =20 ----screenName: HeyAbbie_
=20 =20 =20 ----influence: 27
=20 =20 =20 ----gender: female
=20 =20 =20 ----profileImageURL:
=20 =20 =20 -----#cdata-section: ------------------> the offending line
=20 =20 ---location:=20
=20 =20 =20 =20 ----countryCode: US
=20 =20 =20 ----country: United States Of America
=20 =20 =20 ----type: 1
=20 =20 =20 ----id: USCA0638
=20 =20 =20 ----state: CA
=20 =20 =20 ----name: Los Angeles

=A0

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: suppo= rt@webdna.us

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: suppo= rt@webdna.us



--

--
David Bastedo
Ten Plus One = Communications Inc.
http://www.10plus1.com
416.2= 77.4499
My Profiles 3D"LinkedIn" 3D"Delicious" <= a href=3D"http://www.twitter.com/bertmount" style=3D"text-decoration:underl= ine" target=3D"_blank">3D"Twitter"<= /a> 3D"Google"
Find me on 3D"Google davidbmbastedo@gmail.com

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: suppo= rt@webdna.us

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: suppo= rt@webdna.us



--=


--
David Bastedo<= br>Ten Plus One Communications Inc.
http://www.10plus1.com
416.277.4499

My Profiles 3D"LinkedIn" 3D"Delicio=us"= 3D"Twitter" 3D"Google"
Find me on 3D"Google davidbmbastedo@gmail.com<= /a>
My Latest Shared Link is: QR code stickers turn real-world objects= into digital conversations | Springwise

--f46d043c81bcb6a74404c1106374-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] XML parsing issue with cdata (David Bastedo 2012)
  2. Re: [WebDNA] XML parsing issue with cdata (David Bastedo 2012)
  3. Re: [WebDNA] XML parsing issue with cdata (Stuart Tremain 2012)
  4. Re: [WebDNA] XML parsing issue with cdata (David Bastedo 2012)
  5. Re: [WebDNA] XML parsing issue with cdata (Stuart Tremain 2012)
  6. Re: [WebDNA] XML parsing issue with cdata (Stuart Tremain 2012)
  7. Re: [WebDNA] XML parsing issue with cdata (David Bastedo 2012)
  8. Re: [WebDNA] XML parsing issue with cdata (David Bastedo 2012)
  9. Re: [WebDNA] XML parsing issue with cdata (David Bastedo 2012)
  10. Re: [WebDNA] XML parsing issue with cdata (Donovan Brooke 2012)
  11. Re: [WebDNA] XML parsing issue with cdata (D Brooke 2012)
  12. [WebDNA] XML parsing issue with cdata (David Bastedo 2012)
--f46d043c81bcb6a74404c1106374 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable ok, thanks! I think it is the interpret that is messing me up. i'll have another go. d. On Sun, May 27, 2012 at 10:36 PM, Stuart Tremain wrote= : > [!] -------------- WRITE RESULT TO FILE -------------- [/!] > [WRITEFILE file=3Dinclude/hosom/RESULTDATA/NEWDATA-[DATE %Y%m%d]-[TIME > %H%M].xml][RESULTDATA][/WRITEFILE] > > > [!] -------------- Get Ready to append XML data to a database. > -------------- [/!] > [xsl var=3Dxsl_ORDER1][INCLUDE file=3D^XML/XML-order-stylesheet.inc][/XSL= ] > [text]RESULT=3D[unurl][xslt > xslref=3Dxsl_ORDER1][RESULTDATA][/xslt][/unurl][/text] > > > [!] -------------- Interpret [RESULT] to 'parse' WebDNA code and do the > APPEND. -------------- [/!] > [interpret][RESULT][/interpret] > > > Here is the style sheet, the trick is to write your WebDNA with URL'd > brackets ie %5B/REPLACE%5D instead of [/REPLACE] and check the way that = & > is URL'd. The reason that this is done is that if you use [ or ] it will > interpret the WebDNA before you really want to use it, hence > the [interpret][RESULT][/interpret] > > Sorry, you will have to read around the LISTWORDS stuff. > > > http://www.w3.org/1999/XSL/Transform"> > > > > %5BREPLACE > db=3D^data/HOSOMorders.db[url]&[/url]eqX-AUTOIDdata=3D[url]&[/url]append= =3DT%5D[LISTWORDS > words=3D[INCLUDE file=3D^XML/XML-Fields-C.inc]&delimiters=3D,]X-[WORD][Sh= owIf > [INCLUDE file=3D^XML/duplicate-field-names.inc]^|[WORD]|]-CUSTOMER[/ShowI= f]=3D select=3D"[url][WORD][/URL]"/>[url]&[/URL][/LISTWORDS][!] > [/!][LISTWORDS words=3D[INCLUDE > file=3D^XML/XML-Fields-O.inc]&delimiters=3D,]X-[WORD][ShowIf [INCLUDE > file=3D^XML/duplicate-field-names.inc]^|[WORD]|]-ORDER[/ShowIf]=3D select=3D"[If > ("[WORD]"^"COMMENT")][Then][url][url][WORD][/URL][/URL][/Then][Else][url]= [WORD][/URL][/Else][/If]"/>[url]&[/URL][/LISTWORDS]X-ThisOrder=3D[TEXT > SHOW=3DT]X-ThisOrder=3D- select=3D"ID"/>[url]&[/URL]X-STOREID-LINEITEM=3D select=3D"StoreID"/>[url]&[/URL]X-ORDERID=3D > [url]&[/URL]X-AUTOID=3DCUSTOMER[/TEXT][!] > [/!][!]CLOSES O[/!]%5B/REPLACE%5D > > %5BREPLACE > db=3D^data/HOSOMorders.db[url]&[/url]eqX-AUTOIDdata=3D[url]&[/url]append= =3DT%5DX-ThisOrder=3D select=3D"StoreID"/>-[url]&[/URL][LISTW= ORDS > words=3D[INCLUDE file=3D^XML/XML-Fields-OE.inc]&delimiters=3D,]X-[WORD][S= howIf > [INCLUDE file=3D^XML/duplicate-field-names.inc]^|[WORD]|]-LINEITEM[/ShowI= f]=3D select=3D"[url][WORD][/URL]"/>[url]&[/URL][/LISTWORDS]%5B/REPLACE%5D > > [!]CLOSES O[/!] > > > > > > > > > > > On 28/05/2012, at 12:22 PM, David Bastedo wrote: > > Hmm. i am stuck again it seems, I can get the data via xlst, but writing > it to a db seems really awkward, i think I need to look at another > solution. So how do you use middle to get the value to actually show up? > > d. > > > On Sun, May 27, 2012 at 7:23 PM, Stuart Tremain wrote= : > >> I use MIDDLE to get past the [CDATA >> >> >> On 27/05/2012, at 1:35 AM, 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 o= nes >> 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 206405518= 925905920 1338045885 803 Hesperia_WX 25 unknown <= profileimageurl> US United States Of Americ= a 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 >> >> >> >> --------------------------------------------------------- This message i= s >> sent to you because you are subscribed to the mailing list **. To >> unsubscribe, E-mail to: ** archives: >> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: >> support@webdna.us**** >> >> >> --------------------------------------------------------- This message i= s >> sent to you because you are subscribed to the mailing list **. To >> unsubscribe, E-mail to: ** archives: >> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: >> support@webdna.us > > > > > -- > > > -- > David Bastedo > Ten Plus One Communications Inc. > http://www.10plus1.com > 416.277.4499 > My Profiles [image: LinkedIn] [i= mage: > Delicious] [image: Twitter] [image: > Google] > Find me on [image: Google Talk] davidbmbastedo@gmail.com > My Latest Shared Link is: QR code stickers turn real-world objects into > digital conversations | Springwise > > --------------------------------------------------------- This message is > sent to you because you are subscribed to the mailing list **. To > unsubscribe, E-mail to: ** archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.u= s > **** > > > --------------------------------------------------------- This message is > sent to you because you are subscribed to the mailing list **. To > unsubscribe, E-mail to: ** archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.u= s > --=20 --=20 David Bastedo Ten Plus One Communications Inc. http://www.10plus1.com 416.277.4499 My Profiles [image: LinkedIn] [ima= ge: Delicious] [image: Twitter] [image: Google] Find me on [image: Google Talk] davidbmbastedo@gmail.com My Latest Shared Link is: QR code stickers turn real-world objects into digital conversations | Springwise --f46d043c81bcb6a74404c1106374 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable ok, thanks! I think it is the interpret that is messing me up. i'll = have another go.

d.

On Sun, May 27, 2012 at 10:36 PM, = Stuart Tremain <webdna@idfk.com.au> wrote:
[!] --------------=A0 WRITE RESULT TO FILE -------------- = [/!]
[WRITEFILE file=3Dinclud= e/hosom/RESULTDATA/NEWDATA-[DATE %Y%m%d]-[TIME %H%M].xml][RESULTDATA][/WRIT= EFILE]


[!] ----------= ----=A0 Get Ready to append XML data to a database. -------------- [/!]
[xsl var=3Dxsl_ORDER1][I= NCLUDE file=3D^XML/XML-order-stylesheet.inc][/XSL]
[text]RESULT=3D[unurl][xslt xslref=3Dxsl_ORDER1][RESULTDATA][/xslt][/unurl]= [/text]

<= /div>

[!] --------------=A0 In= terpret [RESULT] to 'parse' WebDNA code and do the APPEND.=A0 -----= --------- [/!]
[interpret][RESULT][/int= erpret]


Here is the style sheet, the trick is to write your WebDNA with URL'd b= rackets ie =A0%5B/REPLACE%5D instead of [/REPLACE] and check the way that &= amp; is URL'd.=A0The reason that this is done is that if you use [ or ]= it will interpret the WebDNA before you really want to use it, hence the= =A0[interpret][RESULT][/interpret]

Sorry, you will have to read around the LISTWORDS stuff.


<xsl:stylesheet version=3D"1.0" xmlns= :xsl=3D"http://www.w3.org/1999/XSL/Transform">
<xsl:template match=3D"/">
<xsl:for-each select=3D&q= uot;HOSOMC/C">

%5BREPLACE db=3D^data/HOSOMorders.db[url]&[/url]eqX-AUTOIDdata=3D[url]&= amp;[/url]append=3DT%5D[LISTWORDS words=3D[INCLUDE file=3D^XML/XML-Fields-C= .inc]&delimiters=3D,]X-[WORD][ShowIf [INCLUDE file=3D^XML/duplicate-fie= ld-names.inc]^|[WORD]|]-CUSTOMER[/ShowIf]=3D&= lt;xsl:value-of select=3D"[url][WORD][/URL]"/>[url]&= ;[/URL][/LISTWORDS][!]
[/!]<xsl:for-each select=3D"O">[LISTWORDS word= s=3D[INCLUDE file=3D^XML/XML-Fields-O.inc]&delimiters=3D,]X-[WORD][Show= If [INCLUDE file=3D^XML/duplicate-field-names.inc]^|[WORD]|]-ORDER[/ShowIf]= =3D<xsl:value-of select=3D"[If ("= ;[WORD]"^"COMMENT")][Then][url][url][WORD][/URL][/URL][/Then= ][Else][url][WORD][/URL][/Else][/If]"/>[url]&[/URL][/LIS= TWORDS]X-ThisOrder=3D[TEXT SHOW=3DT]X-ThisOrder=3D<xsl:value-of select=3D"StoreID"/>-<xsl:value-of select=3D"ID"/>[URL= ]&[/URL]X-STOREID-LINEITEM=3D<xsl:valu= e-of select=3D"StoreID"/>[url]&[/URL]X-ORDERID=3D<xsl:value-of select=3D"ID"/>[url]&[/URL]X-AUTOID=3DCUSTOMER[/TEXT][!]
[/!]</xsl:for-each>[!]CLOSES O[/!]%5B/REPLACE%5D

<xsl:for-each select=3D"O"><xsl:for-each= select=3D"OE">%5BREPLACE db=3D^data/HOSOMorders.db[url= ]&[/url]eqX-AUTOIDdata=3D[url]&[/url]append=3DT%5DX-ThisOrder=3D<xsl:value-of select=3D"StoreID"/&g= t;-<xsl:value-of select=3D"Ord= erID"/>[url]&[/URL][LISTWORDS words=3D[INCLUDE file=3D^X= ML/XML-Fields-OE.inc]&delimiters=3D,]X-[WORD][ShowIf [INCLUDE file=3D^X= ML/duplicate-field-names.inc]^|[WORD]|]-LINEITEM[/ShowIf]=3D<xsl:value-of select=3D"[url][WORD][/URL]"/>= [url]&[/URL][/LISTWORDS]%5B/REPLACE%5D

</xsl:for-each></xsl:for-each= >[!]CLOSES O[/!]

</xsl:for-each>
</xsl:template>
</xsl:stylesheet>





=
On 28/05/2012, at 12:22 PM, David Bastedo wrote:

Hmm. i am stuck again it seems, I can get the data v= ia xlst, but writing it to a db seems really awkward, i think I need to loo= k at another solution. So how do you use middle to get the value to actuall= y show up?

d.


On Sun, May 27, 2012 at 7:23 PM, Stuart = Tremain <webdna@idfk.com.au> wrote:
I use MIDDLE to get past the [CDATA

On 27/05/2012, at 1:35 AM, David Ba= stedo wrote:

Hi, has anybody run into the following xml parsing issue?

The n= ode: =A0 <text><![CDATA[RT @BoyTopi: I want to feel snow! Not the = fake ones at Snow City.]]></text>
=A0
I can see the content = I want in an xml file. in the CDATA abvoe - being the content of a tweet &q= uot;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 ge= t a node attribute of "text" then I get a return name value of &q= uot;#cdata-section" and no "value"

How do I get to th= e CDATA information in the following example.

Any ideas? Is there something I am missing?

thanks.

d.
sample: xml
<tweets>  <tweet>    <klass>tweets=_locarea</klass>    <tweetid>2064=05518925905920</tweetid>    <date>1338045=885</date>    <text>=<!--[CDATA[HA: Fair and Breezy and 50 F at Southern California Log=isitics Airport, CA Winds are from the West at 20.7 gusting to 2 http://t.co/KqLrqbuk]]--></text>    <sentiment>    <dma>803</dma>    <tweeter>      <screenname>Hesperia_WX</screenname>      <influence>=25</influence>      <gender>unk=nown</gender>      <profileimageurl>=<!--[CDATA[http=://a0.twimg.com/profile_images/383407737/Official_SWAS_logo_normal.jpg]]--<=/a>></profileimageurl>    </tweeter>    <location>      <countrycode>US</countrycode>      <country>Un=ited States Of America</country>      <type>1</type>      <id>USCA048=1</id>      <state>CA</state>      <name>Hespe=ria</name>    </location>  </sentiment></tweet>  <tweet><=/pre>
sample parse

--tweet:=20
=20 ---klass: tweets_locarea
=20 =20 =20 =20 ---tweetId: 206405503587328000
=20 =20 =20 =20 ---date: 1338045881
=20 =20 =20 =20 ---text:
=20 =20 =20 =20 ----#cdata-section: ------------------> the offending line
=20 =20 =20 ---sentiment:
=20 =20 =20 =20 ---dma: 803
=20 =20 =20 =20 ---tweeter:=20
=20 =20 =20 =20 ----screenName: HeyAbbie_
=20 =20 =20 ----influence: 27
=20 =20 =20 ----gender: female
=20 =20 =20 ----profileImageURL:
=20 =20 =20 -----#cdata-section: ------------------> the offending line
=20 =20 ---location:=20
=20 =20 =20 =20 ----countryCode: US
=20 =20 =20 ----country: United States Of America
=20 =20 =20 ----type: 1
=20 =20 =20 ----id: USCA0638
=20 =20 =20 ----state: CA
=20 =20 =20 ----name: Los Angeles

=A0

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: suppo= rt@webdna.us

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: suppo= rt@webdna.us



--

--
David Bastedo
Ten Plus One = Communications Inc.
http://www.10plus1.com
416.2= 77.4499
My Profiles 3D"LinkedIn" 3D"Delicious" <= a href=3D"http://www.twitter.com/bertmount" style=3D"text-decoration:underl= ine" target=3D"_blank">3D"Twitter"<= /a> 3D"Google"
Find me on 3D"Google davidbmbastedo@gmail.com

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: suppo= rt@webdna.us
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: suppo= rt@webdna.us



--=



--f46d043c81bcb6a74404c1106374-- David Bastedo

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Part Html part WebDNA (1997) [Webcat 2]Next (1997) WebCat2 Append problem (B14Macacgi) (1997) WebTen and WebCat (1997) Further on formula.db failure to calculate shipCost (1997) Pithy questions on webcommerce & siteedit (1997) encrypted query string trouble on OSX (2001) RAM variables (1997) How to append text after the sign & (1997) [movefile] (1999) WebCat2b13MacPlugIn - [include] (1997) [Sum] function? (1997) SendTo more emails (1998) Items XX to XX shown (1997) Reversed words (1997) Bug? (1997) can WC render sites out? (1997) Talk List Suggestions (1997) [OT] Mac OSX hardware test software (2004) Searching for Nothing (1998)