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

Re: A Query

Subject: Re: A Query
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 26 Jul 1999 20:13:00 -0400
xslt gupta
At 99/07/26 15:56 -0700, Anupam Gupta wrote:
>Query:
>-------
>How do you generate a XSL stylesheet by applying a stylesheet to a XML
>document ?

By escaping the namespace of the output XSLT instructions so the XSLT
engine doesn't get confused between what you are asking it to do and what
you are asking it to put to the result tree.

Without this mechanism, there would be no way to tell the difference
between an instruction to be acted on and an instruction to be emitted.

This escaping mechanism can be applied any number of times (stylesheets for
stylesheets for stylesheets etc.)

>Process:
>--------
>
>XML + XSL ==> XSL
>                                + XML (Another One) ===> HTML

A terse example is below.

Note how the "xslo" namespace URI is prefaced with "quote:" which is
removed on output by the XSLT engine.  With it removed, it is recognized
the second time around.

I hope this helps.

........... Ken

p.s. please note that I changed "html" to be "hmtl" so that my mailer
wouldn't eat the markup and *help* me by displaying the HTML; the
principles of what I'm trying to show are unchanged.

T:\FTEMP>type xsl.xsl
<?xml version="1.0"?><!--xsl.xsl-->
<!--XSLT Working Draft 1999-07-09 - http://www.CraneSoftwrights.com-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
                indent-result="yes">

<xsl:template match="/">                          <!--root rule-->
  <xslo:stylesheet xmlns:xslo="quote:http://www.w3.org/XSL/Transform/1.0">
    <xslo:template match="/">
      <hmtl>             <!--I made this is a typo because of my mailer-->
        <p>Hello world</p>
      </hmtl>
    </xslo:template>
  </xslo:stylesheet>
</xsl:template>

</xsl:stylesheet>

T:\FTEMP>call xsl xsl.xsl xsl.xsl xslo.xsl
T:\FTEMP>type xslo.xsl
<xslo:stylesheet xmlns:xslo="http://www.w3.org/XSL/Transform/1.0">
<xslo:template match="/">
<hmtl>
<p>Hello world</p>
</hmtl>
</xslo:template>
</xslo:stylesheet>

T:\FTEMP>call xsl xsl.xsl xslo.xsl xslo.htm
T:\FTEMP>type xslo.htm
<hmtl><p>Hello world</p></hmtl>
T:\FTEMP>


--
G. Ken Holman                    mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.             http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999   (Fax:-0995)
Website:  XSL/XML/DSSSL/SGML services, training, libraries, products.
Publications:   Introduction to XSLT (3rd Edition) ISBN 1-894049-00-4
Next instructor-led training:   MS'99 1999-08-16  MT'99 1999-12-05/06


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.