Hi Wendell,
you wrote:
"When one of your links is traversed, what document should load?"
I'd like the template referred to in the link to load when the "Orange"
link is traversed.
XML:
<Source>
<Orange enabled="true">
<Seeds enabled="true" />
</Orange>
<Apple enabled="false">
<Seeds enabled="false" />
</Apple>
<Pear enabled="true">
<Seeds enabled="true" />
</Pear>
<Grapes enabled="true">
<Seeds enabled="false" />
</Grapes>
</Source>
=====================================================
XSL:
<xsl:template match="/">
<html>
<head>
<title>Your settings</title>
</head>
<body>
<a href="options.xml#Orange">Orange settings</a>
<a href="options.xml#Apple">Apple settings</a>
<a href="options.xml#Pear">Pear settings</a>
<a href="options.xml#Grapes">Grapes settings</a>
</body>
</html>
</xsl:template>
<!-- Begin 2nd level node rules -->
<xsl:template match="Orange">
<html>
<head>
<title>My Orange settings</title>
</head>
<body>
<h2>These are the Orange settings:</h2>
<b>Enabled?</b>
<xsl:choose>
<xsl:when test="@enabled='true'">
<span style="color: Green"> yes</span>
</xsl:when>
<xsl:when test="@enabled='false'">
<span style="color: Blue"> no</span>
</xsl:when>
<xsl:otherwise>
<span style="color: Red"> invalid value</span>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<!-- Apple, Pear, and Grapes nodes would have similar formatting, with
each 2nd level template match, producing a well-formed XHTML page.-->
So, can I pass a template parameter to the XSL engine in either Mozilla
or Internet Explorer through an ordinary html <a href>, or in any other
way? I've looked at XLink and XPointer, but can't seem to make these
work for this problem using the XSL engines in these browsers.
Thanks.
Jesse Wiles
-----Original Message-----
From: Wendell Piez [mailto:wapiez(_at_)mulberrytech(_dot_)com]
Sent: Thursday, November 14, 2002 11:52 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] linking to and displaying xsl templates
Jesse,
When one of your links is traversed, what document should load?
In most architectures, the file loaded will be another HTML document,
which
may also happen to be created from XML source using a stylesheet (which
is
what you say you want to do). (The usual scenario runs the
transformations
on the server or in a batch process, and the browser never sees anything
but HTML. Perhaps this isn't your case?)
That is, the generated link points to a document you will generate --
not
to its XML sourcer (what you say you want), which resides in a separate
laye, nor to your stylesheet (what your code implies you want to do by
pointing to templates).
If you want to generate both a table of contents, and broken-out HTML
files
from a single XML source, and have all the links point correctly to each
other -- this is definitely possible with XSLT. XSLT is also capable of
describing transformations into formats suitable for other
architectures.
Please clarify?
Cheers,
Wendell
At 12:27 PM 11/14/2002, you wrote:
David Carlisle wrote:
"If you are making a table of contents don't you
want to point to the generated html documents?"
I don't want to point to generated html docs. Rather, I would like to
generate a XSL transformed html "document" with hyperlinks to fragments
(2nd level nodes) of the xml source document.
Specifically, our product uses an xml file to read user settings. The
options in this file include enabling and disabling buttons in our
application, settings colors and font options, and certain navigation
options. I want to make this document less cumbersome to read by
rendering it in html. It's a long document, so rather than rendering
it
in one long html file, I want to break it up into sections, or several
html pages. Can I do this using xsl?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
======================================================================
Wendell Piez
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list