Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-18-2013, 12:21 AM   PM User | #1
jag157
New Coder

 
Join Date: Jan 2013
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
jag157 is an unknown quantity at this point
Creating a table

Hi there i am creating a blog website through xml and have used xsl to output it and have also used css to style it but i am having problems, i am wanting to create a table for which i can have title, blog text, date, time do i enter the table through css? everytime i do it doesnt load and i have tried everything also i wanted to add a menu and i have tried adding that through css and that doesnt work too, any help much appreciated

edit: thiss is the code for the menu i have tried putting it in css and xsl but it doesnt show up
Code:
div.menu2
{
    /*width:500px;margin:0 auto;*//*Uncomment this line to make the menu center-aligned.*/
    text-align:center;
    background-image: url(bg1.gif);
    border:1px solid black;
    font-size:0;
}

div.menu2 a
{
    display: inline-block;
    padding: 0 20px;
    background-image: url(bg.gif);
    color:White;
    text-decoration:none;
    font: bold 12px Arial;
    line-height: 32px;
}

div.menu2 a:hover, div.menu2 a.current
{
    background-position:0 -60px;
}

div.menu2 a.dummy
{
    width:2px;
    padding:0 0;
}

Last edited by Alex Vincent; 01-18-2013 at 02:00 AM.. Reason: Adding code tags
jag157 is offline   Reply With Quote
Old 01-18-2013, 02:00 AM   PM User | #2
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,427
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
Can you post the XML and the XSLT as well, using code tags?
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary
https://alexvincent.us/blog
Alex Vincent is offline   Reply With Quote
Old 01-18-2013, 02:43 AM   PM User | #3
jag157
New Coder

 
Join Date: Jan 2013
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
jag157 is an unknown quantity at this point
really sorry but didnt know what code tags were my xml is
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="Myblog.xsl"?>
<blog>

<blog-item>
<title>Insert title</title>
<text>Blog text here</text>
<date>Insert date</date>
<time>Insert time</time>
</blog-item>

</blog>
my xssl is
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
  <html>
<head>
<link rel="stylesheet" type="text/css" href="styling.css" />
</head>
  <body>
  <h1>Jagroop Singh's Blog</h1>
<h2>Middlesex University</h2>
<h3>M00294790</h3>
  <table border="7">
    <tr bgcolor="blue">
      <th>Title</th>
      <th>Text</th>
       <th>Date</th>
      <th>Time</th>
    </tr>
    <xsl:for-each select="blog/blog-item">
    <tr>
      <td><xsl:value-of select="title"/></td>
      <td><xsl:value-of select="text"/></td>
      <td><xsl:value-of select="date"/></td>
      <td><xsl:value-of select="time"/></td>
    </tr>
    </xsl:for-each>
  </table>
  </body>
  </html>
</xsl:template>

</xsl:stylesheet>
there is a basic table is the xsl but i want to add a more attractive looking one thanks

Last edited by Alex Vincent; 01-18-2013 at 05:06 PM.. Reason: adding code tags
jag157 is offline   Reply With Quote
Old 01-18-2013, 05:46 PM   PM User | #4
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,387
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
jag157 your style sheet id for a menu (menu2) that is contained in a div. Your xml/xsl does not have any menu or div in it so the stylesheet wont work for it.

Add this to the end of the stylesheet and watch the change in the xml styling.
Code:
h2{
	color: blue;
}
h3{
	color: pink;
}
tr{
	background-color: green;
}
Did you want to add a menu to the html the xsl does?
sunfighter is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:29 PM.


Advertisement
Log in to turn off these ads.