Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xml:stylesheet use in document with multiple stylesheet options

Reply
Thread Tools

xml:stylesheet use in document with multiple stylesheet options

 
 
David Blickstein
Guest
Posts: n/a
 
      08-02-2005
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?


 
Reply With Quote
 
 
 
 
Johannes Koch
Guest
Posts: n/a
 
      08-02-2005
David Blickstein wrote:

> <?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.


--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      08-02-2005


David Blickstein wrote:


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


It should be
<?xml-stylesheet
not
<?xml:stylesheet
see the spec here:
<http://www.w3.org/TR/xml-stylesheet/>


--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
David Blickstein
Guest
Posts: n/a
 
      08-02-2005
> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox and XSLT (local stylesheet works, server-based stylesheet fails) David Blickstein XML 14 10-15-2005 11:27 PM
have a stylesheet generate another stylesheet based on XML? Steven An XML 1 11-23-2004 01:07 PM
linking xml document to xsl stylesheet in C UndoMiel XML 1 09-21-2004 09:06 PM
Stylesheet referanse i stylesheet =?ISO-8859-1?Q?J=F8rn_Tommy_Kinder=E5s?= XML 3 07-04-2004 03:16 PM
document() usage in xsl stylesheet Patrick TJ McPhee XML 2 09-26-2003 07:43 PM



Advertisments