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:

Fun with Dates - revisited (1997) encrypt (2000) SQL statements (2002) multi condition with showif (2005) Can you do this??? and other stuff (1997) [WebDNA] CENTOS with WebDNA 8.51 Install Error (2017) Re:Emailer and encryption (1997) [BoldWords] WebCat.acgib15Mac (1997) Counting records (2000) WCS Newbie question (1997) Mime Headers for Mail (1998) [WebDNA] Sorry WebDNA server not running - September 2019 Edition (2019) Re:Change WebDNA-Talk Mail due to no digest for 1wk (1997) Make sure I understand this??? (1997) WebCat2: Formulas.db question (1997) taxTotal confusion (1998) [WriteFile] problems (1997) Sitebuilder (2004) autosensing lanague selection (1997) Generating Report Totals (1997)