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

Re: Include another XSL

  • From: Vadim Permyakov <vadimpermyakov@h...>
  • To: billinfo@s..., xml-dev@l...
  • Date: Wed, 31 Oct 2001 11:49:00 -0500

include js file in xsl
Hi Bill,
I did it using separate .js file, I think it is easier:

<?xml version="1.0"?>

<!DOCTYPE transform [
  <!ENTITY nbsp "&#160;">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

<xsl:template match="/">
  <html>
    <head>
      <title>MedCoder. The coding tool for professionals.</title>
      <meta content="text/html; charset=windows-1252" 
http-equiv="Content-Type"/>
      <script language="JavaScript" 
src="/medcoder/lib/medcoder.js"></script>
      <link rel="stylesheet" type="text/css" href="/medcoder/lib/xsl.css"/>
    </head>
    <body>
      <xsl:apply-templates select="response"/>
      <xsl:apply-templates select="error"/>
    </body>
  </html>
</xsl:template>

...

Regards,
Vadim
SoftCorporation LLC.


>From: BillGong <billinfo@s...>
>To: "xml.org" <xml-dev@l...>
>Subject:  Include another XSL
>Date: Tue, 30 Oct 2001 00:25:09 -0600
>
>Hi, there,
>
>I want to seperate my JavaScript code into another XSL file(foo.xsl, for 
>instance),
>rather than the one(main.xsl, for instance) I used to transforming XML into 
>SVG.
>
>Some code is like below:
>
>1.foo.xsl
><?xml version="1.0" encoding="UTF-8"?>
><xsl:stylesheet 	version="1.0"
>				xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>				xmlns:fo="http://www.w3.org/1999/XSL/Format"
>				xmlns:msxsl="urn:schemas-microsoft-com:xslt"
>				xmlns:foo="http://www.foo.com/"
>				extension-element-prefixes="msxsl" >
>
><msxsl:script 	language="javascript"
>				implements-prefix="foo"><![CDATA[
>
>				function DoOnLoad(evt)
>				{
>				}
>
>]]></msxsl:script>
></xsl:stylesheet>
>
>2.main.xsl
><?xml version="1.0" encoding="UTF-8"?>
><xsl:stylesheet version="1.0"
>				xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>				xmlns:foo="http://www.foo.com/"
>				xmlns:fo="http://www.w3.org/1999/XSL/Format">
>
>	<xsl:include href="foo.xsl"/>
>	<xsl:output method="xml"
>				indent="yes"
>				doctype-public="-//W3C//DTD SVG 20000303 Stylable//EN"
>				doctype-system="http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd" 
>				version="1.0"
>				encoding="ISO-8859-1"/>
>
>	<xsl:strip-space elements="*"/>
>
>	<xsl:template match="/">
>		<xsl:apply-templates select="demo"/>
>	</xsl:template>
>
>	<xsl:template match="demo">
>		<svg width="600" height="400" viewBox="0 0 600 400" xml:space="preserve" 
>onload="foo:DoOnLoad( evt )">
>			<desc/>
>			<g id="contents">
>				<rect id="bg" x="0" y="0" width="600" height="400" 
>style="fill:#96b1da"/>
>				<text style="font-size:18; text-anchor:middle" x="290" y="20">
>					<xsl:value-of select="Caption"/>
>				</text>
>				<xsl:apply-templates select="device"/>
>			</g>
>		</svg>
>	</xsl:template>
></xsl:stylesheet>
>
>But in main.xsl, the onload="foo:DoOnLoad( evt )" doesn't work.
>Anybody here know the reason? Very thanks.
>
>--Bill
>
>
>
>-----------------------------------------------------------------
>The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
>initiative of OASIS <http://www.oasis-open.org>
>
>The list archives are at http://lists.xml.org/archives/xml-dev/
>
>To subscribe or unsubscribe from this elist use the subscription
>manager: <http://lists.xml.org/ob/adm.pl>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.