Re: [xsl] atrtributes

Subject: Re: [xsl] atrtributes
From: "Jay Bryant" <jay@xxxxxxxxxxxx>
Date: Tue, 28 Feb 2006 22:24:57 -0600
Sure. And in a couple different ways.

One way is to apply only certain templates. Consider the following
stylesheet fragment:

<xsl:template match="TOSET">
  <xsl:apply-templates select="TO"/>
</xsl:template>

<xsl:template match="TO">
  <!-- Do some stuff here -->
</xsl:template>

Because the TOSET template applies only the TO template, the HETROGENEOUS
element never gets matched and is thus "ignored". (We'd generally say the
HETROGENEOUS node is not processed.)

The other way is to apply templates to everything and specifically not
process certain nodes, thus:

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

<xsl:template match="TO">
  <!-- Do some stuff here -->
</xsl:template>

<xsl:template match="HETROGENEOUS "/>

Which one you should use depends on what you are doing and is also a matter
of personal style.

HTH

Jay Bryant
Bryant Communication Services

----- Original Message ----- 
From: "Jody Robert Ford" <jody.r.ford@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, February 28, 2006 6:55 PM
Subject: RE: [xsl] atrtributes


Can I have the style sheet ignore <HETROGENEOUS>true</HETROGENEOUS>?
Thanks for your help.
----
<HETROGENEOUS>true</HETROGENEOUS>
    <xsl:template match="TO">
      <xsl:value-of select="A[@N='Assoc Unit Id']/@V"/>
      <xsl:text>&#09;</xsl:text>
      <xsl:value-of select="A[@N='Assoc Unit Name']/@V"/>
      <xsl:text>&#10;</xsl:text>
    </xsl:template>

---

-----Original Message-----
From: Florent Georges [mailto:darkman_spam@xxxxxxxx]
Sent: Tuesday, February 28, 2006 7:15 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] atrtributes

Jody Robert Ford wrote:

> Can anyone explain how to access attributes in an xsl/xslt?
> Where do I start my research?

  In any good XSLT tutorial?

> How would you display a list like this:

> 02 Baker
> C1 Charlie
> A1 Alpha
> A2 Annie

    <xsl:template match="TO">
      <xsl:value-of select="A[@N='Assoc Unit Id']/@V"/>
      <xsl:text>&#09;</xsl:text>
      <xsl:value-of select="A[@N='Assoc Unit Name']/@V"/>
      <xsl:text>&#10;</xsl:text>
    </xsl:template>

--drkm























___________________________________________________________________________
Nouveau : tiliphonez moins cher avec Yahoo! Messenger ! Dicouvez les tarifs
exceptionnels pour appeler la France et l'international.
Tilichargez sur http://fr.messenger.yahoo.com

Current Thread