XML styling with CSS doesn't recognize class attribute

VERIFIED INVALID

Status

()

Core
XML
VERIFIED INVALID
17 years ago
2 years ago

People

(Reporter: George Gosline, Assigned: Heikki Toivonen (remove -bugzilla when emailing directly))

Tracking

Trunk
x86
Windows ME
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (Win95; U)
BuildID:    2001070204

Displaying an <element class="classname"> does not pick up
element.classname from the css stylesheet.
Also the padding is not picked up in the <Verse> element.

Reproducible: Always
Steps to Reproduce:
Try displaying XML with CSS below.

Actual Results:  No highlighting of first line; no padding

Expected Results:  See IE6

<?xml version='1.0'?>
<?xml-stylesheet href="Psalm23v3.css" type="text/css"?>
<Psalm>
<Title>Psalm 23</Title>
<Source>Scottish Psalter</Source>
<Date>1650</Date>

<Verse number="1">
<Line class="first">The LORD's my shepherd, I'll not want:</Line>
<Line>He makes me down to lie</Line>
<Line>In pastures green; He leadeth me</Line>
<Line>The quiet waters by.</Line>
</Verse>

<Verse number="5">
<Line class="first">Goodness and mercy all my life</Line>
<Line>Shall surely follow me;</Line>
<Line>And in God's house for evermore</Line>
<Line>My dwelling place shall be.</Line>
</Verse>

</Psalm>

CSS below --------------------
/* It attempts to highlight the <Title> element*/
Title {
  font-family: Arial;
  font-size:24pt;
  font-weight:bold;
  text-decoration:underline;
  display:block;
}

/* and add a little highlighting to the <Source> element
and the <Date> element */
Source, Date {
  font-family: Arial;
  font-size:16pt;
  font-weight:bold;
  display:block;
}

/* while all other elements we will display simply as "blocks" which introduces 
a new line at the end of each line */
Line {
font-family: TimesRoman;
font-size: 12pt;
line-height:14pt;
font-style:normal;
display:block;
}

/* and we will use the class="first" attribute to make the
first line of each verse bold. */
Line.first {
font-family: TimesRoman;
font-size: 12pt;
line-height:14pt;
font-weight:bold;
display:block;
}

/* If we now convert the <Verse> element to block-level and add a padding 
property then we improve layout. */
Verse {
display:block;
padding:10;
}

Comment 1

17 years ago
INVALID. The "class" attribute only has special meaning in HTML. In XML it is 
just like any other attribute.

According to CSS2:

> 5.8.3 Class selectors
> For style sheets used with HTML, authors may use the dot (.) notation as an
> alternative to the "~=" notation when matching on the "class" attribute. 

Please note the disclaimer: "For style sheets used with HTML".

Comment 2

17 years ago
Just replace "Line.first" with:
Line[class="first"] {
...
}
resolving invalid.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 17 years ago
QA Contact: petersen → ian
Resolution: --- → INVALID
Verified invalid.
Status: RESOLVED → VERIFIED

Updated

2 years ago
See Also: → bug 7588
You need to log in before you can comment on or make changes to this bug.