Hi,
i have an xsl and xml,i need to replace the tag position from one location to another .
xsl:
[code=xml]
<?xml version="1.0"?>
<xsl:styleshe et xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="richtext ">
<html>
<body>
<table align="center">
<tr>
<td width="800">
<xsl:for-each select="par[@def='2']">
<xsl:copy-of select="./node()" />
<br />
</xsl:for-each>
<xsl:for-each select="par[@def='3']">
<xsl:copy-of select="./node()" />
<br />
</xsl:for-each>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
[/code]
xml:
[code=xml]
<richtext xmlns:sgx="http ://www.lotus.com/dxl">
<pardef id="2"/>
<par def="2">
<run>
CapitaLand Limited’s subsidiary</run>
</par>
<pardef id="3"/>
<par def="3">
<run>
</run>
</par>
<par def="3">
<run>
For details, please refer to the announcement and news release posted by CMTML on the SGX website </run>
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" /> www.sgx.com.sg</run>
</par>
<pardef id="4"/>
<par def="4">
<run>
Fashion plus
</run>
</par>
<par def="4" />
<par def="2">
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" />some text</run>
</par>
<par def="2">
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" />some text one</run>
</par>
<par def="2">
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" />some text two
</par>
<par def="3">
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" /> some text three</run>
</par>
</richtext>
[/code]
after transformation my html view is:
[code=xml]
<richtext xmlns:sgx="http ://www.lotus.com/dxl">
<pardef id="2"/>
<par def="2">
<run>
CapitaLand Limited’s subsidiary</run>
</par>
<pardef id="3"/>
<par def="3">
<run>
</run>
</par>
<par def="3">
<run>
For details, please refer to the announcement and news release posted by CMTML on the SGX website </run>
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" /> www.sgx.com.sg</run>
</par>
<pardef id="4"/>
<par def="4">
<run>
Fashion plus
</run>
</par>
<par def="4" />
<par def="2">
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" />some text</run>
</par>
<par def="2">
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" />some text one</run>
</par>
<par def="2">
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" />some text two
</par>
<par def="3">
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" /> some text three</run>
</par>
</richtext>
[/code]
i require help in how to replace the ending font tag before the ending run tag
current :
[code=xml]
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" /> some text three</run>
[/code]
required:
[code=xml]
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20"> some text three </font> </run>
[/code]
Regards
RAJ
i have an xsl and xml,i need to replace the tag position from one location to another .
xsl:
[code=xml]
<?xml version="1.0"?>
<xsl:styleshe et xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="richtext ">
<html>
<body>
<table align="center">
<tr>
<td width="800">
<xsl:for-each select="par[@def='2']">
<xsl:copy-of select="./node()" />
<br />
</xsl:for-each>
<xsl:for-each select="par[@def='3']">
<xsl:copy-of select="./node()" />
<br />
</xsl:for-each>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
[/code]
xml:
[code=xml]
<richtext xmlns:sgx="http ://www.lotus.com/dxl">
<pardef id="2"/>
<par def="2">
<run>
CapitaLand Limited’s subsidiary</run>
</par>
<pardef id="3"/>
<par def="3">
<run>
</run>
</par>
<par def="3">
<run>
For details, please refer to the announcement and news release posted by CMTML on the SGX website </run>
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" /> www.sgx.com.sg</run>
</par>
<pardef id="4"/>
<par def="4">
<run>
Fashion plus
</run>
</par>
<par def="4" />
<par def="2">
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" />some text</run>
</par>
<par def="2">
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" />some text one</run>
</par>
<par def="2">
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" />some text two
</par>
<par def="3">
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" /> some text three</run>
</par>
</richtext>
[/code]
after transformation my html view is:
[code=xml]
<richtext xmlns:sgx="http ://www.lotus.com/dxl">
<pardef id="2"/>
<par def="2">
<run>
CapitaLand Limited’s subsidiary</run>
</par>
<pardef id="3"/>
<par def="3">
<run>
</run>
</par>
<par def="3">
<run>
For details, please refer to the announcement and news release posted by CMTML on the SGX website </run>
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" /> www.sgx.com.sg</run>
</par>
<pardef id="4"/>
<par def="4">
<run>
Fashion plus
</run>
</par>
<par def="4" />
<par def="2">
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" />some text</run>
</par>
<par def="2">
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" />some text one</run>
</par>
<par def="2">
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" />some text two
</par>
<par def="3">
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" /> some text three</run>
</par>
</richtext>
[/code]
i require help in how to replace the ending font tag before the ending run tag
current :
[code=xml]
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20" /> some text three</run>
[/code]
required:
[code=xml]
<run>
<font size="11pt" name="Arial" pitch="variable " truetype="true" familyid="20"> some text three </font> </run>
[/code]
Regards
RAJ
Comment