Meta XSL

Subject: Meta XSL
From: Toivo Lainevool <tlainevool@xxxxxxxxx>
Date: Sun, 28 Feb 1999 16:28:11 -0800 (PST)
I am trying to use XSL to generate an XSL stylesheet.  I call
this a meta-XSL stylesheet. I thought that since XSL is valid XML,
this should be possible, but I am having one small 
problem.  If I have a meta-XSL file that looks like this:

<meta-xsl:stylesheet xmlns:xsl="foo"
                xmlns:meta-xsl="http://www.w3.org/TR/WD-xsl";
result-ns="">
<meta-xsl:template match='/'>
   <xsl:stylesheet>
   <html><body>test</body></html>
   </xsl:stylesheet>
</meta-xsl:template>
</meta-xsl:stylesheet>

Running XT on this with any XML file generates the following output:

<xsl:stylesheet
xmlns:xsl="foo"><html><body>test</body></html></xsl:stylesheet>

The problem is I need the "xmlsn:xsl" attribute of the stylesheet
element 
in the output to be "http://www.w3.org/TR/WD-xsl"; instead of "foo".

If I try to specify the URI in the meta-XSL stylesheet like this:

<meta-xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl";
                xmlns:meta-xsl="http://www.w3.org/TR/WD-xsl";
result-ns="">

XT tries to interpret the "xsl" elements in the meta-XSL file as 
valid XSL so it fails.

I know I could run the produced XSL through a quick post-processing step
to add in the right string into the attribute, but I am trying to find a
"pure" XSL solution.

I can get a stylesheet produced that uses the default namespace.  If I
use:

<meta-xsl:stylesheet 
                xmlns:meta-xsl="http://www.w3.org/TR/WD-xsl";
result-ns="">
<meta-xsl:template match='/'>
   <meta-xsl:element name="stylesheet">
   <meta-xsl:attribute
name="xmlns">http://www.w3.org/TR/WD-xsl</meta-xsl:attribute>
   <html><body>test</body></html>
   </meta-xsl:element>
</meta-xsl:template>
</meta-xsl:stylesheet>

XT produces:
<stylesheet
xmlns="http://www.w3.org/TR/WD-xsl";><html><body>test</body></html>
</stylesheet>

Which when itself run through XT fails because the HTML elements are now
in the wrong namespace.  If I could get a XSL stylesheet that use the 
default namespace to specify xsl elements and still produce valid HTML,
it would be a step in the right direction.

There is a thread going on in the list about the use of the result-ns
attribute,
would it make sense to be able to specify "xsl" as the result type of
an xsl transformation?

Any help with this would be greatly appreciated.

As a side note, it is interesting to think about trying to be able to 
produce _any_ valid XML document via XSL, and this case being the
proof of Godel's Incompleteness Theorem for XSL.

Thanks,

Toivo Lainevool




_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com


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


Current Thread
  • Meta XSL
    • Toivo Lainevool - Sun, 28 Feb 1999 16:28:11 -0800 (PST) <=
      • <Possible follow-ups>
      • James Tauber - Mon, 1 Mar 1999 12:38:15 +0800