For some reason, when you output witango doms to text, it follows a strange output style. The way around this is to use XSLT.

If you want your xml clean indented, try this, if your dom is local$mydom

<@assign local$outstyle '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="ISO-8859-1" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*" />
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>'>

<@assign local$result '<@xslt local$thexml stylesheet="<@var local$outstyle>">'>

Where local$result is your clean outputed xml in text. If you want your outputed xml to be without any added whitespace, change indent="yes" to indent="no"


-- 

Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040

On Apr 11, 2006, at 9:39 AM, John McGowan wrote:

Anybody out there run into problems while outputting a DOM to text using the @VAR tag.  We're seeing it add a lot of extraneous spaces and carriage returns, causing some of our data to be incorrect.  It's especially bad when we use a cdata inside of an element like this.

<element><![CDATA[Some Cdata Text Goes here]]></element>

but what gets outputted is this.


<element>

<![CDATA[Some Cdata Text Goes here]]>
</element>

Which is bad, because when we go to pull out the value of "element" we get some extra spaces at the begining which were never intended to be there.  I thought about trying to use Xpath to narrow down to the first CDATA inside of the "element" but I don't think XPath can tell the difference between plain old text nodes and CDATA, that processing is done before the xslt processor gets a hold of it.

We're using @DOMINSERT and @DOMREPLACE to build the document... on Witango 5.5

/John


________________________________________________________________________


________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to