karl catch,failed to download xsl template,catch all named,catch all template,catch all xslt,xsl template catch all,xslt template catch all, xml%%%karl catch - Re: Catch ALL

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

Re: Catch ALL | Failed template rule

Subject: Re: Catch ALL | Failed template rule
From: Karl Stubsjoen <kstubs@xxxxxxxxx>
Date: Mon, 21 Mar 2005 08:44:25 -0700
karl catch
Given the following XML:

<ABC>
  <A>1</A>
  <B>2</B>
  <C>3</C>
</ABC>

This select will result in nothing:
<xsl:apply-templates select="ABC/D"/>

How do I setup a template rule for this non-existent match?



On Mon, 21 Mar 2005 21:00:17 +0530, omprakash.v@xxxxxxxxxxxxx
<omprakash.v@xxxxxxxxxxxxx> wrote:
> 
> 
> Hi,
>   here goes!
> 
> This selects everything other than the node named slide
> 
> <xsl:template match="//*[not(name(.) = 'slide')]">
> 
> </xsl:template>
> 
> Cheers,
> Omprakash.V
> 
>                    Karl
>                    Stubsjoen            To:     xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>                    <kstubs@gmail        cc:     (bcc: omprakash.v/Polaris)
>                    .com>                Subject:      Catch ALL | Failed template rule
> 
>                    03/21/2005
>                    08:33 PM
>                    Please
>                    respond to
>                    xsl-list
> 
> 
> I'd like a catch ALL template rule, actually a catch NOT template
> rule.  In an effort to check for the existence of a select, I have
> setup a match template rule that simply returns "1" for a match.  So I
> have:
> 
> <xsl:template match="record" mode="recordexists">
> <xsl:text>1</xsl:text>
> </xsl:template>
> 
> The failed select would need to return a "0".  So I need a match that
> simply returns 0.
> 
> So something like:
> 
> <xsl:template match="not(record)" mode="recordexists">
> <xsl:text>0</xsl:text>
> </xsl:template>
> 
> (which is not a legal match statement, but that is what I need).  I'm
> sure there is a way, and I'm sure it is obvious!  Just not coming to
> me.
> 
> Thanks,
> Karl
> 
> This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only.
> If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately.
> You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification,
> distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.
> 
> Visit Us at http://www.polaris.co.in

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.