[Mono-list] XmlTextReader

Fennell, Philip philip.fennell at hp.com
Tue May 31 03:50:24 EDT 2005

> XSLT 'template' element must not have 'mode' 
> attribute when it does not have 'match' attribute.

I know for a fact that the MSXML parser does not allow you to have:

<xsl:template name="foo" mode="bar">

This is reasonable as you can only have one instance of a named
and mode is used with xsl:apply-templates which works with:

<xsl:template match="foo" mode="bar">

So I think you'll find that this is where your problem lies.

However, on Mono 1.1.7 (Windows) I noticed that for a transformation,
that did work on
Mono 1.1.4 (Linux), failed for the later version with a message saying:

"System.Xml.Xsl.XsltException: 'template' element is not sup
ported as a template content in XSLT 1.0."

Now this is quite clearly 'twoddle', as none of my style sheets (I have
a root style sheet that includes a number of sub-stylesheets) have any
form of template element children of xsl:template with or without the
xsl namespace.

I will be uninstalling 1.1.7 and trying 1.1.4 on Windows to see if it is
a windows problem or a mono problem.


Philip Fennell 

-----Original Message-----
From: mono-list-bounces at lists.ximian.com
[mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Giuseppe Greco
Sent: 30 May 2005 18:19
To: Mono
Subject: [Mono-list] XmlTextReader

Hi all,

I think there is a problem with the XslTransform class...
For example, if you try to transform a document using the
DocBook stylesheets, you'll get the following error message:

Could not perform XSLT transformation of
'/home/genius/projects/thermota/doc/help/Thermota/en-US/index.xml' using
    XSLT 'template' element must not have 'mode' attribute when it does
not have 'match' attribute.
line 21, position 2
line 21, position 2

The code to reproduce the problem looks like this:

Uri uri = new Uri(
XmlUrlResover resolver = new XmlUrlResolver();
Stream stream = (Stream) resolver.GetEntity(uri, null, typeof(Stream));
XmlTextReader xslReader = new (uri.AbsoluteUri, stream);
XslTransform xslt = new XslTransform();
xslt.Transform(xmlDoc, xsltArgs, xmlWriter):

Is there any reason why XslTransform dislikes DocBook stylesheets?
Any help is really appreciated.


Giuseppe Greco


phone:  +41 (0)91 604 67 65
mobile: +41 (0)79 602 99 27
email:  giuseppe.greco at agamura.com
web:    www.agamura.com

Mono-list maillist  -  Mono-list at lists.ximian.com

More information about the Mono-list mailing list