xsl-list
[Top] [All Lists]

Re: [xsl] processing multiple documents concatenated into one

2018-06-03 07:03:54
Well, sadly enough the input stream is of the second kind (having all the xml 
declarations inside) 
We are preprocessing the input now before we parse 

Thanks for the suggestions 


Best regards, 

Geert Bormans 

-------------------------------------------------------------- 
Markup UK - a conference about XML and other mark-up languages 
London, June 9–10 2018 
Programme now available at [ http://markupuk.org/speakers.xhtml | 
http://markupuk.org/speakers.xhtml ] 
Register at [ http://markupuk.org/registration.xhtml | 
http://markupuk.org/registration.xhtml ] 


Van: "Abel Braaksma, (Exselt) abel(_at_)exselt(_dot_)net" 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> 
Aan: "xsl-list" <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com> 
Verzonden: Dinsdag 29 mei 2018 09:59:49 
Onderwerp: Re: [xsl] processing multiple documents concatenated into one 

If the file is in the form 

<root> 
.... 
</root> 
<root> 
.... 
</root> 

then you should be able to present to the XML parser a skeleton document of the 
form 

<!DOCTYPE dummy [ 
<!ENTITY x "multidoc.xml"/>] 
<dummy>&x;</dummy> 

and the XSLT stylesheet will just see this is a normal standard (and 
streamable) XML input. 

If however the file is in the form 

<?xml version="1.0"?> 
<root> 
.... 
</root> 
<?xml version="1.0"?> 
<root> 
.... 
</root> 

then you have a bit more work to do, because this isn't a well formed external 
entity. Assuming Java, you will need to write an implementation of the Java 
InputStream class that filters the input document and removes the XML 
declarations, and present this InputStream as the input to the XML parser. 

Michael Kay 
Saxonica 




On 29 May 2018, at 07:49, Geert Bormans [ 
mailto:geert(_at_)gbormans(_dot_)telenet(_dot_)be | 
geert(_at_)gbormans(_dot_)telenet(_dot_)be ] < [ 
mailto:xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com | 
xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com ] > wrote: 

All, 

I am (using XSLT3 streaming) processing files that are occasionaly a 
concatenation of multiple XML files 
Before I start cutting documents apart before processing, 
I wondered, maybe there is an XSLT streaming solution all the way. 
Any ideas 


Best regards, 

Geert Bormans 

-------------------------------------------------------------- 
Markup UK - a conference about XML and other mark-up languages 
London, June 9–10 2018 
Programme now available at [ http://markupuk.org/speakers.xhtml | 
http://markupuk.org/speakers.xhtml ] 
Register at [ http://markupuk.org/registration.xhtml | 
http://markupuk.org/registration.xhtml ] 
[ http://www.mulberrytech.com/xsl/xsl-list | 
XSL-List info and archive ] 
[ https://mail.telenet.be/zimbra/-list/293509 | EasyUnsubscribe ] ( [ 
https://mail.telenet.be/zimbra/mail?null=&client=advanced | by email ] ) 




[ http://www.mulberrytech.com/xsl/xsl-list | 
XSL-List info and archive ] 
[ -list/554170 | EasyUnsubscribe ] ( [  | by email ] ) 
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>