[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: how XSL processor treat doctype declaration in sou

Subject: RE: how XSL processor treat doctype declaration in source
From: Scott.Hayman@xxxxxxxxxxx
Date: Wed, 11 Apr 2001 14:47:20 -0400
scott hayman
> If this is so, then why is it that I get weird results if I
   > include the doctype declaration in my source file?

   The XSLT processor won't even *see* the doctype decl, that's handled
   entirely in the XML parser. I think you need to give us a concrete
   example
   of what you're doing: tell us what products you are using and how you
   are
   invoking them. (Preferably, see if several products give you the same
   effect)

I've got a concrete example of this behavior and at a complete loss as to
why the results differ.  I've tried running the transformation with both
saxon (instant-saxon 6.0.2) and Xalan (v1 and v2), all with the same
effect.

The XML I am using is:

   <?xml version="1.0" ?>

   <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN"
      "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd">

   <svg width="120" height="130">

       <polygon style="fill:limegreen" points="92,110 112,80 112,110" />

   </svg>

The XSL is:

   <?xml version="1.0" ?>
   <xsl:stylesheet
           version="1.0"
           xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

      <xsl:template match="svg">
           <xsl:comment> svg element </xsl:comment>
           <xsl:copy>
                <xsl:apply-templates/>
           </xsl:copy>
       </xsl:template>

      <xsl:template match="polygon">
           <xsl:comment>polygon</xsl:comment>
           <xsl:copy>
                <xsl:apply-templates/>
           </xsl:copy>
       </xsl:template>

   </xsl:stylesheet>

The output I get with the DOCTYPE declaration is:

   <?xml version="1.0" encoding="UTF-8"?>

The output I get without the DOCTYPE declaration is:

   <?xml version="1.0" encoding="UTF-8"?>
   <!-- svg element --><svg>

       <!--polygon--><polygon/>

   </svg>

What in the DTD causes the result of the transformation to differ?  Is
there anyway in the XSL to get around this?

Any help would be much appreciated.

Thanks,
Scott
--
Scott Hayman
Software Designer
Plazmic Inc.
425 Bloor Street East, Suite 300
Toronto, Ontario, Canada M4W 3R5
416.863.9755 ext 222 (direct)
416.863.9785 (fax)
Scott.Hayman@xxxxxxxxxxx
http://www.plazmic.com



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.