Include CSS and Schema informatione in XML files

Piet

Usenet Archive
Joined
Mar 1, 2000
Messages
45
Reaction score
0
Hi there.
I have started to work with CSS. For formatting HTML files, the CSS commands can either be be present in the same HTML file via the style-tag <style type="text/css"> <!-- tagname {}
-->
</style>
or be present in a separate CSS file and be included via <link rel="stylesheet" type="text/css" href="stylesheet.css"> For defining the output of xml files (which is want I want to do preferentially) only the second method (referencing to external CSS file) seems to exist:
<?xml-stylesheet type="text/css" href="stylesheet.css" ?> Is it possible to include CSS formating informations directly into the xml file as it is possible with DTD´s ? I haven´t found any hint on doing this so far. Please help! Thanx in advance.
Piet
 

Eric Sirois

Usenet Archive
Joined
Jun 28, 2001
Messages
64
Reaction score
0
Hello,

You should use the following to transform your XML using CSS <?xml-stylesheet type="text/css" href="stylesheet.css" ?>

IE and Netscape will transform the XML document and use the specified stylesheet to display the new document.

Kind regards,
Eric

Piet wrote:
Hi there.
I have started to work with CSS. For formatting HTML files, the CSS commands can either be be present in the same HTML file via the style-tag <style type="text/css"> <!-- tagname {}
-->
</style>
or be present in a separate CSS file and be included via <link rel="stylesheet" type="text/css" href="stylesheet.css"> For defining the output of xml files (which is want I want to do ...
 

GIMME

Usenet Archive
Joined
Jun 3, 2003
Messages
107
Reaction score
0
The thing with IE5.51 (And I think IE6) is that link and script tags which include external files must have both a begin and an end tag.

For example :

This doesn't include the css :

<link rel="stylesheet" type="text/css" href="stylesheet.css">

While this does :

<link rel="stylesheet" type="text/css" href="stylesheet.css"></link>

This makes things problematic for developers.

If a developer tells his XSL transformer to create both begin and end tags in the output, then :

<br/>

In the xslt becomes :

<br></br>

in the XHTML.

That's not a good thing because in IE <br></br> doesn't render the same as either <br> or <br/>. (<br></br> renders with an extra break which makes the resulting XHTML visually unappealing.)

So, personally, I've set up a scheme in my JSPs to write the javascript and link external stuff separately and to have the transform create everything in the body tags.

PS, IE doesn't support textareas in "XHTML", so you occassionally you have use workarounds when you use them. The IE spec actually says that using end tags for textares isn't suppported. And IE does not claim to fully support XHTML.

If you search on google on this group you can find an example using a textarea which fails (the text that should go into the textarea appears outside the textarea).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,798
Members
249,594
Latest member
henrywalsh

Latest Threads

Top