Subject: RE: [xsl] Match pattern should get child content but gets sib's content also From: "Doug Zirbel" <doug@xxxxxxxxxxxxxxxxxx> Date: Fri, 26 Apr 2002 15:15:47 -0500 |
First, my thanks to all of you who've replied! OK, my understanding has advanced by a small step. I read your posts, and section 5.8 and know that there is such a thing as a default template... I'm just not sure how to override it! Would it be an additional template with something like match="not(text())"?? -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Thomas B. Passin Sent: Friday, April 26, 2002 2:20 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] Match pattern should get child content but gets sib's content also [Joerg Heinicke] > Hello Tom, > > I must say, that you are wrong. I'm alway willing to be wrong (good thing, too!). I added the string "==" to the end of your template to mark the end of the template's contribution so it was even more clear, and sure enough, the OOPS comes from the default template while the Hello and World do come from his. I use the null template from time to time to suppress unwanted activation of the default template, and I see that I forgot that it (my null template) would take precedence. This example has caused me to check over what I thought was my understanding of how templates are found to be matched. It seems that I formed some of my ideas when I was first getting started with xslt, didn't get some matches I expected, and also didn't really understand the Rec. Time for some updating. Thanks, Tom P > The built-in template has the lowest > priority, so when the node <aValue> is accessed and a template is > searched for it, the processor uses Doug's template, not the built-in on. > The built-in templates are similar to > > <xsl:template match="node()"> > <xsl:apply-templates/> > </xsl:template> > > <xsl:template match="text()"> > <xsl:value-of select="."/> > </xsl:template> > > As a test for it, use Doug's template/stylesheet and change it a bit, so > that a text will be added by this template: > > <xsl:template match="link/aValue"> > <xsl:text>from template: </xsl:text> > <xsl:value-of select="."/> > </xsl:template> > > You will see it ;-) 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Match pattern should get , Thomas B. Passin | Thread | Re: [xsl] Match pattern should get , Thomas B. Passin |
[xsl] Same code different output wi, Uslu, Cihan Y (MED) | Date | Re: [xsl] Match pattern should get , Thomas B. Passin |
Month |