D
dbahooker
Team;
I'm kindof a newbie around these parts
I'm trying to replace TAB characters ( ) with </TD><TD>.. so that I
can properly align this XML into multiple cells in a table.
yes-- right now it is living as XML, tab delimited data.. and I want to
push it into 5 different cells.
here is the result: it's displaying this in IE instead of under view
source:
0.1</td><td>29-Sep-2004</td><td>Draft</td><td>Dba
Hooker</td><td>Initial Draft0
under view / source; it's displaying a similiar thing but it shows up
as HTML tags; instead of as HTML source.
thanks SO much for your help guys!!
here is my template call
--------------------------------------------------------------------
<xsl:template match="Property[@name='CHistory']">
<xsl:call-template name="replace-string">
<xsl:with-param name="text"><xsl:copy-of select="."
/></xsl:with-param>
<xsl:with-param name="from"> </xsl:with-param>
<xsl:with-param name="to"></td><td></xsl:with-param>
</xsl:call-template>
</xsl:template>
here is a replace-string function I've found
----------------------------------------------------------------------
<xsl:template name="replace-string">
<xslaram name="text"/>
<xslaram name="from"/>
<xslaram name="to"/>
<xsl:choose>
<xsl:when test="contains($text, $from)">
<xsl:variable name="before" select="substring-before($text, $from)"/>
<xsl:variable name="after" select="substring-after($text, $from)"/>
<xsl:variable name="prefix" select="concat($before, $to)"/>
<xsl:value-of select="$before"/>
<xsl:value-of select="$to"/>
<xsl:call-template name="replace-string">
<xsl:with-param name="text" select="$after"/>
<xsl:with-param name="from" select="$from"/>
<xsl:with-param name="to" select="$to"/>
</xsl:call-template>
</xsl:when>
<xsltherwise>
<xsl:value-of select="$text"/>
</xsltherwise>
</xsl:choose>
</xsl:template>
I'm kindof a newbie around these parts
I'm trying to replace TAB characters ( ) with </TD><TD>.. so that I
can properly align this XML into multiple cells in a table.
yes-- right now it is living as XML, tab delimited data.. and I want to
push it into 5 different cells.
here is the result: it's displaying this in IE instead of under view
source:
0.1</td><td>29-Sep-2004</td><td>Draft</td><td>Dba
Hooker</td><td>Initial Draft0
under view / source; it's displaying a similiar thing but it shows up
as HTML tags; instead of as HTML source.
thanks SO much for your help guys!!
here is my template call
--------------------------------------------------------------------
<xsl:template match="Property[@name='CHistory']">
<xsl:call-template name="replace-string">
<xsl:with-param name="text"><xsl:copy-of select="."
/></xsl:with-param>
<xsl:with-param name="from"> </xsl:with-param>
<xsl:with-param name="to"></td><td></xsl:with-param>
</xsl:call-template>
</xsl:template>
here is a replace-string function I've found
----------------------------------------------------------------------
<xsl:template name="replace-string">
<xslaram name="text"/>
<xslaram name="from"/>
<xslaram name="to"/>
<xsl:choose>
<xsl:when test="contains($text, $from)">
<xsl:variable name="before" select="substring-before($text, $from)"/>
<xsl:variable name="after" select="substring-after($text, $from)"/>
<xsl:variable name="prefix" select="concat($before, $to)"/>
<xsl:value-of select="$before"/>
<xsl:value-of select="$to"/>
<xsl:call-template name="replace-string">
<xsl:with-param name="text" select="$after"/>
<xsl:with-param name="from" select="$from"/>
<xsl:with-param name="to" select="$to"/>
</xsl:call-template>
</xsl:when>
<xsltherwise>
<xsl:value-of select="$text"/>
</xsltherwise>
</xsl:choose>
</xsl:template>