RE: [xsl] Need Help

Subject: RE: [xsl] Need Help
From: cknell@xxxxxxxxxx
Date: Fri, 08 Dec 2006 14:43:56 -0500
> I am very new to t=his and am having a lot of trouble.

That's not unusual when learning something new.

> Is this possible?

Yes.

> Also I would like to apply CSS Classes to certain nodes depending if they are selected or not.

There is nothing, so far as I can see, in your XML that gives a clue as to whether or not a node is selected. If you can tell us how to distinguish the selected nodes from the nodes that are not selected, someone will surely explain how to make two templates that match the "item" element, one that adds the "class" attribute for selected nodes, and one that does not.

> And can I hide child nodes if the p=arent node is not selected?

See answer above.

> I am using ASP.Net 2.0 to do this ...

This is almost certainly irrelevant to the XSLT transformation. You can use Microsoft's own XSLT transformer, or you could use Saxon.NET, and probably several others as well.

Generally speaking, you seem to have several distinct concerns entwined in your thinking. This is not unusual when a person is new to a body of knowledge. Start by explaining how you can tell which nodes are selected and which are not.

-- 
Charles Knell
cknell@xxxxxxxxxx - email



-----Original Message-----
From:     Brant Schroeder <brantschr@xxxxxxxxx>
Sent:     Fri, 8 Dec 2006 11:06:28 -0800 (PST)
To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  [xsl] Need Help

I am trying to create a 3 tier menu using xml and xslt.  I am very new to t=his and am having a lot of trouble.
Here is my XML:
<?xml version "1.0" encoding "UTF-8" ?>
<menu>   
 <item url="#" title="Home"></item>   
 <item url="#" title="My Stuff">      
  <item url="#" title="Backgrounds"></item>      
  <item url="#" title="Flyers" ></i=tem>
        <item url="#" title="Posters" ></item>
 </item>   
 <item url=="#" title="Portfolio">      
  <item url="#" title="Backgrounds" ></i=tem>      
  <item url="#" title="Flyers" ></item>      
  <item url="#" title="Posters" ></item>      
  <item url="#" title="More Information"> 
   <item url="#" title="Resume"></item>         
   <item url="#" tit=le="Contact Me"></item>      
  </item>   
 </item>
</menu>
I want to transform it to this
<ul>   
 <li><a href="#">Home</li>   
 <li><a href="#">My Stuff      
  <ul>           
       <li><a href="#">Backgrounds</li>              
       <li><a href="#">Flyers</li>            
       <li><a href="#">Posters</li>      
  </ul>   
 </li>   
 <li><a href="#">Portfolio      
  <ul>           
       <li><a href="#">Backgrounds</li>           
       <li><a href="#">Flyers</li>           
       <li><a href="#">Posters</li>           
       <li><a href="#">More Information               
   <ul>
    <li><a href="#">Resume</li>
    <li><a href="#">Contact Me</li>               
   </ul>           
       </li>
         </ul>   
 </li>
</ul>
Is this possible?  Also I would like to apply CSS Classes to certain nodes depending if they are selected or not.  And can I hide child nodes if the p=arent node is not selected? Any help would be appreciated.  I am using ASP.Net 2.0 to do this and it is for site I would like to use to display my school work and resume.  If it can't be done that is fine I wanted a dynamic menu using XML.
Thanks
Brant


 
____________________________________________________________________________________
Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it now.

Current Thread