I
iliad
hi,
i've the following questions:
1. why does..
<xsl:template match='dxl:text'>
<xsl:apply-templates/>
</xsl:template>
... results in "testing<BR>123"? why does it writes this? shouldn't i
use a 'value-of' to create some output?
2. i can transform this xml piece..
<richtext>
<pardef id='3'/>
<par def='3'>
jdi
<run>
<font style='bold'/>
ojd
</run>
g
</par>
</richtext>"
... only in something like this: jdi<B>odj</B>ojdg
How can I create this: jdi<B>odj</B>g
Thanks!!
iliad
----
XML:
<?xml version='1.0'?>
<document xmlns='http://www.lotus.com/dxl' version='6.5'
maintenanceversion='2.0' replicaid='C125707700457741' form='frm201'>
<item name='txt_NavigationTitle'>
<text>testing<break/>123</text>
</item>
<item name='rtf_Body'>
<richtext><pardef id='3'/><par def='3'>jdi<run><font
style='bold'/>ojd</run>g</par></richtext>
</item>
</document>
----
XSL:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:dxl='http://www.lotus.com/dxl'>
<xsl
utput method="html" indent="yes"/>
<xsl:template match="/">
<html>
<body>
<table>
<tr>
<th>Item</th>
<th>Value</th>
</tr>
<xsl:for-each select="
dxl:document/dxl:item[@name='txt_NavigationTitle']|
dxl:document/dxl:item[@name='rtf_Body']">
<tr>
<td>
<xsl:apply-templates/>
</td>
<td>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
<xsl:template match='dxl:text'>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match='dxl:richtext'>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match='dxl:break'>
<BR/>
</xsl:template>
<xsl:template match="dxl:run/dxl:font[@style='bold']">
<B><xsl:value-of select = ".."/></B>
</xsl:template>
</xsl:stylesheet>
----
RESULT:
<html xmlns:dxl="http://www.lotus.com/dxl">
<body>
<table>
<tr>
<th>Item</th><th>Value</th>
</tr>
<tr>
<td>testing<BR>123</td><td></td>
</tr>
<tr>
<td>jdi<B>odj</B>ojdg</td><td></td>
</tr>
</table>
</body>
</html>
i've the following questions:
1. why does..
<xsl:template match='dxl:text'>
<xsl:apply-templates/>
</xsl:template>
... results in "testing<BR>123"? why does it writes this? shouldn't i
use a 'value-of' to create some output?
2. i can transform this xml piece..
<richtext>
<pardef id='3'/>
<par def='3'>
jdi
<run>
<font style='bold'/>
ojd
</run>
g
</par>
</richtext>"
... only in something like this: jdi<B>odj</B>ojdg
How can I create this: jdi<B>odj</B>g
Thanks!!
iliad
----
XML:
<?xml version='1.0'?>
<document xmlns='http://www.lotus.com/dxl' version='6.5'
maintenanceversion='2.0' replicaid='C125707700457741' form='frm201'>
<item name='txt_NavigationTitle'>
<text>testing<break/>123</text>
</item>
<item name='rtf_Body'>
<richtext><pardef id='3'/><par def='3'>jdi<run><font
style='bold'/>ojd</run>g</par></richtext>
</item>
</document>
----
XSL:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:dxl='http://www.lotus.com/dxl'>
<xsl
<xsl:template match="/">
<html>
<body>
<table>
<tr>
<th>Item</th>
<th>Value</th>
</tr>
<xsl:for-each select="
dxl:document/dxl:item[@name='txt_NavigationTitle']|
dxl:document/dxl:item[@name='rtf_Body']">
<tr>
<td>
<xsl:apply-templates/>
</td>
<td>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
<xsl:template match='dxl:text'>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match='dxl:richtext'>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match='dxl:break'>
<BR/>
</xsl:template>
<xsl:template match="dxl:run/dxl:font[@style='bold']">
<B><xsl:value-of select = ".."/></B>
</xsl:template>
</xsl:stylesheet>
----
RESULT:
<html xmlns:dxl="http://www.lotus.com/dxl">
<body>
<table>
<tr>
<th>Item</th><th>Value</th>
</tr>
<tr>
<td>testing<BR>123</td><td></td>
</tr>
<tr>
<td>jdi<B>odj</B>ojdg</td><td></td>
</tr>
</table>
</body>
</html>