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

Re: MSXML 3.0 XSLT. Does it work?

Subject: Re: MSXML 3.0 XSLT. Does it work?
From: Jeni Tennison <Jeni.Tennison@xxxxxxxxxxxxxxxx>
Date: Wed, 12 Jul 2000 12:12:04 +0100
msxml not applying attribute
Sotiris,

>If understand that if the template rules don't match at all, then default
>template rules apply (another subscriber explained this to me).  Is it
>possible to switch these rules off?

You can 'switch these rules off' by not applying templates to elements that
you don't want to be matched on.  So, in your example:

     <a>
          <b>Hello</b>
          <c>There</c>
          <d>GoodBye</d>
     </a>

Instead of applying templates to all the children using:

     <xsl:template match="a">
          <xsl:apply-templates/>
     </xsl:template>

Then apply the templates to only the children you're interested in, using:

    <xsl:template match="a">
      <xsl:apply-templates select="d" />
    </xsl:template>

If you find it easier to identify which elements you *don't* want to be
processed, then you can either deliberately not select them within the
select attribute of the xsl:apply-templates element, or alternatively
create templates that do nothing for those particular elements, e.g.:

    <xsl:template match="b" />
    <xsl:template match="c" />

Finally, you can create templates that mimic the built-in templates but do
nothing:

    <xsl:template match="*" />

so that by default, if an element doesn't match any template, then it isn't
processed at all.  Be careful doing this, though, if you *are* interested
in the content of the elements - they have interesting sub-elements, say,
because empty templates mean that templates aren't applied to the children
of the ignored elements.

I hope this helps,

Jeni

Dr Jeni Tennison
Epistemics Ltd, Strelley Hall, Nottingham, NG8 6PE
Telephone 0115 9061301 ? Fax 0115 9061304 ? Email
jeni.tennison@xxxxxxxxxxxxxxxx



 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.