|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: One XML doc - multiple Stylesheets
Since nobody is answering this poor guy trying to make sense out the XML mess, I'll go for it... Ed, a really good question, seriously. This is a mess, IMO. Or to put it nicely, there is still more to be defined in that direction... As far as I can say, you can place multiple xml stylesheets on to the same XML document, yes, but there is no way of saying "Use *only* this if you are a WAP browser, use only that if you're a rich client web browser, and, BTW, do this if you want to print...". The only thing is the 'alternate="yes"' flag on the xml stylesheet PI: <?xml-stylesheet href="http://webaccess.mozquito.com/features/styles/random_css.asp" type="text/css"?> <?xml-stylesheet href="http://webaccess.mozquito.com/features/index.xsl" type="text/xsl" alternate="yes"?> I took this from my blog [1]. The (somewhat random) browser behaviour is: - IE6 will use CSS to style the XML - X-Smiles and Netscape 7 will use the alternate XSL stylesheet to transform the document into XHTML (!) and the generated XHTML references the same CSS (!!) file as defined by the primary XML stylesheet declaration. This technique always me to have all style definitions in one place (the CSS), while still using two different stylesheet technology since some browsers do one thing (XML+CSS), others do the other way (XML+XSL(T)) and some do both. Things like cocoon or anything server-side may take you further, yes of course, but that's a pity in my view because you have to embark into a different world (servers) for something that is sort-of nearly there already client-side General note: could someone besides the usual suspects go to the W3C and fix this? CC/PP was meant to solve this but went nowhere (for whatever reasons). - Sebastian [1] http://webaccess.mozquito.com/features/index.xml -----Ursprüngliche Nachricht----- Von: xml er Gesendet: Sa 27.07.2002 22:00 An: xml-dev@l... Cc: Betreff: One XML doc - multiple Stylesheets Hello All - Should be a simple question, I must be overlooking something very fundamental. Normally when I create XML pages I place the following in the xml page if I wanted to use the WAP version of the stylesheet: <?xml-stylesheet href=”style-wml.xsl” type=”text/xsl” media=”wap”?> <?xml-stylesheet href=”style-html.xsl” type=”text/html” media=”html”?> My problem is that I want to use multiple stylesheets on only xml document (one for PDF, one for HTML, WAP, etc). How do I solve the problem of using one XML doc, yet have them transform to multiple formats. Am I required to use something like Cocoon to do this? Thanks much --ed ________________________________________________________________ To get your free Web-based E-mail go to http://www.nandomail.com ----------------------------------------------------------------- The xml-dev list is sponsored by XML.org <http://www.xml.org>, an initiative of OASIS <http://www.oasis-open.org> The list archives are at http://lists.xml.org/archives/xml-dev/ To subscribe or unsubscribe from this list use the subscription manager: <http://lists.xml.org/ob/adm.pl>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








