Why is the comment processing not working?
Added by Anonymous over 14 years ago
Legacy ID: #8410631 Legacy Poster: Paul (kiwi-paul)
I am using Saxon 9.1.0.8 Attempting to process comments within xml fails: They appear to be processed before anything else and are a mix of chopped-up, lost, and duplicated! Running the same files through another processor eg Stylus Studio or nxslt2.exe – all processes as expected. Any help or suggestions... XML File: [code] XSLT File: [code] <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xsl"> <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="no"/> <xsl:template match="product-definition"> xsl:apply-templates/ </xsl:template> <xsl:template match="topic"> <xsl:attribute name="label"> <xsl:value-of select="@title"/> </xsl:attribute> xsl:apply-templates/ </xsl:template> <xsl:template match="include"> <xsl:attribute name="ref"> <xsl:value-of select="@href"/> </xsl:attribute> xsl:apply-templates/ </xsl:template> <xsl:template match="comment()"> xsl:copy/ </xsl:template> </xsl:stylesheet> The Result is: [code] [/code]
Replies (2)
RE: Why is the comment processing not working? - Added by Anonymous over 14 years ago
Legacy ID: #8411023 Legacy Poster: Michael Kay (mhkay)
I can't reproduce this problem - I've tried with various combinations of Saxon version, Java version, and XML parser. Please let me know exactly how you are running the transformation and displaying the result.
RE: Why is the comment processing not working? - Added by Anonymous over 14 years ago
Legacy ID: #8412588 Legacy Poster: Paul (kiwi-paul)
I have since discovered I can run Saxon via the command line. Saxon is not the problem - it would appear to be the environment I am running it in - Thanks for the help.
Please register to reply