Closed Bug 89982 Opened 23 years ago Closed 23 years ago

XML styling with CSS doesn't recognize class attribute

Categories

(Core :: XML, defect)

x86
Windows ME
defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: ggosline, Assigned: hjtoi-bugzilla)

References

Details

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;
}
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".
Just replace "Line.first" with:
Line[class="first"] {
...
}
resolving invalid.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
QA Contact: petersen → ian
Resolution: --- → INVALID
Verified invalid.
Status: RESOLVED → VERIFIED
See Also: → 7588
You need to log in before you can comment on or make changes to this bug.