homepage Welcome to WebmasterWorld Guest from 23.20.19.131
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
Help with XSL XML Layout
XSL Table Layout
moporho




msg:3764288
 3:12 am on Oct 13, 2008 (gmt 0)

Here is the output I would like to get or check out [ -- URL REMOVED -- ]:

Title: Business Data Communication
Author: William Stallings <column right book image>
Edition: 5th
Year: 2004
ISBN: 0-12345-0
Subject: Communication
Condition: New
Price: $ 122.00

Title: Computer Networking: A Top-Down Approach

Author: James F. Kurose, Keith W. Ross
Edition: 4th
Year: 2005
ISBN: 0-321-49770-8 <book image>
Subject: Networking
Condition: New
Price: $104.67

.
.

And so on for 8 more textbooks.

Here is the xml:

<catalog>
<text>
<book>images/BusinessDataCommunications.jpg</book>
<title>Business Data Communications</title>
<author>William Stallings</author>
<edition>5th</edition>
<year>2004</year>
<isbn>0-13-144257-0</isbn>
<cover>Hardcover</cover>
<subject>Networks</subject>
<condition>New</condition>
<price>$ 122.00</price>
</text>

<text>
<book>images/ComputerNetworking.jpg</book>
<title>Computer Networking: A Top-Down Approach</title>
<author>James F. Kurose, Keith W. Ross</author>
<edition>4th</edition>
<year>2005</year>
<isbn>0-321-49770-8</isbn>
<cover>Hardcover</cover>
<category>Networks</category>
<condition>New</condition>
<price>$104.67</price>
</text>

<text>
<book>images/ComputerScienceIlluminated.jpg</book>
<title>Computer Science Illuminated</title>
<author>Nell Dale, John Lewis</author>
<edition>3rd</edition>
<year>2006</year>
<isbn>0-7637-4149-3</isbn>
<cover>Paperback</cover>
<category>Computer Science</category>
<condition>New</condition>
<price>$ 91.95</price>
</text>

<text>
<book>images/CPlusPlus.jpg</book>
<title>C++ How to Program</title>
<author>Deitel &amp; Associates Inc.</author>
<edition>6th</edition>
<year>2007</year>
<isbn>0-13-615250-3</isbn>
<cover>Paperback</cover>
<category>Programming</category>
<condition>New</condition>
<price>$ 115.00</price>
</text>

<text>
<book>images/Java.jpg</book>
<title>Java: An Introduction to Problem Solving and Programming</title>
<author>Walter Savitch</author>
<edition>4th</edition>
<year>2005</year>
<isbn>0-13-149202-0</isbn>
<cover>Paperback</cover>
<category>Programming</category>
<condition>New</condition>
<price>$ 79.69</price>
</text>

<text>
<book>images/DatabaseSystems.jpg</book>
<title>Fundamentals of Database Systems</title>
<author>Ramez Elmasri, Shamkant B. Navathe</author>
<edition>5th</edition>
<year>2006</year>
<isbn>0-3213-6957-2</isbn>
<cover>Hardcover</cover>
<category>Database</category>
<condtion>New</condtion>
<price>$ 83.84</price>
</text>

<text>
<book>images/DiscreteMathematics.jpg</book>
<title>Discrete Mathematics: International Edition</title>
<author>Richard Johnsonbaugh</author>
<edition>7th</edition>
<year>2008</year>
<isbn>0-13-135430-2</isbn>
<cover>Paperback</cover>
<category>Mathematics</category>
<condition>New</condition>
<price>$ 76.88</price>
</text>

<text>
<book>images/TakingCharge.jpg</book>
<title>Taking Charge of Your Career Direction: Career Planning Guide</title>
<author>Robert D. Lock</author>
<edition>5th</edition>
<year>2004</year>
<isbn>0-5345-7426-2</isbn>
<cover>Paperback</cover>
<category>Pyscology</category>
<condition>New</condition>
<price>$ 53.64</price>
</text>

<text>
<book>images/MSAccess2007.jpg</book>
<title>Microsoft Office Access 2007 Forms, Reports, and Queries</title>
<author>Paul McFedrie</author>
<edition>2nd</edition>
<year>2007</year>
<isbn>0-7897-3669-1</isbn>
<cover>Paperback</cover>
<category>Technology</category>
<condition>New</condition>
<price>$ 39.99</price>
</text>

<text>
<book>images/Excel2007.jpg</book>
<title>Formulas and Functions with Microsoft Office Excel 2007</title>
<author>Paul McFedries</author>
<edition>1st</edition>
<year>2007</year>
<isbn>0-7897-3668-3</isbn>
<cover>Paperback</cover>
<category>Technology</category>
<condition>New</condition>
<price>$ 39.99</price>
</text>
</catalog>

And here is the xsl
<TR>
<TH>Book</TH>
<TD>Title:</TD>
<TD>Author:</TD>
<TD>Publisher:</TD>
<TD>ISBN:</TD>
<TD>Year:</TD>
<TD>Cover:</TD>
<TD>Subject:</TD>
<TD>Price:</TD>
</TR>


<xsl:for-each select="catalog/text">
<TR>
<TD>
<img>
<xsl:attribute name = "src">
<xsl:value-of select="book"/>
</xsl:attribute>
</img>

</TD>

<TD Align="Center" Valign="Middle" width="250" height="25">
<xsl:value-of select="title"/>
</TD>

<TD Align="left" Valign="Middle" height="60">

<xsl:value-of select="author"/>
</TD>

<TD Align="Center" Valign="Middle">
<xsl:value-of select="edition"/>
</TD>

<TD Align="Center" Valign="Middle">
<xsl:value-of select="year"/>
</TD>

<TD Align="Center" Valign="Middle">
<xsl:value-of select="isbn"/>
</TD>

<TD Align="Center" Valign="Middle">
<xsl:value-of select="cover"/>
</TD>

<TD Align="Center" Valign="Middle">
<xsl:value-of select="subject"/>
</TD>

<TD Align="Center" Valign="Middle">
<xsl:value-of select="condition"/>
</TD>

<TD Align="Center" Valign="Middle">
<xsl:value-of select="price"/>
</TD>
</TR>
</xsl:for-each>
</tr>
</table>
</body>

</xsl:template>
</xsl:stylesheet>

I do not how to get the layout to output, can you help?
Thanks,
Mary

[edited by: httpwebwitch at 4:35 am (utc) on Oct. 13, 2008]

 

moporho




msg:3765322
 12:39 pm on Oct 14, 2008 (gmt 0)

The table is in three columns.

column one is the headers; ie title, author...
column tow is the book info
column three rowspan is 9 and houses a picture of the book.

The question is how do I get the xsl to format so that each of the books lays out vertical.

httpwebwitch




msg:3765824
 2:01 am on Oct 15, 2008 (gmt 0)

Here is an example [webmasterworld.com] of how to style an XML file with XSL and CSS. Since you're using <table> layout, getting your info to align shouldn't be too challenging.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved