This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

XSL:TEMPLATES


Hi there,
    I am using a xML string which in turn will be parsed with XSL . I am
using XSL templates to display the values.

   The xml string is below.

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="menu.xsl" ?>
<themenu Type="Maim Tree">
 <topItemOut>
  <URL>blank.htm</URL>
  <ItemName>Menu Leaf One</ItemName>
 </topItemOut>
 <topFolderOut Title="One menu" URL="test.htm" Tips="One menu" ID="One">
  <sub>
   <subItemOut Title="Test Main End" URL="test.htm" Tips="Test Main menu"/>
  </sub>
 </topFolderOut>
 <topFolderOut Title="Two Menu" URL="test.htm" Tips="Two Menu" ID="Two">
  <sub>
   <subFolderOut Title="Two Menu Child" URL="test.htm" Tips="Two Menu Child"
ID="SubTwo">
    <sub>
     <subItemOut Title="Test Menu Child End" URL="test.htm" Tips="Two Menu
Child One End"/>
     <subItemOut Title="Test Menu Child End" URL="test.htm" Tips="Two Menu
Child Two End"/>
    </sub>
   </subFolderOut>
  </sub>
 </topFolderOut>
</themenu>


------------------------------------

And the XSL which I am trying to use is



<HTML>
 <LINK HREF="style1.css" REL="stylesheet" TYPE="text/css"/>
 <HEAD>
    <SCRIPT src="menu.js"></SCRIPT>
 </HEAD>
 <title>Tree View Test</title>
 <BODY  CLASS="menuBody">
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:user="http://www.w3.org/TR/WD-xsl" xmlns:msxsl="urn:schemas-
microsoft-com:xslt" version="1.0">
 <output media-type="html"/>
   <xsl:template match="/">
    <xsl:apply-templates/>
   </xsl:template>

   <xsl:template match="topFolderOut">
     <div CLASS="topFolderOut" TARGET="RIGHT">
      <xsl:attribute name="HREF">
       <xsl:value-of select="theMenu/topFolderOut/@HREF"/>
      </xsl:attribute>
      <xsl:attribute name="TITLE">
        <xsl:value-of select="theMenu/topFolderOut/@Title"/>
      </xsl:attribute>
      <xsl:value-of select="theMenu/topFolderOut/@Title"/>
     </div>
   </xsl:template>
 </xsl:stylesheet>
 </BODY>
</HTML>


---------------------------------
Why the reason which I am trying to use the method is to use xsl:template to
match all the various tags . And build the output.

But I am struck initially itself. Can any one help me out. I saw a lot of
examples. But examples are working fine rather my program.


I am looking for reply friends..

Sachi





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]