[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl, and different xml versions

Subject: Re: xsl, and different xml versions
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 15 Apr 2005 11:21:55 +0100
working with different xml versions
As others have commented you can not use xsl:import that way, also


>  <xsl:template match="/">
>    <xsl:if test="@version = '1'">   

match="/" matches the document root (ie the logical top of th edocument)
not the top level document element, root nodes never have attributes so
your test would always be false you need to test /*/@version.

An alternative (or addition0 to using version would be to use teh
stylesheet PI which is exactly for this use

Given the files

<?xml-stylesheet type="text/xsl" href="version1.xsl"/>
<report>
  <table foo="bar"/>
  <text value="sometext"/>
</report>

<?xml-stylesheet type="text/xsl" href="version2.xsl"/>
<report>
  <table foo="bar"/>
  <text value="sometext"/>
</report>

Any processor which supports xml-stylesheet will do what yuou want. This
includes, at least, Internet explorer, Mozilla and saxon (if given the -a flag)

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.