Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 26th, 2007, 11:22 AM
Authorized User
 
Join Date: Feb 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default div hiererchy

<node>
 <child name="1st"/>
 <child name="2nd"/>
 <child name="3rd"/>
</node>

i want to make a html from this xml..which will be like that..
<div><table><tr><td><img src="images/blank.png"><img src="images/I.png">1st</td></tr></table>
       <div><table><tr><td><img src="images/blank.png"><img src="images/I.png"><img src="images/I.png">2nd</td></tr></table>
        <div> <table><tr><td><img src="images/blank.png"><img src="images/I.png"><img src="images/I.png"><img src="images/I.png">3rd</td></tr></table>
</div>
</div>
</div>

means the in order as child of node will give as hiererchy div structure...and <img src="images/I.png"> this will be increase by one..can anybody pls tell me the xsl structure...

 
Old February 26th, 2007, 11:35 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Something like

<xsl:template match="child">
 <div><table><tr><td>
 <img src="images/blank.png"/>
 <img src="images/blank.png"/>
 <xsl:for-each select="preceding-sibling::*">
   <img src="images/blank.png"/>
 </xsl:for-each>
 <xsl:value-of select="."/>
</xsl:template>

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old February 26th, 2007, 12:21 PM
Authorized User
 
Join Date: Feb 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i hav etried like this..


my childs are under path...data/dataSource

<xsl:template match="data/dataSource">
                 <div id="treeNode{position()}" style="display:none"><table border="0" cellspacing="0" cellpadding="0"><tr><td><img class="hiericon" src="images/blank.png"/><img class="hiericon" src="images/blank.png"/><img class="hiericon" src="images/I.png"/><img class="hiericon" src="images/I.png"/>
                     <xsl:for-each select="preceding-sibling::*">
                           <img class="hiericon" src="images/I.png"/>
                     </xsl:for-each>
                     <xsl:value-of select="@name"/>
                 </td></tr></table>
                 </div>
            </xsl:template>

and when parsing time in the perticular div where this display this will come there i have puted this code...but is not working...i have done mistake..pls correct me..
 
Old February 26th, 2007, 12:27 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I'm sorry, but I haven't got a clue what this means:

and when parsing time in the perticular div where this display this will come there i have puted this code...

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old February 26th, 2007, 11:47 PM
Authorized User
 
Join Date: Feb 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

actually wat code u have given to me...with that i have tried like this way..uder the perticular node where i have to make this logic i have puted the template there..and posted to u the code that i'm implementing..but i'm not getting it .and for those things i have really no idea..thnx for ur help






Similar Threads
Thread Thread Starter Forum Replies Last Post
Select 'DIV' ?? Frankb52258 SQL Server 2005 3 February 9th, 2007 01:06 PM
div within a div and inherting the height brettdavis4 CSS Cascading Style Sheets 1 January 23rd, 2007 09:59 AM
DIV TAG marclena ASP.NET 1.0 and 1.1 Professional 2 May 24th, 2005 11:14 AM
Div again... Nitin_sharma HTML Code Clinic 3 February 11th, 2005 04:28 AM
div DSteven CSS Cascading Style Sheets 2 February 9th, 2005 11:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.