Re: [WebDNA] XML parsing issue with cdata

This WebDNA talk-list message is from

2012


It keeps the original formatting.
numero = 109153
interpreted = N
texte = --0016e6d7df6a19e02604c110dfeb Content-Type: text/plain; charset=ISO-8859-1 That did the trick. It's all in the [interpret] - which is where I was messing up. Thanks!! d. On Sun, May 27, 2012 at 10:36 PM, Stuart Tremain wrote: > [!] -------------- WRITE RESULT TO FILE -------------- [/!] > [WRITEFILE file=include/hosom/RESULTDATA/NEWDATA-[DATE %Y%m%d]-[TIME > %H%M].xml][RESULTDATA][/WRITEFILE] > > > [!] -------------- Get Ready to append XML data to a database. > -------------- [/!] > [xsl var=xsl_ORDER1][INCLUDE file=^XML/XML-order-stylesheet.inc][/XSL] > [text]RESULT=[unurl][xslt > xslref=xsl_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. > > > > > > > %5BREPLACE > db=^data/HOSOMorders.db[url]&[/url]eqX-AUTOIDdata=[url]&[/url]append=T%5D[LISTWORDS > words=[INCLUDE file=^XML/XML-Fields-C.inc]&delimiters=,]X-[WORD][ShowIf > [INCLUDE file=^XML/duplicate-field-names.inc]^|[WORD]|]-CUSTOMER[/ShowIf]= select="[URL][WORD][/URL]"/>[URL]&[/URL][/LISTWORDS][!] > [/!][LISTWORDS words=[INCLUDE > file=^XML/XML-Fields-O.inc]&delimiters=,]X-[WORD][ShowIf [INCLUDE > file=^XML/duplicate-field-names.inc]^|[WORD]|]-ORDER[/ShowIf]= select="[If > ("[WORD]"^"COMMENT")][Then][URL][URL][WORD][/URL][/URL][/Then][Else][URL][WORD][/URL][/Else][/If]"/>[URL]&[/URL][/LISTWORDS]X-ThisOrder=[TEXT > SHOW=T]X-ThisOrder=- select="ID"/>[URL]&[/URL]X-STOREID-LINEITEM= select="StoreID"/>[URL]&[/URL]X-ORDERID= > [URL]&[/URL]X-AUTOID=CUSTOMER[/TEXT][!] > [/!][!]CLOSES O[/!]%5B/REPLACE%5D > > %5BREPLACE > db=^data/HOSOMorders.db[url]&[/url]eqX-AUTOIDdata=[url]&[/url]append=T%5DX-ThisOrder= select="StoreID"/>-[URL]&[/URL][LISTWORDS > words=[INCLUDE file=^XML/XML-Fields-OE.inc]&delimiters=,]X-[WORD][ShowIf > [INCLUDE file=^XML/duplicate-field-names.inc]^|[WORD]|]-LINEITEM[/ShowIf]= select="[URL][WORD][/URL]"/>[URL]&[/URL][/LISTWORDS]%5B/REPLACE%5D > > [!]CLOSES O[/!] > > > > > > > > > --0016e6d7df6a19e02604c110dfeb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable That did the trick. It's all in the [interpret] - which is where I was = messing up. Thanks!!

d.



O= n Sun, May 27, 2012 at 10:36 PM, Stuart Tremain <webdna@idfk.com.au&g= t; wrote:
[!] --------------=A0 WRITE RESULT TO FILE -------------- [/!]
[WRITEFILE file=3Dinclude/hosom= /RESULTDATA/NEWDATA-[DATE %Y%m%d]-[TIME %H%M].xml][RESULTDATA][/WRITEFILE]<= /div>


[!] ----------= ----=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>




