[xsl] Dynamic creation of Frame view from XML using XSLT Regex match!

Subject: [xsl] Dynamic creation of Frame view from XML using XSLT Regex match!
From: sreejith m <msreejith@xxxxxxxxx>
Date: Sun, 9 Sep 2007 10:42:01 -0700 (PDT)
Hi All,

Following is the brief problem description:

i) Need to create a normal Frame based html view (left
index frame + right content frame) 

ii) The main content (right frame) is generated by
rendering a XML document using xsl transformation

iii) At the same time the left frame should be
populated based on certain TAG name matches from the
same XML document which in turn would be hyperlinks to
the main content frame

For eg) the html should look like:
T_SYS | T_SYS                         
T_MB  | --html table for t_sys here
      | --
      | --
      | T_MB
      | --html table for t_mb here

The format of the XML document is:


   <acol> aval </acol>
   <bcol> bval </bcol>

   <acol> aval </acol>
   <bcol> bval </bcol>



   <acol> aval </acol>
   <bcol> bval </bcol>

   <acol> aval </acol>
   <bcol> bval </bcol>




The XSL currently applied (for content rendering) is:
<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0"

   <xsl:output method="xml" version="1.0"
encoding="utf-8" indent="yes"
     doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"

<xsl:template match="/*">
              <style type="text/css">
        table { font-family: Arial, sans-serif; }
        th { font-size: 75%; background: #4D5D97;
color: #FFFFFF; }
        td { vertical-align: top; }
        .odd { background: #E3E4FA; }
        .evn { background: #E7ECF0; }
<xsl:for-each select="/*/*">
        <h1><xsl:value-of select="name()"/></h1>
         <xsl:apply-templates select="."

<xsl:template match="*" mode="table">
<table border="0">
select="*[1]/descendant::*[not(*)]" mode="th"/>
<xsl:apply-templates select="*" mode="tr"/>

<xsl:template match="*" mode="th">
   <th><xsl:value-of select="name()"/></th>

 <xsl:template match="*" mode="tr">
   <xsl:variable name="class">
          <xsl:when test="(position() mod 2 =
                        <tr class="{$class}">
select="descendant::*[not(*)]" mode="td"/>

<xsl:template match="*" mode="td">
  <td><xsl:value-of select="."/></td>



Kindly let me know how to achieve the final output.


Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 

Current Thread