XLST: is there a formal definition?

Pascal Sartoretti

Usenet Archive
Joined
Oct 13, 2000
Messages
23
Reaction score
0
Hello,

I am looking for a formal definition of XSLT. Either a DTD or an XML Schema, whatever. Is there such a thing ? There is for instance one for XML Schema itself at http://www.w3.org/2001/XMLSchema.dtd .

My problem is that I have a big set of XSLT files which may contain errors: for instance, use of XLST features that were only in the draft XSLT norm, but which Microsoft IE still supports. A DTD or XML Schema would greatly help me in checking the XSLT files.

Thanks for any help

Pascal
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
Pascal said:
I am looking for a formal definition of XSLT. Either a DTD or an XML Schema, whatever. Is there such a thing ? There is for instance one for XML Schema itself at http://www.w3.org/2001/XMLSchema.dtd .

My problem is that I have a big set of XSLT files which may contain errors: for instance, use of XLST features that were only in the draft XSLT norm, but which Microsoft IE still supports. A DTD or XML Schema would greatly help me in checking the XSLT files.

A DTD can't exist as an XSL stylesheet contains arbritray result elements, there is however a DTD fragment http://www.w3.org/TR/xslt#dtd
 

Pascal Sartoretti

Usenet Archive
Joined
Oct 13, 2000
Messages
23
Reaction score
0
Martin said:
A DTD can't exist as an XSL stylesheet contains arbritray result elements

Oops, you are right... However, would it be possible to define an XSLT transform that would scrap out all non-XSLT tags and then return a "pure" XSLT document, which could be checked against a DTD or XML schema?

Pascal
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
Pascal said:
Oops, you are right... However, would it be possible to define an XSLT transform that would scrap out all non-XSLT tags and then return a "pure" XSLT document, which could be checked against a DTD or XML schema?

I think such an XSLT stylesheet could be written.
As for an XML schema, that even allows you to define an element to have children in a different, abritrary namespace that are skipped during validation, an example for that is at http://www.webmethods.com/1999/XSL/Transform/ I have just found it through googling so I can't tell you how well it is written but at least the comments at the beginning indeed suggest that validation is skipped for abritrary result elements.
 

Patrick TJ McPhee

Usenet Archive
Joined
Apr 2, 2000
Messages
269
Reaction score
0
% > A DTD can't exist as an XSL stylesheet contains arbritray result % > elements % % Oops, you are right... However, would it be possible to define an XSLT % transform that would scrap out all non-XSLT tags and then return a % "pure" XSLT document, which could be checked against a DTD or XML schema?

You could just copy all the elements in the xslt name space:

<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'> <xsl:template match='xsl:*|@*'> <xsl:copy> <xsl:apply-templates select='node|@*'/> </xsl:copy> </xsl:template>

<xsl:template match='*'>
<xsl:apply-templates match='node|@*'/>
</xsl:template>
</xsl:stylesheet>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,798
Members
249,594
Latest member
henrywalsh

Latest Threads

Top