substring-after Not Working in apply-templates
Here should go questions about transforming XML with XSLT and FOP.
substring-after Not Working in apply-templates
Post by Guest »
Hi All,
I am trying this statement:
<xsl:apply-templates select="substring-after(@rdf:about,'#')">
</xsl:apply-templates>
But this gives an error saying:
MyXSLFile.xsl:39: value of expression cannot be converted to a node-set
Can anyone guide me how can I write the result of this substring-after thing into an XML file. Do I have to use any other tag rather than xsl:apply-templates or what?
Btw, I tried using following code:
<xsl:for-each select="@rdf:about">
<xsl:value-of select="substring-after(@about,'#')"/>
</xsl:for-each>
which (atleast) generates the XML file, but the file does not show any substring extracted.
Please Help...
I am trying this statement:
<xsl:apply-templates select="substring-after(@rdf:about,'#')">
</xsl:apply-templates>
But this gives an error saying:
MyXSLFile.xsl:39: value of expression cannot be converted to a node-set
Can anyone guide me how can I write the result of this substring-after thing into an XML file. Do I have to use any other tag rather than xsl:apply-templates or what?
Btw, I tried using following code:
<xsl:for-each select="@rdf:about">
<xsl:value-of select="substring-after(@about,'#')"/>
</xsl:for-each>
which (atleast) generates the XML file, but the file does not show any substring extracted.
Please Help...
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi,
I guess you should start with an XML tutorial like this one for instance:
http://www.zvon.org/xxl/XSLTutorial/Output/index.html
Proabably something like
<xsl:template match="*">
<xsl:if test="@rdf:about">
<xsl:value-of select="substring-after(@rdf:about,'#')"/>
</xsl:if>
<xsl:apply-templates/>
</xsl:template>
will give you some results but I cannot tell that for sure without knowing how your input document looks like.
Best Regards,
George
I guess you should start with an XML tutorial like this one for instance:
http://www.zvon.org/xxl/XSLTutorial/Output/index.html
Proabably something like
<xsl:template match="*">
<xsl:if test="@rdf:about">
<xsl:value-of select="substring-after(@rdf:about,'#')"/>
</xsl:if>
<xsl:apply-templates/>
</xsl:template>
will give you some results but I cannot tell that for sure without knowing how your input document looks like.
Best Regards,
George
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service