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

RE: Match pattern should get child content but gets si

Subject: RE: 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
doug zirbel
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:  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

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.