This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: why doesn't this do what i think it should?
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] why doesn't this do what i think it should?
- From: Michael Case <mecase at ucdavis dot edu>
- Date: Fri, 09 Mar 2001 16:24:04 -0800
- Organization: UC Davis, Department of Physics
- References: <000001c0a8ee$53fc4b60$a5293c3e@oemcomputer>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi,
Thanks for the response. I am using testXSLT that came with Xalan 1.0.
(I provided that in the previous message. More info: the C++ version
running on Linux).
I consider myself to be a beginner at this and hence "one of the more
imaginitive inventions" (nice way to say d...a.. mistakes) :-). And I
don't know why people do what they do, but for me its part of learning,
glad to be an example of what not to do.
Is the following better? (less imaginative inventing, more reading and
following syntax) Or, am I still really not getting this. If you are
too busy to reply, I understand.
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- It copies out the bbb's -->
<xsl:strip-space elements="*"/>
<xsl:output method = "xml"/>
<xsl:template match="/"> <!-- wrap the whole resulting set with the
newaaa tag -->
<newaaa>
<xsl:apply-templates/>
</newaaa>
</xsl:template>
<xsl:template match="los-of-other-tags"></xsl:template> <!-- get rid of
other tags -->
<xsl:template match="bbb">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
sincerely and humbly,
Mike Case
Michael Kay wrote:
>
> > Why doesn't this do what I think it should?
> > XSLT:
> >
> > <xsl:stylesheet
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > xmlns="http://www.w3.org/TR/xhtml1/strict" version="1.0">
> > <!--
> > It copies out the bbb's
> > -->
> > <newaaa>
> > <xsl:strip-space elements="*"/>
> > <xsl:output method = "xml"/>
> > <xsl:template match="los-of-other-tags"></xsl:template>
> > <xsl:template match="bbb">
> > <xsl:copy-of select="self::*"/>
> > <xsl:apply-templates/>
> > </xsl:template>
> > </newaaa>
> > </xsl:stylesheet>
> >
>
> Well I would expect a conformant XSLT processor to reject it as an error.
> xsl:strip-space, xsl:output, and xsl:template are allowed only as top-level
> elements, that is, children of xsl:stylesheet. Which processor are you
> using?
>
> Why do people writing stylesheets think they can invent new syntax and
> semantics as they go along? This is one of the more imaginative inventions I
> have seen.
>
> Mike Kay
> Software AG
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
--
Michael E. Case
UC Davis
case@ucdhep.ucdavis.edu
(530) 754-7226
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list