Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 26th, 2007, 11:22 AM
Authorized User
 
Join Date: Feb 2007
Location: , , .
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...

Reply With Quote
  #2 (permalink)  
Old February 26th, 2007, 11:35 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
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
Reply With Quote
  #3 (permalink)  
Old February 26th, 2007, 12:21 PM
Authorized User
 
Join Date: Feb 2007
Location: , , .
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..
Reply With Quote
  #4 (permalink)  
Old February 26th, 2007, 12:27 PM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
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
Reply With Quote
  #5 (permalink)  
Old February 26th, 2007, 11:47 PM
Authorized User
 
Join Date: Feb 2007
Location: , , .
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:32 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.