XML, XSL, CSS attribute issue

XML, XSL, CSS attribute issue

am 16.01.2008 07:50:42 von pradeep

I have a following XML file, XSL file and CSS file.

I am facing one problem , that ITEM rows are not displayed in proper
color (RED) as mentioned in css file for .row1...... Same thing works
well if the table is created in but doesn't
work for table created in .

------------------------------------------------------------ ------------------------------------------
XML file ( name myxml.xml)
------------------------------------------------------------ ------------------------------------------




Item1
500
ABC


Item2
600
XYZ


Item3
700
DEF


Item4
900
QWE





------------------------------------------------------------ ------------------------------------------
XSL file ( name myxsl.xsl)
------------------------------------------------------------ ------------------------------------------

version="1.0">
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-stric t.dtd"/>




Data Sheet
















A B
1 2
3 4




















Name Price Location








------------------------------------------------------------ ------------------------------------------
CSS file ( name mycss.css)
------------------------------------------------------------ ------------------------------------------

html body {
line-height:1.55em;
font-family:"Lucida Grande", verdana, lucida, helvetica, sans-serif;

margin:0;
padding:0;
font-size:x-small;
font-size:small;
}


table
{
display: table;
border-collapse:collapse;
empty-cells:show;
border-top:1px solid #ccc;
border-right:1px solid #ccc;
border-left:1px solid #ccc;
border-bottom:1px solid #ccc;
}


tr {
display: table-row;
}

..row0 {
background-color:yellow;
color:#1559B3;
}
..row1 {
background-color:red;
color:#1559B3;
}

td {
display: table-cell;
border-top:1px solid #ccc;
border-right:1px solid #ccc;
border-left:1px solid #ccc;
border-bottom:1px solid #ccc;
}

th {
display: table-cell;
border-top:1px solid #ccc;
border-right:1px solid #ccc;
border-left:1px solid #ccc;
border-bottom:1px solid #ccc;
font-weight: 700;
background-color:#99cccc;

}

If you have any idea about this issue, please do reply....

Re: XML, XSL, CSS attribute issue

am 16.01.2008 12:35:03 von Andy Dingley

On 16 Jan, 06:50, Pradeep wrote:
> I have a following XML file, XSL file and CSS file.
>
> I am facing one problem , that ITEM rows are not displayed in proper
> color (RED) as mentioned in css file for .row1...... Same thing works
> well if the table is created in but doesn't
> work for table created in .

So is this an XSLT problem or a CSS problem? Capture the HTML
generated and study that. It's very difficult to solve CSS selector
problems in XSLT, because you can't tell which process is failing. Did
you really generate the exact HTML you expected?

Either transform the XML / XSLT server-side and captuure the output,
or use a tool like the Firefox Web Developer extension that has an
option to show "Generated HTML" even for client-side generation.


> html body {
> line-height:1.55em;
> font-family:"Lucida Grande", verdana, lucida, helvetica, sans-serif;
>
> margin:0;
> padding:0;
> font-size:x-small;
> font-size:small;
>
> }

Also your CSS sucks.

* Don't set line-height. Very rarely needed, should almost always be
set with a dimensionless number, rather than an em unit.

* Don't mix verdana in with other font names. The odd sizing behaviour
will screw things up.

* Certainly don't default the font-size for body to "small"!

Re: XML, XSL, CSS attribute issue

am 16.01.2008 12:35:16 von Harlan Messinger

Pradeep wrote:
> I have a following XML file, XSL file and CSS file.
>
> I am facing one problem , that ITEM rows are not displayed in proper
> color (RED) as mentioned in css file for .row1...... Same thing works
> well if the table is created in but doesn't
> work for table created in .
[snip]

It works in IE7 but not in Firefox. Firefox shows the generated code
indeed to have class="row1" in those rows. Bug in Firefox?