forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Crossley <cross...@indexgeo.com.au>
Subject Re: document v10 - v11 conversion
Date Thu, 27 Jun 2002 04:20:07 GMT
J.Pietschmann wrote:
> Hi,
> the s1|s2... template is broken in docv10todocv11.xsl.
> Saxon complained
>   Error at xsl:copy-of on line 65 of ...docv10todocv11.xsl:
>    Cannot write an attribute when there is no open start tag
> Guys, what tools are you using?

Different people use different XSLT and XML tools for
their development. As you know, Forrest uses Cocoon which
uses Xalan by default. I am keen to see your various
postings to cocoon-dev about using Saxon with Cocoon.

OK. I have added your various fixes below and tested
it using the trial scratchpad build transform-v11.

> Furthermore, if there is no title, an empty title element
> will be created, and if there is a title, it will also be
> copied as an attribute. The for-each is redundant.
> 
> I suggest something like this:
>    <xsl:template match="s1 | s2 | s3 | s4">
>      <section>
>        <xsl:apply-templates select="@*|node()"/>
>      </section>
>    </xsl:template>
> 
>    <xsl:template match="@title">
>      <title><xsl:value-of select="."/></title>
>    </xsl:template>

I changed the second match to be
 <xsl:template match="s1/@title | s2/@title | s3/@title | s4/@title">
because i suspect that there are other elements which
have a title attribute that might get treated differently.

> Furthermore I'd use xsl:apply-templates instead of
> xsl:value-of in the templates for connect and link/@idref
> in order to preserve markup which might be present.

Done.

> The template for sl could be shortened too:
>    <xsl:template match="sl">
>      <ul>
>        <xsl:apply-templates select="@*|node()"/>
>      </ul>
>    </xsl:template>

Done. Thanks.
--David



Mime
View raw message