[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xml-dev] Include another XSL
- From: Vadim Permyakov <vadimpermyakov@hotmail.com>
- To: billinfo@sina.com, xml-dev@lists.xml.org
- Date: Wed, 31 Oct 2001 11:49:00 -0500
Hi Bill,
I did it using separate .js file, I think it is easier:
<?xml version="1.0"?>
<!DOCTYPE transform [
<!ENTITY nbsp " ">
]>
<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@sina.com>
>To: "xml.org" <xml-dev@lists.xml.org>
>Subject: [xml-dev] 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