This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Output is incorrect...



> However, when id=_2, I seem to get the
> contents of the "art" nodes

you haven't specified a template for cat elements that don't have
@id=$id so you get the default one, which drops through to th eart
elements, and seing as there isn't a template for those either
you'll get the character data of their content.

If you specify _0 you trap everything at th etop
if you specify _1 you get _1 stuff as you expect
and the default template is applied to _2 but there is no pcdada content
in that branch so you see nothing wrong.
If you specify _2 then you get all the pcdata in every other branch.

add 
<xsl:template match="cat"/>

to your stylesheet to kill off all the cats by default and just let
through the one with the more specific

<xsl:template match="cat[@id=$id]">

David


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]