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

RE: Generating an XSL from an XML

Subject: RE: Generating an XSL from an XML
From: "bryan" <bry@xxxxxxxxxx>
Date: Tue, 14 May 2002 16:23:14 +0200
xmlns xslt
Remy wrote
>For examplee, i wanted to use an xml defining a format, and generate
the
>default xsl stylesheet able to parse an xml using that format into a
text
>file.
>I was inquisitive to know whether there were another option than using
a
><![CDATA section for every XSL instruction i wanted to generate, so
that >the parser didn't try to execute them.

Associate your xslt elements with another namespace prefix, as follows

<xsl:stylesheet 
    xmlns:asl="http://www.w3.org/1999/XSL/Transform" version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
      xmlns:xslt=http://www.some.com/xsl >

then you can say the following:
<xsl:namespace-alias stylesheet-prefix="xslt" result-prefix="xsl"/>

<asl:template match="/">
	<xslt:stylesheet>
 <asl:apply-templates/></xslt:stylesheet>
</asl:template>
<asl:template match="params">
<asl:for-each select="p">
<xslt:param name="{.}" select="{@value}"/>
</asl:for-each>
</asl:template>

I like this because you can keep separate your stylesheet generating
stuff asl: from your stylesheet stuff xslt: 

Depending on your processor your output will either have all the xslt
changed to xsl, or you'll have something like this(in Saxon for example)

<xslt:stylesheet
 xmlns:xslt=" http://www.w3.org/1999/XSL/Transform" version="1.0">
....and so forth





 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.