Subject: Re: Re: [xsl] Template doesn't seem to match From: russurquhart1@xxxxxxxxxxx Date: Mon, 09 Jul 2012 14:29:55 -0500 (CDT) |
You're right Syd. I was trying to find a SubSection that had such a child, not the child itself. Sorry for the confusion. However, both your and Ken's suggestions don't seem to have made a difference. (I know for Ken's i'm finding the child element, which is not what i want.) The changing of priority values doesn't seem to have changed anything. I'll keep trying if anyone has any other suggestions! Thanks, Russ On 07/09/12, Syd Bauman<Syd_Bauman@xxxxxxxxx> wrote: Presuming your match= attributes say what you want (rather than the prose that implies you want to match on the child of the <SubSection>), I suspect all would work if you put explicit priority= attributes on 'em: <xsl:template match="SubSection[@filter='filter1']" priority="4"> <xsl:template match="SubSection[*[@filter='filter1']]" priority="3"> <xsl:template match="SubSection" priority="2"> Not sure, but it's certainly worth a try. > I have a couple of templates that i thought would handle things but > they seem to be working wrong, but i know it must be something i am > missing. > > The first template: > > <xsl:template match="SubSection[@filter='filter1']" priority="1"> > <SubSection> > <xsl:copy-of select="./Title"/> > <xsl:processing-instruction name="xm-insertion_mark_start"> author="x0167021" time="20120629T115628-0600"</xsl:processing-instruction> > <Para>This subsection contains only NDA content and is not available in the public domain.</Para> > <xsl:processing-instruction name="xm-insertion_mark_end"/> > </SubSection> > > </xsl:template> > > matches a SubSection element that has a filter attribute set to > 'filter1', and outputs a Para element saying that entire element is > an NDA only section. > > The second template: > > > <xsl:template match="SubSection[*[@filter='filter1']]"> > <SubSection> > <xsl:apply-templates/> > </SubSection> > </xsl:template> > > matches a SubSection element that contains any element having a > filter attribute set to 'filter1', if so continue processing. > > The third template i think should work, but isn't completely. This > template should return any remaining SubSection elements, and all > that are left at this time, i would think, would be those that have > no NDA content. > > <xsl:template match="SubSection"> > <SubSection> > <xsl:copy-of select="./Title"/> > <Para>This Subsection does not contain any NDA content.</Para> > <xsl:apply-templates select="SubSection"/> > </SubSection> > </xsl:template> > > > The problem i'm having is that i have an element, in a SubSection, > that HAS a filter attribute set to 'filter1', but the second > template is NOT catching it. It's getting matched in the third > template. Shouldn't the first, second and third templates handle > the possibilites? > > I'm sure this is something i'm over looking, but i appreciate any > help you can provide!
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Template doesn't seem to , Syd Bauman | Thread | Re: [xsl] Template doesn't seem to , Markus Abt |
Re: [xsl] Template doesn't seem to , Syd Bauman | Date | Re: [xsl] Template doesn't seem to , Markus Abt |
Month |