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

RE: Descendant::??

Subject: RE: Descendant::??
From: "Dan Acuff" <dacuff@xxxxxxxxxxxxxx>
Date: Tue, 22 Apr 2008 13:36:58 -0400
RE:  Descendant::??
Ok thanks.

So far this is the closest I have gotten.

I have divs created 100% accuratly for each sub category AND the
@display_nane us getting displayed to boot. All acurate.

The only thing I need now is the default image to show up and the
anchor/link around it.

Here is the XSL:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
 <xsl:output encoding="UTF-8" method="html" version="4.01"
omit-xml-declaration="yes" media-type="text/html"/>
 <!-- value passed dynamically via asp -->
 <xsl:param name="paraCatagory"/>

 <xsl:template match="menu">
  <xsl:apply-templates
select="descendant::category[@name=$paraCatagory]"/>
 </xsl:template>

 <xsl:template match="category">
  <xsl:for-each select="category">
     <div class="cat_module">
      <xsl:value-of select="@display_name"/>
      <br/>
      <a href="{category/info/link}">
       <img src="{category/info/images/image}"/>
      </a>
     </div>
  </xsl:for-each>
 </xsl:template>
</xsl:stylesheet>

Is it possible to wrap the anchor code around another couple xsl:valu-of
commands?

Like <a href="{<xsl:value-of select"link"/>}"> etc. etc. ???


-----Original Message-----
From: Abel Braaksma [mailto:abel.online@xxxxxxxxx]
Sent: Tuesday, April 22, 2008 1:28 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Descendant::??

Dan,

In all your replies and examples you fail to show that you apply
xsl:apply-templates somewhere in your matching template. Hence, it can
only match once, because you instruct the processor *not* to continue.

Don't start trying difficult axes when you don't need to (sell, the
descendant axis is not difficult, but all you need is the default child
axis). Like I said in a previous post: try to keep it simple at first.
Also, try the fully working example of David Carlisle sent in this
thread, four messages prior to this one (and answer his post, he took
the time to create a working example).

On a side note: keep the mail subject intact while in the same thread,
that is easier for the archive, which is collected per subject.

Kind regards,
-- Abel Braaksma

Dan Acuff wrote:
> Do I want to use the Descendant predicate to get all nodeset children
> of the one I match on?
>
> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
>  <xsl:output encoding="UTF-8" method="html" version="4.01"
> omit-xml-declaration="yes" media-type="text/html"/>
>  <!-- value passed dynamically via asp -->  <xsl:param
> name="paraCatagory"/>
>
>  <xsl:template match="menu">
>   <xsl:apply-templates
> select="descendant::category[@name=$paraCatagory]"/>
>  </xsl:template>
>
>  <xsl:template match="category">
>      <div class="cat_module">
>       <xsl:value-of select="category/@display_name"/>
>       <br/>
>       <a href="{category/info/link}">
>        <img src="{category/info/images/image}"/>
>       </a>
>      </div>
>  </xsl:template>
> </xsl:stylesheet>

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.