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

RE: XSLT processor adds unwanted HTML attributes

Subject: RE: XSLT processor adds unwanted HTML attributes
From: Mulberry Technologies List Owner<xsl-list-owner@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 Feb 2003 09:53:47 -0800
unwanted.html
>Reply-To: <michael.h.kay@xxxxxxxxxxxx>
>From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
>To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
>Subject: RE:  XSLT processor adds unwanted HTML attributes
>Date: Mon, 17 Feb 2003 09:22:32 -0000



>Firstly, xsl:document is a feature of the draft XSLT 1.1 specification,
>which was subsequently withdrawn, so you won't find it in most XSLT 1.0
>processors. There are various proprietary extensions that offer the same
>functionality (but not in MSXML3).
>
>Secondly, the most likely source of the unwanted attributes is the DTD:
>a validating parser will add default attributes defined in the DTD to
>the data model that XSLT takes as its input. To suppress this behavior,
>remove the reference to the DTD, or create an alternative DTD that
>doesn't have the defaults in.
>
>Michael Kay
>Software AG
>home: Michael.H.Kay@xxxxxxxxxxxx
>work: Michael.Kay@xxxxxxxxxxxxxx
>
>> -----Original Message-----
>> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]
>> Sent: 16 February 2003 20:52
>> To: xsl-list
>> Subject:  XSLT processor adds unwanted HTML attributes
>>
>>
>> From: Graham Hannington <Ghannington@xxxxxxx>
>> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>> Subject: XSLT processor adds unwanted HTML attributes
>> Date: Sun, 16 Feb 2003 13:22:48 -0000
>>
>>
>> I'm splitting a single, large XML (well, XHTML) file into
>> multiple files, breaking at the <h1> elements.
>>
>> I'm using the following stylesheet:
>>
>> <?xml version="1.0" encoding="utf-8"?>
>> <xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
>> version="1.1" >
>>
>> <xsl:preserve-space elements="*" />
>>
>> <xsl:output method="xml" />
>>
>>  <xsl:template match="h1">
>>   <xsl:variable name="file_name" select="concat(., '.htm')" />
>>   <xsl:message>Splitting <xsl:copy-of select="$file_name" />
>> ...</xsl:message>
>>   <xsl:document href="{$file_name}" >
>> <html>
>> <xsl:text>&#x0A;</xsl:text>
>> <head>
>> <xsl:text>&#x0A;&#x09;</xsl:text>
>>	<link rel="StyleSheet" href="style/default.css" />
>> <xsl:text>&#x0A;&#x09;</xsl:text>
>>	<script src="style/default.vbs"
>> language="VBScript"></script> <xsl:text>&#x0A;</xsl:text>
>> </head> <xsl:text>&#x0A;</xsl:text> <body> <xsl:text>&#x0A;</xsl:text>
>>    <xsl:copy-of select="." />
>> <xsl:text>&#x0A;</xsl:text>
>>	<xsl:call-template name="followingElements"/>
>> <xsl:text>&#x0A;</xsl:text> </body>
>> <xsl:text>&#x0A;</xsl:text> </html>
>>   </xsl:document>
>>  </xsl:template>
>>
>>	<xsl:template name="followingElements">
>>		<xsl:for-each
>> select="following-sibling::*[1][not(self::h1)]">
>>			<xsl:copy-of select="." />
>>			<xsl:text>&#x0A;</xsl:text>
>>			<xsl:call-template name="followingElements"/>
>>		</xsl:for-each>
>>	</xsl:template>
>>
>> </xsl:stylesheet>
>>
>>
>> (I wish I knew a better way to have line breaks than to code
>> all that &#x0A stuff.  Maybe call a named template each time
>> instead, I guess.  Stuart
>> Brown: you'll probably recognize some of your code in that
>> followingElements template... thanks again :-)
>>
>>
>> Here's the problem (with apologies, I realize this dips into
>> XSLT processor-specific behaviour):
>>
>> - MSXSL (the command-line interface to MSXML) appears to not
>> support the <xsl:document> element.
>>
>> - Saxon works fine, but - here's the annoying bit - adds
>> colspan and rowspan attributes to my <td> tags (even though
>> I'm specifying XML as the output method). I interpret Saxon
>> as doing something "naughty" here, or am I wrong?
>>
>> How do I stop these well-meaning additions?  (To - hopefully
>> - avoid flames for discussing processor-specific
>> implementation issues: I don't know for sure that this is a
>> Saxon-specific thing... it could be that XSLT processors in
>> general are allowed to do this stuff unless they're told
>> otherwise; I just don't know how to tell them otherwise ;-)
>>
>> Graham Hannington
>>
>>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
>>



 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.