--0016e6d7df6a19e02604c110dfeb-- 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)
--0016e6d7df6a19e02604c110dfeb Content-Type: text/plain; charset=ISO-8859-1 That did the trick. It's all in the [interpret] - which is where I was messing up. Thanks!! d. On Sun, May 27, 2012 at 10:36 PM, Stuart Tremain wrote: > [!] -------------- WRITE RESULT TO FILE -------------- [/!] > [WRITEFILE file=include/hosom/RESULTDATA/NEWDATA-[DATE %Y%m%d]-[TIME > %H%M].xml][RESULTDATA][/WRITEFILE] > > > [!] -------------- Get Ready to append XML data to a database. > -------------- [/!] > [xsl var=xsl_ORDER1][INCLUDE file=^XML/XML-order-stylesheet.inc][/XSL] > [text]RESULT=[unurl][xslt > xslref=xsl_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. > > > > > > > %5BREPLACE > db=^data/HOSOMorders.db[url]&[/url]eqX-AUTOIDdata=[url]&[/url]append=T%5D[LISTWORDS > words=[INCLUDE file=^XML/XML-Fields-C.inc]&delimiters=,]X-[WORD][ShowIf > [INCLUDE file=^XML/duplicate-field-names.inc]^|[WORD]|]-CUSTOMER[/ShowIf]= select="[url][WORD][/URL]"/>[url]&[/URL][/LISTWORDS][!] > [/!][LISTWORDS words=[INCLUDE > file=^XML/XML-Fields-O.inc]&delimiters=,]X-[WORD][ShowIf [INCLUDE > file=^XML/duplicate-field-names.inc]^|[WORD]|]-ORDER[/ShowIf]= select="[If > ("[WORD]"^"COMMENT")][Then][url][url][WORD][/URL][/URL][/Then][Else][url][WORD][/URL][/Else][/If]"/>[url]&[/URL][/LISTWORDS]X-ThisOrder=[TEXT > SHOW=T]X-ThisOrder=- select="ID"/>[url]&[/URL]X-STOREID-LINEITEM= select="StoreID"/>[url]&[/URL]X-ORDERID= > [url]&[/URL]X-AUTOID=CUSTOMER[/TEXT][!] > [/!][!]CLOSES O[/!]%5B/REPLACE%5D > > %5BREPLACE > db=^data/HOSOMorders.db[url]&[/url]eqX-AUTOIDdata=[url]&[/url]append=T%5DX-ThisOrder= select="StoreID"/>-[url]&[/URL][LISTWORDS > words=[INCLUDE file=^XML/XML-Fields-OE.inc]&delimiters=,]X-[WORD][ShowIf > [INCLUDE file=^XML/duplicate-field-names.inc]^|[WORD]|]-LINEITEM[/ShowIf]= select="[url][WORD][/URL]"/>[url]&[/URL][/LISTWORDS]%5B/REPLACE%5D > > [!]CLOSES O[/!] > > > > > > > > > --0016e6d7df6a19e02604c110dfeb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable That did the trick. It's all in the [interpret] - which is where I was = messing up. Thanks!!

d.



O= n Sun, May 27, 2012 at 10:36 PM, Stuart Tremain <webdna@idfk.com.au&g= t; wrote:
[!] --------------=A0 WRITE RESULT TO FILE -------------- [/!]
[WRITEFILE file=3Dinclude/hosom= /RESULTDATA/NEWDATA-[DATE %Y%m%d]-[TIME %H%M].xml][RESULTDATA][/WRITEFILE]<= /div>


[!] ----------= ----=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>




--0016e6d7df6a19e02604c110dfeb-- 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:

Bug? (1997) WebCat2 - [format thousands] (1997) 2.0 Info (1997) page redirect in webDNA (1997) WebCatalog on G3 Macs? (1997) [shownext] and descending order (1997) [OT] Linux -> Winderz (2005) Date Help (2004) NT version and O'reily's WebSite (1997) Location of Browser Info.txt file (1997) WebCatalog Mac and cgi-bin (WebSTAR 2.0) (1997) Hard Questions ? (1997) Problem with version 4 browsers (1998) Plugin or CGI or both (1997) WebCat2 - [format thousands] (1997) Include a big block of text (1997) Faxing orders in place of email (1997) financial calculation (2000) I need a Smart-quote workaround (1999) Emailer to include Human Name with email Address (2000)