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

Re: partial attribute matching

Subject: Re: partial attribute matching
From: ARiley@xxxxxxxxxxxxxxx
Date: Tue, 17 Aug 2004 16:07:59 -0400
ariley
exactly! thanks.


                                                                           
             "cking"                                                       
             <cking@xxxxxxxxxx                                             
             >                                                          To 
                                       <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>   
             08/17/2004 03:57                                           cc 
             PM                                                            
                                                                   Subject 
                                       Re:  partial attribute         
             Please respond to         matching                            
             xsl-list@xxxxxxxx                                             
              lberrytech.com                                               
                                                                           
                                                                           
                                                                           
                                                                           




if I understand you correctly, you could use the starts-with function:

<xsl:variable name="section"
select="'http://www.somedomain.com/section/'"/>
<xsl:if test="/html/head/page_url[starts-with(@url, $section)]">
  ...
</xsl:if>

HTH,
Anton Triest

Tuesday, August 17, 2004 9:41 PM ARiley@xxxxxxxxxxxxxxx wrote:
>
> I have an xml file that contains:
> <html><head>
> <page_url url="http://www.somedomain.com/section/page.html" />
> [...]
>
> and a corresponding xsl fragment:
>   <xsl:if test="
> /html/head/page_url[@url='http://www.somedomain.com/section/']">
>      do something different
>   </xsl:if>
>
> What I'm trying to accomplish is to apply a template to an entire 'url'
> section but this doesn't appear to work.  What's the preferred way of
> testing for a partial attribute match?

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.