From: Michael Kay <mike@sa...> - 2007-04-30 20:19:04
There's no simple way of setting an option to do this.
It should be possible in principle using setSourceResolver(), but I don't
think this usage was envisaged and so it's not entirely surprising that it
should cause problems. I think you're right that in Sender.java there should
be a "return" after "send(newSource, next, isFinal);", but I don't think
that in itself will guarantee no loops, since the recursive call on send may
trigger a new call to the SourceResolver. I'll take a look at how to revise
the code and improve the documentation.
> -----Original Message-----
> From: saxon-help-bounces@...
> [mailto:saxon-help-bounces@...] On Behalf
> Of Tatu Saloranta
> Sent: 30 April 2007 20:48
> To: saxon-help@...
> Subject: [saxon] Trying to set default wrapDocument settings
> Now that I am trying to ensure that all DOMSources are
> wrapped as AugmentedSources (and with wrapDocument set to
> FALSE), I'm facing a minor (?) problem. Basically, I'd like
> avoid calling code (one that constructs Transformer and
> applies) from having to know anything about such wrapping. To
> do this, the obvious first place would be Saxon's
> TransformerFactoryImpl. Since it already takes a
> Configuration object, I was hoping to something like
> However, there doesn't seem to be a way to do this yet
> (unless I missed it). Could this be added? (I didn't see such
> a method in SaxonB-8.9).
> Now, missing a short-cut method, I thought that
> Configuration.resolveSource() might be the thing to override.
> However, trying to do that, I get into nasty infinite loop,
> when constructing AugmentSource for DOMSource. Is this to be
> expected (i.e. it's not to be used for things like this), or
> is there a minor bug in code (as in missing return statement
> after line 186)?
> And finally, is there another easy way to configure
> transformation factory to default to not wrapping DOMSource.
> -+ Tatu +-
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection
> around http://mail.yahoo.com
> This SF.net email is sponsored by DB2 Express Download DB2
> Express C - the FREE version of DB2 express and take control
> of your XML. No limits. Just data. Click to get it now.
> saxon-help mailing list
From: Tatu Saloranta <cowtowncoder@ya...> - 2007-04-30 20:24:15
--- Michael Kay <mike@...> wrote:
> There's no simple way of setting an option to do
> It should be possible in principle using
> setSourceResolver(), but I don't
> think this usage was envisaged and so it's not
> entirely surprising that it
> should cause problems. I think you're right that in
> Sender.java there should
> be a "return" after "send(newSource, next,
> isFinal);", but I don't think
> that in itself will guarantee no loops, since the
> recursive call on send may
> trigger a new call to the SourceResolver. I'll take
> a look at how to revise
> the code and improve the documentation.
I think that I will probably have to wrap Templates
object, to return wrapped Transformers, and then
within wrapping transform() construct AugmentedSource.
This should work, it's just bit more work (and couple
of not very useful wrappers). But it would allow me to
isolate xslt implementation details into just one
place, where shared TransformerFactory gets
instantiated and configured.
-+ Tatu +-
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around