xsl-list
[Top] [All Lists]

Re: xsl, and different xml versions

2005-04-15 03:21:55

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
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>
  • Re: xsl, and different xml versions, David Carlisle <=