Forum Moderators: not2easy
Here's a little problem I have to solve right now. I am to write a stylesheet, which formats tags in an XML-File depending on the different attributes and their values.
For example:
<absatz typ="u">
<absatz typ="gross">
Problem is: the definition given to me by SelfHTML or the XMLBible (absatz[typ=u] or absatz[typ=gross]) does not work with Microsoft's IE. I am using version 6.0 of the IE, and it just does not react to my stylesheet.
If anybody has any idea on how to use the information given in the tag-attributes with my stylesheet, I would be very glad.
And I have to find a way, as I am not allowed to change the source-XML-File.
:)
Thanks for any help and suggestions!
Matthias Jenke
1) If you have a "class" element in your XML, add a class identical to the type. For example:
<input type="button" class="button" value="foo" />
The recent thread on multiple classes [webmasterworld.com] is a helpful read in this case.
2) Use scripting to grab all of the nodes in the document and apply your styles dynamically based on a rule like:
if (node.type == "whatever") {
node.style.background = '';
[etc...]
}
Of course, that method depends on a client that supports scripting.
Thanks for the suggestion. But the main problem is that I must not modify the xml-source-file, which means I cannot insert class-attributes.
But the problem might have been solved by the decision, that I am now allowed to build a stylesheet which works with Netscape 7.2, which is a great alleviation.
Just a pity that there are so many nice features in CSS that are not implemented in MSIE or Amaya (which I tried out for similar reasons).
:-)
Matthias Jenke