Is it possible to create a generic XSLT stylesheet to strip all tags from an XML file such that only #PCDATA text is output and all long lines are nicely formatted up to 80 characters keeping existing words together?
Created May 4, 2012
Pavel Tavoda This is doing a good job for me:
If you need formating then I guess it is better to output HTML. If you really need pure text output then use the JavaScript extension in XSLT and format your text in JavaScript.
<xsl:template match="/"> <xsl:apply-templates/> </xsl:template> <xsl:template match="text()"> MATCH: <xsl:value-of select="."/></xsl:template>
If you need formating then I guess it is better to output HTML. If you really need pure text output then use the JavaScript extension in XSLT and format your text in JavaScript.