[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] new user question Saxon


Subject: RE: [xsl] new user question Saxon
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 22 Sep 2005 18:48:04 +0100

Your source document contains

<article xmlns:m="http://www.w3.org/1998/Math/MathML">

but your stylesheet contains

<xsl:template match="ARTICLE">

XML is case sensitive.

Michael Kay
http://www.saxonica.com/

 

> -----Original Message-----
> From: g l [mailto:glarowe@xxxxxxxxxxx] 
> Sent: 21 September 2005 18:30
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] new user question Saxon
> 
> 
> Thanks David. Here's the bits that weren't in the last post:
> 
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>          xmlns:saxon="http://saxon.sf.net/"
>          xmlns:m="http://www.w3.org/1998/Math/MathML"
>          version="2.0">
> 
>          <xsl:output method="text" omit-xml-declaration="no" 
> indent="no"  
> escape-uri-attributes="yes"/>
> 
>          <xsl:variable name="tab">
>            <xsl:text>    </xsl:text>
>          </xsl:variable>
> 
>          <xsl:variable name="newline"><xsl:text>
> </xsl:text>
>          </xsl:variable>
> 
>          <xsl:template match="/">
>                  <xsl:apply-templates/>
>          </xsl:template>
> 
>      <!-- ARTICLE information  -->
> 
>          <xsl:template match="ARTICLE">
>                  <xsl:variable name="body" select="//BODY"/>
>                  <xsl:variable name="abstract" select="//ABSTRACT"/>
>                  <xsl:variable name="article" select="(.)"/>
>                  <xsl:variable name="genid2"  
> select="string-length($body)"/>
>                  <xsl:variable name="genid3"  
> select="string-length($abstract)"/>
>                  <xsl:variable name="genid4"  
> select="string-length($article)"/>
> 
>                  <xsl:variable name="artid"  
> select="concat($genid2,'-',$genid3,'-',$genid4)"/>
> 
>                  <xsl:result-document  
> href="article/article_{$artid}.pgsql">
>                          <xsl:value-of 
> select="normalize-space($artid)"/>
>                          <xsl:value-of select="$tab"/>
>                          <xsl:call-template name="meta"/>
>                          <xsl:value-of select="$newline"/>
>                  </xsl:result-document>
> 
> <!-- CALL OTHER TEMPLATES FROM HERE; pass artid for unique 
> identifier  
> -->
> 
>                  <xsl:call-template name="author">
>                          <xsl:with-param name="artid" 
> select="$artid"/>
>                  </xsl:call-template>
> 
>                  <xsl:call-template name="pacs">
>                          <xsl:with-param name="artid" 
> select="$artid"/>
>                  </xsl:call-template>
> 
>                  <xsl:call-template name="abstract">
>                          <xsl:with-param name="artid" 
> select="$artid"/>
>                  </xsl:call-template>
> 
>                  <xsl:call-template name="body">
>                          <xsl:with-param name="artid" 
> select="$artid"/>
>                  </xsl:call-template>
> 
>                  <xsl:call-template name="citation_article">
>                          <xsl:with-param name="artid" 
> select="$artid"/>
>                  </xsl:call-template>
> 
>                  <xsl:call-template name="citation_other">
>                          <xsl:with-param name="artid" 
> select="$artid"/>
>                  </xsl:call-template>
> 
>                  <xsl:call-template name="figgrp">
>                          <xsl:with-param name="artid" 
> select="$artid"/>
>                  </xsl:call-template>
> 
>          </xsl:template>
> 
> On Sep 21, 2005, at 11:48 AM, David Carlisle wrote:
> 
> >   <xsl:output method="text"/>
> >
> > What you describe (just getting text back with no markup) is the
> > consistent with the behaviour of a stylesheet that doesn't match teh
> > input document (as that's what the default templates do).
> >
> >
> > Your problem is in the bit you showed as
> > ...
> > so it's hard to be specific, but if teh output was coming 
> to the screen
> > then <xsl:result-document wasn't executed, which means that
> > <xsl:template name="body">
> > was not executed.
> >
> > But you didn't show the code that was intended to call that 
> template,  
> > so
> > I can't comment on why it didn't get called.
> >
> > David
> >
> > 
> ______________________________________________________________
> _________ 
> > _
> > This e-mail has been scanned for all viruses by Star. The
> > service is powered by MessageLabs. For more information on 
> a proactive
> > anti-virus service working around the clock, around the 
> globe, visit:
> > http://www.star.net.uk
> > 
> ______________________________________________________________
> _________ 
> > _


Current Thread
Keywords
xml