xml:stylesheet use in document with multiple stylesheet options

  • Thread starter David Blickstein
  • Start date
D

David Blickstein

Hi,

I have a Schema and a number of different XSLT stylesheets to translate to
different things. One stylesheet translates it to HTML.

I'd like to generate the XML files such that when loaded by a browser they
are automatically translated into XML and I've accomplished that by
inserting the following processing instruction when I generate the file:

<?xml:stylesheet type="text/xsl" href="toHtml.xslt" version="1.0"?>


However I would also like to arrange things such that I can use OTHER XSLT
stylesheets on the XML file by manually invoking XSLT.

However, when I try to use another stylesheet on an XML file with that
processing instruction I get the following error msg from XALAN:

file:///extra/blickstein/user_150_GIRML/CLO/Components/JAVA_HOTSPOT/Src/build/hp-ux/hp-ux_ia64w_compiler3/debug/girml.xml;
Line #2; Column #6; XSLT Error (javax.xml.transform.TransformerException):
The processing instruction target matching "[xX][mM][lL]" is not allowed.

Is there a way to have a sort of "default" stylesheet specified via a
processing instruction without making the file unuseable with a different
stylesheet?
 
J

Johannes Koch

David said:
<?xml:stylesheet type="text/xsl" href="toHtml.xslt" version="1.0"?>

According to <http://www.w3.org/1999/06/REC-xml-stylesheet-19990629/> it is

xml-stylesheet

And that's what Xalan tells you:
file:///extra/blickstein/user_150_GIRML/CLO/Components/JAVA_HOTSPOT/Src/build/hp-ux/hp-ux_ia64w_compiler3/debug/girml.xml;
Line #2; Column #6; XSLT Error (javax.xml.transform.TransformerException):
The processing instruction target matching "[xX][mM][lL]" is not allowed.
 
D

David Blickstein

It should be
<?xml-stylesheet
not
<?xml:stylesheet

Ugh... I had copied that from a website I had googled.

Turns out... the colon works with IE anyway, but IE seems just as happy with
a hyphen and XALAN is MUCH happier with a hyphen.

Thanks for the help guys.
 

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

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top