Re: [xsl] XSL namespace question

Subject: Re: [xsl] XSL namespace question
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Thu, 19 Jul 2001 18:17:01 +0100
Hi Samina,

Actually this isn't a namespace question. Your problem is that you're
mixing the pattern for simplified stylesheets with the pattern for
normal stylesheets.

If you are using templates, as you are, then all the xsl:template
elements have to be at the top level of the stylesheet, as immediate
children of the xsl:stylesheet element. What's more, anything that you
want to be given in the output needs to be within a template.  Your
stylesheet should therefore look something like:

<xsl:stylesheet version="1.0"

<xsl:template match="/*">
      <xsl:apply-templates select="article" />
<xsl:template match="article">
        <xsl:value-of select="moreovernews/article/headline_text"/>
      <dc:source><xsl:value-of select="source"/></dc:source>


I think you probably want to apply templates to different things
within the dc:block within dc:identifier and the one within
dc:contributor by selecting different elements within the article, but
I'm sure you can work out how to do that.

Also I should point out that the name 'xml' is a reserved name because
it starts with the letters 'xml'. You should really use something else
instead (like 'articles' perhaps).



Jeni Tennison

 XSL-List info and archive:

Current Thread