SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Notices
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
XPath API for Java
Saxon on .NET
Extensibility
Saxon Extensions
| Introduction
| EXSLT Extensions
| Extension attributes (XSLT only)
» | Additional serialization parameters
| Extension functions
| Extension instructions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# The saxon:require-well-formed attribute

This attribute affects the handling of result documents that contain multiple top-level elements or top-level text nodes. The W3C specifications allow such a result document, even though it is not a well-formed XML document. It is, however, a well-formed external general parsed entity, which means it can be incorporated into a well-formed XML document by means of an entity reference.

The attribute `saxon:require-well-formed` is available, with values "yes" or "no". The default is "no". If the value is set to "yes", and a SAX destinations (for example a `SAXResult`, a `JDOMResult`, or a user-written `ContentHandler`) is supplied to receive the results of the transformation, then Saxon will report an error rather than sending a non-well-formed stream of SAX events to the `ContentHandler`. This attribute is useful when the output of the stylesheet is sent to a component (for example an XSL-FO rendering engine) that is not designed to accept non-well-formed XML result trees.

Note also that namespace undeclarations of the form `xmlns:p=""` (as permitted by XML Namespaces 1.1) are passed to the `startPrefixMapping()` method of a user-defined `ContentHandler` only if `undeclare-prefixes="yes"` is specified on `xsl:output`.

Next