The documentation on that page says that the XdmNode produced by a
DocumentBuilder "might also contain a stylesheet or a schema which can then
be used as input to the XsltCompiler or the SchemaManager." I'm not quite
sure how you read this as instructing you to do it this way: there are cases
when it's useful, but it's not normally necessary. If the source is in a
file then the simplest way to supply the stylesheet is by calling the
Compile method supplying the file directly. The DocumentBuilder is usually
used only for source documents (i.e. the transformation input).
> Is the second way required for compiling the transform and
> the first way for not compiling the transform?
No, the XsltTransform object that is produced is the same either way.
er.html references JAXP for building a URIResolver, but what > about if
you're using the .NET version of Saxon? I
> understand it's possible to create a System.Xml.XmlResolver
> if I use the DocumentBuilder approach, but how do I add a
> URIResolver if I want to precompile the transform (which, I
> assume, requires the NewXsltCompiler approach)?
The information on the cited page is Java-specific. The XmlResolver on .NET
works in much the same way, except that the same resolver object can be used
at both the XML parsing and XSLT transformation levels.
The XsltCompiler object has an XmlResolver property. This can be used to set
an XmlResolver which will be used to resolve URI references occurring in
xsl:include and xsl:import declarations. This is used regardless of which
overload of the Compile() method you use.