473,382 Members | 1,225 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

xml:stylesheet use in document with multiple stylesheet options

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?
Aug 2 '05 #1
3 1709
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.)
Aug 2 '05 #2


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/
Aug 2 '05 #3
> 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.
Aug 2 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sarah Haskins | last post by:
I have a few questions about this problem I'm having involving XML, DTD, and XSL. I'm working with this DTD which defines a stylesheet, as such... <?xml version="1.0" encoding="UTF-8"?>...
3
by: Michael Hertz | last post by:
I am performing a XSLT stylesheet on a XML document and produce a new XML document. How can I insert in this new XML stylesheet a tag <currtime>..."the current date/time"....</currtime> where...
10
by: Russell Mangel | last post by:
What would be the best way to parse this XML document? I want to avoid using XMLDocument. I don't know if I should use XMLTextReader, or Xpath classes. There is only one element <MessageStore>...
0
by: Gardar | last post by:
I have a web-service, which returns an xml document. The xml document contains a stylesheet reference of the form <?xml-stylesheet href = StyleSheetDoc.xsl' type = 'text/xsl'?> When accessed...
1
by: tjakopec | last post by:
Hi to all! Situation: First document (data.xml): <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="data.xsl"?> <data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > ....
3
by: gdelfino | last post by:
I have an XML file which I transform into XHTML using stylesheetA.xsl. I also have stylesheetB.xsl which transforms my XML file into an Excel XML document. As both Excel and most new browsers...
0
by: Nata | last post by:
hi all i am trying to store the XML Document object into MS SQL2005 i want to store this as whole not different tables; plz help me regarding this i am trying form last two weeks i asked many...
2
by: Kenpatchi | last post by:
When I use Ajax to load in an xml document (text/xml) it has these directives : <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="/xsl/result.xsl"?> at the top of the .xml file. ...
1
by: Thomas | last post by:
Does anyone have a best practices recommendation on writing a valid XML document based on a 3rd party XML schema? I have a working solution but I would like to know if anyone has a better...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.