[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RES: XSL namespace question

Subject: RES: XSL namespace question
From: "Carlos Durand Silvestrin" <csilvestrin@xxxxxxxxxxx>
Date: Thu, 19 Jul 2001 14:52:02 -0300
xsl namespace apply templates
what happened to <html> and <head> tags???

> -----Mensagem original-----
> De: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]Em nome de Jeni Tennison
> Enviada em: quinta-feira, 19 de julho de 2001 14:17
> Para: Samina Islam
> Cc: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Assunto: Re:  XSL namespace question
> 
> 
> 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"
>                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                 xmlns:dc="http://purl.org/dc/elements/1.1/">
> 
> <xsl:template match="/*">
>   <xml>
>     <body>
>       <xsl:apply-templates select="article" />
>     </body>
>   </xml>
> </xsl:template>
>                 
> <xsl:template match="article">
>   <dc:identifier>
>     <dc:block><xsl:apply-templates/></dc:block>
>     <dc:description>
>       <dc:subject>
>         <xsl:value-of select="moreovernews/article/headline_text"/>
>       </dc:subject>
>     </dc:description>
>   </dc:identifier>
>   <dc:contributor>
>     <dc:block><xsl:apply-templates/></dc:block>
>     <dc:description>
>       <dc:source><xsl:value-of select="source"/></dc:source>
>     </dc:description>
>   </dc:contributor>
> </xsl:template>
> 
> </xsl:stylesheet>
> 
> 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).
> 
> Cheers,
> 
> Jeni
> 
> ---
> Jeni Tennison
> http://www.jenitennison.com/
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.