Re: TreeInfo from Source?
Martynas Jusevičius <martynas-tyFqBaoSXPC1Z/[email protected]>
| Newsgroups | gmane.text.xml.saxon.help |
|---|---|
| Message-ID | <CAE35VmzyAnmbdn08xUKEz=SY5w0F8Yf_uBCsUPQ-7NFh+5QaLg@mail.gmail.com> |
OK, I found xsltProc.getUnderlyingConfiguration().buildDocumentTree(). On Tue, Sep 1, 2020 at 11:00 PM Martynas Jusevičius <[email protected]> wrote: > > Hi, > > I want to use the "Preloading shared reference documents" feature with > Saxon-HE 10.1: > http://saxonica.com/html/documentation/sourcedocs/preloading.html > > More specifically, call config.getGlobalDocumentPool().add(doc, uri) > in order to avoid resolving the same document URIs again and again > during multiple transformations. > > Looking at the add() method I see it accepts a TreeInfo. Our code is > operating on Sources. Although TreeInfo extends Source, I cannot find > how it is constructed from one. None of the wrapper classes accept it. > Where should I look? > > That is how we currently build Source instances: > > try (ByteArrayOutputStream stream = new ByteArrayOutputStream()) > { > model.write(stream); > return new StreamSource(new > ByteArrayInputStream(stream.toByteArray()), systemId); > } > > > Martynas _______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ [email protected] https://lists.sourceforge.net/lists/listinfo/saxon-help