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

RE: Applying template to Attributes

Subject: RE: Applying template to Attributes
From: Guy Pirostsky <Guy@xxxxxxxx>
Date: Fri, 26 Nov 1999 15:12:06 +0200
applying templates to attributes
I am using
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">

My file is 

<?xml version="1.0"?>
<?xml-stylesheet href="test.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>
<page>
  <TEST>
 
      <COMPONENT NAME="name1" VIEW="view1">
	|name1 view1|
      </COMPONENT>
      <COMPONENT NAME="name1" VIEW="view2">
        |name1 view2|
      </COMPONENT>
      <COMPONENT NAME="name2">
       |name2|
        <TAG1>|tag1|</TAG1>
        <TAG2>|tag2|</TAG2>
      </COMPONENT>

     <COMPONENT NAME="name3" VIEW="view1">
       name3 view1
      </COMPONENT>

 </TEST>
</page>

stylesheet:

<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
 

  <xsl:template match="page">
    <HTML>
    <HEAD>
    </HEAD>
    <BODY BGCOLOR="white">
<xsl:apply-templates/>
    </BODY>
    </HTML>
  </xsl:template>

  <xsl:template match="COMPONENT[@NAME='name1']" >
  transformed name1
  </xsl:template>


</xsl:stylesheet>


provides result 

<HTML><HEAD></HEAD><BODY BGCOLOR="white">transformed name1transformed name1
       |name2|
        |tag1||tag2|
       name3 view1
      </BODY></HTML>

Haw can I write different templates for each name and for each view?


-----Original Message-----
From: Steve Dahl [mailto:sdahl@xxxxxxxxxxx]
Sent: Wednesday, November 24, 1999 4:53 PM
To: Guy Pirostsky
Subject: Re: Applying template to Attributes


Which XSL processor are you using? What other templates are there that
might match a COMPONENT? What is the order of the templates that match
COMPONENT?


Guy Pirostsky wrote:

> Hello,
> I'd like to apply template to the following element
>
>  <COMPONENT NAME="name1" VIEW="view1">
>
> This Template doesn't works:
>
> <xsl:template match="COMPONENT[@NAME='name1' and @VIEW='view1']" >
>
> What syntax is valid to apply the Template?

--
- Steve Dahl
sdahl@xxxxxxxxxxx


 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.