Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Viewing one XML using multiple XSL files

Reply
Thread Tools

Viewing one XML using multiple XSL files

 
 
Martin Honnen
Guest
Posts: n/a
 
      01-27-2007
Grant Robertson wrote:

> Can't a browser open a raw XML file and apply the XSL itself?


Yes, but the original question is that someone wants to offer several
different stylesheet for an XML document. To that question I did reply
that the xml-stylesheet processsing instruction in theory allows that
but that browsers in pratice do not support that. You seem to have
missed that original problem.


--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
Grant Robertson
Guest
Posts: n/a
 
      01-27-2007
In article <45bb4bea$0$18842$>,
says...
> You seem to have
> missed that original problem.
>
>

Nah. I hyjacked the thread again. Sometimes the answers to the original
question peaks my interest about something related. I did preface my
question with "Curiosity Question:". I guess I should have changed the
subject line as well. Would people here prefer that I start an entirely
new thread also? In most of usenet people have gotten so lax that I often
don't go to the full effort of full netiquette any more.
 
Reply With Quote
 
 
 
 
Toby Newman
Guest
Posts: n/a
 
      01-29-2007
On 2007-01-27, Andrzej Adam Filip <> wrote:
> Martin Honnen <> writes:
>
>> Toby Newman wrote:
>>
>>> If the following line, which dictates which XSL file should be
>>> used to transform my XML document for me, is found *in the XML file
>>> itself* then how can you use more than one XSL to present multiple views
>>> of the same XML document?
>>>
>>> <?xml-stylesheet type="text/xsl" href="myXSL.xsl"?>

>>
>> The xml-stylesheet processing instruction is modelled after the HTML
>> link element so it should allow you (in theory) to have several such
>> processing instructions to suggest alternative stylesheets.
>> However in reality for XSLT stylesheet I don't think any of the major
>> desktop browsers like IE 6 and later, Mozilla/Firefox or Opera support
>> that.
>> On the other hand such a processing instruction does not prevent you
>> to use script and an XSLT processor API on the server to apply
>> different stylesheet as you like or want.

>
> In some cases using trivial xml file for tying xsl and xml may help.
>
><?xml-stylesheet type="text/xsl" href="myXSL.xsl"?>
><xml-file href="myXML.xml" />
>
> It will require your myXSL.xsl style-sheet to process myXML.xml file when
> processing xml-file.


I'm a little unsure what you mean. Is this something I could do without
server-side scripting?


--
-Toby
500 Nintendo Stars for trade: 2xWii Play
* * * * * * * * * * * * * * * * * * * * * * *
Add the word afiduluminag to the subject to circumvent my email filters.
 
Reply With Quote
 
Andrzej Adam Filip
Guest
Posts: n/a
 
      01-29-2007
Toby Newman <> writes:

> On 2007-01-27, Andrzej Adam Filip <> wrote:
>> Martin Honnen <> writes:
>>
>>> Toby Newman wrote:
>>>
>>>> If the following line, which dictates which XSL file should be
>>>> used to transform my XML document for me, is found *in the XML file
>>>> itself* then how can you use more than one XSL to present multiple views
>>>> of the same XML document?
>>>>
>>>> <?xml-stylesheet type="text/xsl" href="myXSL.xsl"?>
>>>
>>> The xml-stylesheet processing instruction is modelled after the HTML
>>> link element so it should allow you (in theory) to have several such
>>> processing instructions to suggest alternative stylesheets.
>>> However in reality for XSLT stylesheet I don't think any of the major
>>> desktop browsers like IE 6 and later, Mozilla/Firefox or Opera support
>>> that.
>>> On the other hand such a processing instruction does not prevent you
>>> to use script and an XSLT processor API on the server to apply
>>> different stylesheet as you like or want.

>>
>> In some cases using trivial xml file for tying xsl and xml may help.
>>
>><?xml-stylesheet type="text/xsl" href="myXSL.xsl"?>
>><xml-file href="myXML.xml" />
>>
>> It will require your myXSL.xsl style-sheet to process myXML.xml file when
>> processing xml-file.

>
> I'm a little unsure what you mean. Is this something I could do without
> server-side scripting?


xsl script/file can "parse" additional xml files except xml file with
xml-stylesheet so you can "reference" in your xml file additional xml
files for processing by your xsl using document function.

http://www.w3.org/TR/xslt#document
<quote>
12.1 Multiple Source Documents
Function: node-set document(object, node-set?)
The document function allows access to XML documents other than the
main source document.
</quote>

WARNING: I have not test how it is supported by "main browsers".

--
[pl>en: Andrew] Andrzej Adam Filip : :
Home site: http://anfi.homeunix.net/
 
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
Multiple XML documents in one XSL file as variables platinumplus000@gmail.com XML 4 11-24-2006 05:17 PM
XSL Question tp xsl:for-each and xsl:variable schaf@2wire.ch XML 1 05-27-2005 09:25 PM
Text files read multiple files into single file, and then recreate the multiple files googlinggoogler@hotmail.com Python 4 02-13-2005 05:44 PM
XSL: xform one XML file into multiple HTML files? Richard R. XML 1 11-08-2004 11:47 AM
Using One XSLT and multiple XML Problem (One is XML and another one is XBRL) loveNUNO XML 2 11-20-2003 06:47 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57