Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] Creating tables, columns and properties

From: Muthu Kumar <muthuqa2001@--------->
To:
Date: 12/2/2006 4:37:00 AM
Hi All-     I have the following data, 
a snippet from a file.  <ObjectPath>  
<Reference Relationship="Table: " Level="0" 
Id="#PID-17877114741569430027">A_CONTACT_ADR</Reference><Reference

Relationship="  CONTAINS  has_Column: " Level="1" 
Id="#PID-17877114741569422766">cntc_id</Reference><Reference
Relationship="  
CONTAINS  has_UserDefinedProperty: " Level="2" 
Id="#PID-17877114741569429987">DD FIELD
#</Reference><Reference 
Relationship="  CONTAINS  has_UserDefinedProperty: "
Level="2" 
Id="#PID-17877114741569430016">DDS
Release</Reference><Reference 
Relationship="  CONTAINS  has_UserDefinedProperty: " 
Level="2" Id="#PID-17877114741569430017">DDS INTERFACE
FIELD # (within 
table)</Reference>  <Reference Relationship="Table: " 
Level="0"
 
Id="#PID-17877114741569431018">ACIS_BILL_GROUP</Reference><Reference
Relationship="  CONTAINS  has_Column: " 
Level="1" 
Id="#PID-17877114741569431004">eff_dt</Reference><Reference
Relationship="  CONTAINS  has_UserDefinedProperty: " 
Level="2" Id="#PID-17877114741569431005">DD FIELD 
#</Reference><Reference Relationship="  CONTAINS  
has_UserDefinedProperty: " Level="2"
Id="#PID-17877114741569431006">DDS 
Release</Reference><Reference Relationship="  CONTAINS
 
has_UserDefinedProperty: " Level="2"
Id="#PID-17877114741569431007">DDS 
INTERFACE FIELD # (within table)</Reference>  
<ObjectPath>  I need to create a table structure with
the 
Table Names ( eg.A_CONTACT_ADR) at the top and the
column names (items 
where Level = 1 or Relationship = "CONTAINS
has_Column:") lined after 
that and then on clicking on that column it should go
to another
 link with the Level=2 items arranged together.( I
have not started 
with the Level=2 yet)  I am new to XSLT. This is what
I 
Created. What should I correct to get this working?
Right now  I 
created this following- it lines up the Table Names at
top ( but with a big 
space in between) and the columns are lined up
together. I would like 
it to look like      TableName1Column 
Name1.1ColumnName1.2     
TableName2ColumnName2.1ColumnName 2.2     Column 
1.1  User Defined Property 1.1  User Defined Property 
1.2      etc,     
Can I use a variable or a named template which calls
itself so 
that I can get these together?.      Thanks for 
any help that you can provide.     
   My script so far:  <?xml
 version="1.0" encoding="UTF-8"?><xsl:stylesheet 
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform">
 <xsl:output 
method="html" version="1.0" encoding="UTF-8" 
indent="yes"/>     <xsl:template 
match="ObjectPath">      <table width="600" border="1"

>    <!-- necessary so i can add the break after each
item in the 
tree -->     <xsl:for-each 
select="./Reference">  
           <xsl:if 
test="@Level">             
             
<xsl:choose>           <xsl:when 
test="@Level = '0'
 ">      <P><HR/> 
</P>    
      <tr>       Data Dictionary for 
the TABLE 
:      </tr>      <tr bgcolor = 
"#669999">              
<A><xsl:attribute name="HREF"><xsl:value-of 
select="@Id"/></xsl:attribute>           
       <xsl:value-of 
select="self::node()" />         
</A>        
       
 </tr>      
 
      </xsl:when>        <xsl:when 
test="@Relationship='  CONTAINS  has_Column: 
'">        <P><HR/> </P>   
           <tr 
bgcolor = "#cccccc" >        
           
<td>Column 
Name</td>           
    </tr>    <tr>           
    <td><A><xsl:attribute 
name="HREF"><xsl:value-of 
select="@Id"/></xsl:attribute>           
             
    <xsl:value-of select="self::node()" 
/>              
</A></td>        
           
</tr>   </xsl:when>                                   
</xsl:choose>             
           
</xsl:if>    
</xsl:for-each></table>   </xsl:template>   
</xsl:stylesheet>      Thanks  
   Kumar


 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent