Re: [xsl] About validating post xsl

Subject: Re: [xsl] About validating post xsl
From: Mike Brown <mike@xxxxxxxx>
Date: Thu, 12 Dec 2002 12:21:12 -0700 (MST)
ARGEXT-GALASSI, DANIEL wrote:
> Should be valid and well formed too?

With an XSLT stylesheet, you direct an XSLT processor to create a logical,
abstract, DOM-like tree of data (the result tree).

During the construction of this tree, you have access to another tree (the
source tree) that was derived from a parsed XML document.

A typical XSLT processor will accept an unparsed XML document to be used for
the source tree, and an unparsed XML/XSLT document for the stylesheet. The
processor then invokes an XML parser to derive the source and stylesheet
trees. Then, it processes the root node of the source tree, using the best
matching template in the stylesheet tree (or a built-in template).  
Instructions in the stylesheet templates direct the processor to visit other
nodes in the source tree, and create new nodes in the result tree.

After the result tree is completed, it is typically emitted in some fashion.  
You can usually serialize it as a string of characters (Unicode, if passing
directly to another application, or encoded as bytes, if writing to a stream)  
in either
 -  well-formed XML,
 -  HTML 4, or
 -  plain text (no tags).

Sometimes you can emit it as a DOM object or a series of SAX events.

If you choose XML output, and have not used disable-output-escaping, the 
serialized result will be well-formed, always.

Whether or not the result is valid according to some DTD or schema depends
upon your stylesheet! You have total control, through your stylesheet, of
the logical contents of the output, which is what validation is concerned 
with.

Mike

-- 
  Mike J. Brown   |  http://skew.org/~mike/resume/
  Denver, CO, USA |  http://skew.org/xml/


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


Current Thread