Subject: RE: Need Help
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 9 Dec 2006 00:24:38 -0000
|
> I thought you could pass
> parameters into the xslt and use it within conditional
> statments. I guess I was wrong.
No, you were right.
I'm afraid I haven't followed the thread (subject lines like this don't grab
my attention) so I don't know how you got the impression you were wrong.
Some misunderstanding somewhere. Perhaps you should start again with a
single question and a simple example.
Michael Kay
http://www.saxonica.com/
Thanks for the help I will
> just keep tring to put something together that meets my
> needs. If anyone else has any other ideas about this your
> help would be appreciated.
>
> Charles Knell seemed to think that it was possible but I am
> not as wise as him so I don't know if it is.
>
> Brant
>
> ----- Original Message ----
> From: David Carlisle <davidc@xxxxxxxxx>
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Sent: Friday, December 8, 2006 3:55:40 PM
> Subject: Re: Need Help
>
>
> (please see the list posting guidelines about choosing
> subject lines that help the archives later)
>
>
> > I want to transform it to this
> > ..
> > Is this possible?
>
> not exactly as your requested format isn't well formed (<a>
> elements not
> closed) but essentially I suspect you want something like
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> <xsl:output indent="yes"/>
> <xsl:template match="menu">
> <ul>
> <xsl:apply-templates/>
> </ul>
> </xsl:template>
> <xsl:template match="item">
> <li>
> <a href="{@url}"><xsl:value-of select="@title"/></a>
> <xsl:if test="item">
> <ul>
> <xsl:apply-templates/>
> </ul>
> </xsl:if>
> </li>
> </xsl:template>
>
>
> </xsl:stylesheet>
>
> which produces
>
> <ul>
> <li>
> <a href="#">Home</a>
> </li>
> <li>
> <a href="#">My Stuff</a>
> <ul>
> <li>
> <a href="#">Backgrounds</a>
> </li>
> <li>
> <a href="#">Flyers</a>
> </li>
> <li>
> <a href="#">Posters</a>
> </li>
> </ul>
> </li>
> <li>
> <a href="#">Portfolio</a>
> <ul>
> <li>
> <a href="#">Backgrounds</a>
> </li>
> <li>
> <a href="#">Flyers</a>
> </li>
> <li>
> <a href="#">Posters</a>
> </li>
> <li>
> <a href="#">More Information</a>
> <ul>
> <li>
> <a href="#">Resume</a>
> </li>
> <li>
> <a href="#">Contact Me</a>
> </li>
> </ul>
> </li>
> </ul>
> </li>
> </ul>
>
>
> > Also I would like to apply CSS Classes to certain nodes
> depending if
> > they are selected or not.
>
> selected by what, where?
>
>
> > And can I hide child nodes if the p=arent node is not selected?
>
> xslt doesn't interact with the browser at all (even if you
> are using a client side xslt that's in the browser) it just
> generates an html page that is then rendered, so if you know
> what css and/or javascript you need to get whatever dynamic
> effect that you want, then you can generate that code in
> xslt, but xslt doesn't "know" anyting about css or javascript
> (or html) it's just generating an element tree, and the
> javascript is just text as fas as xslt is concerned.
>
> David
>
>
>
> ______________________________________________________________
> ______________________
> Do you Yahoo!?
> Everyone is raving about the all-new Yahoo! Mail beta.
> http://new.mail.yahoo.com
|