Hi,
i have the following xml, which is the result of runnig xslt:
<?xml version="1.0" encoding="UTF-8"?>
<toc xmlns:fn="http://www.w3.org/2004/07/xpath-functions" label="Sample Table of Contents">
<topic label="Title1" href="Ref1#ref1">
<topic label="Title 2" href="Ref2#ref2">
<topic label="Title3" href="Ref3#ref3"/>
<topic label="Title4" href="Ref4#ref4"/>
</topic>
<topic label="Title5" href="Ref5#ref5"/>
</topic>
<topic label="Title6" href="Ref6#ref6"/>
</toc>
and the following XSLT that produces this xml:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="D:\Documents and Settings\oshecht\Desktop\XSL\Copy of toc.xml"?>
<?altova_samplexml D:\Documents and Settings\oshecht\Desktop\XSL\Copy of toc.xml?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2004/07/xpath-functions">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="BODY">
<toc label="Sample Table of Contents">
<xsl:apply-templates select="UL/LI/OBJECT"/>
</toc>
</xsl:template>
<xsl:template match="OBJECT">
<topic label="{param[@name='Name']/@value}" href="{param[@name='Local']/@value}">
<xsl:apply-templates select="following-sibling::UL/LI/OBJECT"/>
</topic>
</xsl:template>
</xsl:stylesheet>
i want that in the output xml i will have in :
the follwing:
- the same line but instead of href="Ref1#ref1" to have:
href="Ref1" - eliminate everything after "#"
i know about the function substring-before(Ref1#ref1,'#') but how can i activate it from my XSLT?
can you please advise?