473,835 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:styleshee t type="text/xsl" href="toHtml.xs lt" 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_compil er3/debug/girml.xml;
Line #2; Column #6; XSLT Error (javax.xml.tran sform.Transform erException):
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 1727
David Blickstein wrote:
<?xml:styleshee t type="text/xsl" href="toHtml.xs lt" 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_compil er3/debug/girml.xml;
Line #2; Column #6; XSLT Error (javax.xml.tran sform.Transform erException):
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:styleshee t type="text/xsl" href="toHtml.xs lt" version="1.0"?>


It should be
<?xml-stylesheet
not
<?xml:styleshee t
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:styleshee t


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
3105
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"?> <?xml-stylesheet type="text/xsl" href="abc-xsl.xsl"?> <!ELEMENT ABCMessage (Tag1, Tag2, Tag3, Tag4, Tag5, Tag6, Tag7, Tag8*)> <!ATTLIST ABCMessage
3
38802
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 "the current date/time" above is replaced by the real current time (e.g. 12th Sep 2004 09:23:78 Michael
10
2660
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> element in the document, "always" at the end of the document. There will be thousands of <Messages> elements, "always" before <MessageStore> element. 1st Step
0
1006
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 via broweser, the brower will fetches the stylesheet, to appropriately render the xml-document returned. Hower the "GET" operation for the xsl document commes accross in the form:
1
1293
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
3309
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 have a built in XSTL engine, I decided to add the stylesheet information to the original XML file. Like this <?xml version="1.0" encoding="utf-8" standalone="yes"?> <?xml-stylesheet href="stylesheetA.xsl" type="text/xsl" media="excel"?>
0
3256
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 people but no use. below is my program In that i want to store Document document object into database which as var image/blob/clob plz help me
2
2046
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. Can anyone explain how to obtain the href xsl as a string from the returned xmlhttprequest object or response object? I have tried
1
2814
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 approach. My solution: 1) Pull the data from the database into datatables (in my case, this is DB2). 2) Validate all required data columns (I've written a method that iterates through all the datatables rows and throws an exception if
0
9803
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10808
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10520
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10233
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9344
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6963
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5804
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4433
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.