Comment processing fails

  • Anonymous - 2010-05-24

    I am using Saxon
    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:

    <product-definition name="Bob" title="Bob for Apples">
        <topic title="A">
            <include href="BOB-NZL-PUB-Y.2009-46"><!--Apples are fun for All -->
            <include href="BOB-NZL-PUB-Y.1978-50"><!--Bananas are big and yellow -->
            <include href="BOB-NZL-PUB-Y.2010-72"><!-- Oranges are kind of Orange -->

    XSLT File:

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="2.0" 
        <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="no"/>
        <xsl:template match="product-definition">
        <xsl:template match="topic">
                <xsl:attribute name="label">
                    <xsl:value-of select="@title"/>
        <xsl:template match="include">
                <xsl:attribute name="ref">
                    <xsl:value-of select="@href"/>
        <xsl:template match="comment()">

    The Result is:

    <?xml version="1.0" encoding="UTF-8"?><!-- Oranges are kind of Or--><!-- Oranges are kind of Orange--><!-- Oranges are kind of Orange --><product-definition>
        <node label="A">
            <content ref="BOB-NZL-PUB-Y.2009-46">
            <content ref="BOB-NZL-PUB-Y.1978-50">
            <content ref="BOB-NZL-PUB-Y.2010-72">
  • Michael Kay

    Michael Kay - 2010-05-24

    This is a duplicate posting, it is answered on the other thread.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks