Quantcast

asking for advice to simplify an stylesheet (XSLT 3.0 in streaming mode)

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

asking for advice to simplify an stylesheet (XSLT 3.0 in streaming mode)

Max-Gerd Retzlaff
Hello,

I'm contacting you for advice for a better solution to the following task:

I'm processing XML-Files > 4 GB with XSLT 3.0 in streaming mode using
Saxon-EE 9.7.0.10J from Saxonica as processor. The task is to extract
sections of a main document in separate files, and creating a new
shorter main document that contains stub nodes that just reference the
extracted sub-trees in the separate files.


I achieved a solution, but compared to XSLT in non-streaming mode
I seem to have to jump trough a lot of hoops; I cannot simply have
several matching statements since as soon as I introduce them,
Saxon complains about multiple consuming operands:

> Static error at xsl:template on line 15 column 36 of split.xsl:
>   XTSE3430: Template rule is declared streamable but it does not
>    satisfy the streamability rules.
>  * There is more than one consuming operand: {xsl:apply-templates}
>    on line 16, and {xsl:apply-templates} on line 17
> Errors were reported during stylesheet compilation

On http://www.saxonica.com/html/documentation/sourcedocs/streaming/xslt-streaming.html
I've read that 'xsl:choose' is an exception:

> A construct is "consuming" if it reads a subtree of the source
> document, that is, if it makes a downwards selection from the
> context item. In general, constructs are not allowed to have two
> operands that are both consuming. Some exceptions to this are: the
> xsl:fork instruction; conditional expressions such as xsl:choose if
> each branch only contains one consuming expression; the map
> expression map{...} in XPath and the xsl:map instruction in XSLT.

But even when I follow this approach, I still have to take care not to
have the construct 'consume' multiple times in a single branch (as
stated in the above text extract), and so I cannot simply compare
nodes to select an 'xsl:when' branch as this is also already
considered to be a 'consuming' expression.


I ended up fabricating a solution using 'xsl:choose', which does the
job, and produces the desired result. The only problem is that it
doesn't feel right: I now have conditional expressions based on string
comparison of node names and I have to recreate nodes from their node
names and attributes. By this, the code got significantly longer and
more complicated than a non-streaming implementation would have been.

But apart from this it works, and it takes about 3m 30s for a 4.5 GB
file (on a Intel i7-6700 CPU with 3.40GHz), which is okay.

The key question is: Is there a better way to make this task work?
The existing solution seems to be overly complicated.

Attached please find a full example, containing the documented XSLT code
(split-example.xsl), the input file (input.xml), and resulting output
files (output.xml, chapter-1.xml, and chapter-2.xml).

Thank you and cheers,
Max

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 

split-example.xsl (3K) Download Attachment
input.xml (770 bytes) Download Attachment
output.xml (738 bytes) Download Attachment
chapter-1.xml (172 bytes) Download Attachment
chapter-2.xml (172 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: asking for advice to simplify an stylesheet (XSLT 3.0 in streaming mode)

Martin Honnen-2
On 09.11.2016 11:30, Max-Gerd Retzlaff wrote:


> Attached please find a full example, containing the documented XSLT code
> (split-example.xsl), the input file (input.xml), and resulting output
> files (output.xml, chapter-1.xml, and chapter-2.xml).

Can you post the original, non-streaming XSLT sample as well?

As for the input, what makes it so large, does it have thousands of
'chapter' elements in a single 'book', or are there also several 'book'
elements?

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: asking for advice to simplify an stylesheet (XSLT 3.0 in streaming mode)

Martin Honnen-2
In reply to this post by Max-Gerd Retzlaff
On 09.11.2016 11:30, Max-Gerd Retzlaff wrote:

> I'm processing XML-Files > 4 GB with XSLT 3.0 in streaming mode using
> Saxon-EE 9.7.0.10J from Saxonica as processor. The task is to extract
> sections of a main document in separate files, and creating a new
> shorter main document that contains stub nodes that just reference the
> extracted sub-trees in the separate files.

Assuming a single 'chapter' is small enough not to cause any memory
problems an approach like

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:math="http://www.w3.org/2005/xpath-functions/math"
        exclude-result-prefixes="xs math"
        version="3.0">
       
        <xsl:mode streamable="yes" on-no-match="shallow-copy"/>
       
        <xsl:template match="chapter">
                <xsl:variable name="this-chapter" select="copy-of()"/>
                <xsl:copy select="$this-chapter">
                        <xsl:copy-of select="@*"/>
                </xsl:copy>
                <xsl:result-document href="chapter-{@number}.xml">
                        <xsl:copy-of select="$this-chapter"/>
                </xsl:result-document>
        </xsl:template>
       
</xsl:stylesheet>

should do.


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: asking for advice to simplify an stylesheet (XSLT 3.0 in streaming mode)

Martin Honnen-2
On 09.11.2016 12:20, Martin Honnen wrote:

> On 09.11.2016 11:30, Max-Gerd Retzlaff wrote:
>
>> I'm processing XML-Files > 4 GB with XSLT 3.0 in streaming mode using
>> Saxon-EE 9.7.0.10J from Saxonica as processor. The task is to extract
>> sections of a main document in separate files, and creating a new
>> shorter main document that contains stub nodes that just reference the
>> extracted sub-trees in the separate files.
>
> Assuming a single 'chapter' is small enough not to cause any memory
> problems an approach like
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:math="http://www.w3.org/2005/xpath-functions/math"
> exclude-result-prefixes="xs math"
> version="3.0">
>
> <xsl:mode streamable="yes" on-no-match="shallow-copy"/>
>
> <xsl:template match="chapter">
> <xsl:variable name="this-chapter" select="copy-of()"/>
> <xsl:copy select="$this-chapter">
> <xsl:copy-of select="@*"/>
> </xsl:copy>
> <xsl:result-document href="chapter-{@number}.xml">
> <xsl:copy-of select="$this-chapter"/>
> </xsl:result-document>
> </xsl:template>
>
> </xsl:stylesheet>
>
> should do.


As an alternative, for the test case the following use of xsl:fork also
does the job for me with Saxon 9.7 EE:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:math="http://www.w3.org/2005/xpath-functions/math"
        exclude-result-prefixes="xs math"
        version="3.0">
       
        <xsl:mode streamable="yes" on-no-match="shallow-copy"/>
       
        <xsl:template match="chapter">
                <xsl:fork>
                        <xsl:sequence>
                                <xsl:copy>
                                        <xsl:copy-of select="@*"/>
                                </xsl:copy>
                        </xsl:sequence>
                        <xsl:sequence>
                                <xsl:result-document href="chapter-{@number}.xml">
                                        <xsl:copy-of select="."/>
                                </xsl:result-document>
                        </xsl:sequence>
                </xsl:fork>
        </xsl:template>
       
</xsl:stylesheet>



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: asking for advice to simplify an stylesheet (XSLT 3.0 in streaming mode)

Michael Kay
In reply to this post by Max-Gerd Retzlaff
I think it's as simple as this:

<?xml version="1.0"?>
<xsl:stylesheet version="3.0"
               xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output indent="yes"/>

   <xsl:mode streamable="yes" on-no-match="shallow-copy"/>

   <xsl:template match="chapter">
     <xsl:copy>
       <xsl:copy-of select="@*"/>
       <xsl:result-document href="{concat('chapter-', @number, '.xml')}">
         <xsl:copy-of select="."/>
       </xsl:result-document>
     </xsl:copy>
   </xsl:template>

</xsl:stylesheet>

Michael Kay
Saxonica


> On 9 Nov 2016, at 10:30, Max-Gerd Retzlaff <[hidden email]> wrote:
>
> Hello,
>
> I'm contacting you for advice for a better solution to the following task:
>
> I'm processing XML-Files > 4 GB with XSLT 3.0 in streaming mode using
> Saxon-EE 9.7.0.10J from Saxonica as processor. The task is to extract
> sections of a main document in separate files, and creating a new
> shorter main document that contains stub nodes that just reference the
> extracted sub-trees in the separate files.
>
>
> I achieved a solution, but compared to XSLT in non-streaming mode
> I seem to have to jump trough a lot of hoops; I cannot simply have
> several matching statements since as soon as I introduce them,
> Saxon complains about multiple consuming operands:
>
>> Static error at xsl:template on line 15 column 36 of split.xsl:
>> XTSE3430: Template rule is declared streamable but it does not
>>  satisfy the streamability rules.
>> * There is more than one consuming operand: {xsl:apply-templates}
>>  on line 16, and {xsl:apply-templates} on line 17
>> Errors were reported during stylesheet compilation
>
> On http://www.saxonica.com/html/documentation/sourcedocs/streaming/xslt-streaming.html
> I've read that 'xsl:choose' is an exception:
>
>> A construct is "consuming" if it reads a subtree of the source
>> document, that is, if it makes a downwards selection from the
>> context item. In general, constructs are not allowed to have two
>> operands that are both consuming. Some exceptions to this are: the
>> xsl:fork instruction; conditional expressions such as xsl:choose if
>> each branch only contains one consuming expression; the map
>> expression map{...} in XPath and the xsl:map instruction in XSLT.
>
> But even when I follow this approach, I still have to take care not to
> have the construct 'consume' multiple times in a single branch (as
> stated in the above text extract), and so I cannot simply compare
> nodes to select an 'xsl:when' branch as this is also already
> considered to be a 'consuming' expression.
>
>
> I ended up fabricating a solution using 'xsl:choose', which does the
> job, and produces the desired result. The only problem is that it
> doesn't feel right: I now have conditional expressions based on string
> comparison of node names and I have to recreate nodes from their node
> names and attributes. By this, the code got significantly longer and
> more complicated than a non-streaming implementation would have been.
>
> But apart from this it works, and it takes about 3m 30s for a 4.5 GB
> file (on a Intel i7-6700 CPU with 3.40GHz), which is okay.
>
> The key question is: Is there a better way to make this task work?
> The existing solution seems to be overly complicated.
>
> Attached please find a full example, containing the documented XSLT code
> (split-example.xsl), the input file (input.xml), and resulting output
> files (output.xml, chapter-1.xml, and chapter-2.xml).
>
> Thank you and cheers,
> Max
> <split-example.xsl><input.xml><output.xml><chapter-1.xml><chapter-2.xml>------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi_______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: asking for advice to simplify an stylesheet (XSLT 3.0 in streaming mode)

Max-Gerd Retzlaff
In reply to this post by Martin Honnen-2
Hi Martin,

Thanks for your reply.

On Wed, Nov 9, 2016 at 12:09 PM, Martin Honnen <[hidden email]> wrote:
> Can you post the original, non-streaming XSLT sample as well?

I actually didn't have one. But I've written a simple version that you'll
find attached. It's just a general identity transformation plus a special
rule for "/example-file/book/chapter". XSLT 3.0 is actually not necessary
for it.

> As for the input, what makes it so large, does it have thousands of
> 'chapter' elements in a single 'book', or are there also several 'book'
> elements?

There might be some few 'book' elements containing each a couple of
hundred 'chapter' elements. But these 'chapters' are big. They contain
a couple of thousand sub-elements. These sub-elements, let's call them
'paragraphs', can reach in total over the whole book more than a million,
and each containing some hundred 'lines', to stay in this example.

So my book.xml has a size of 4,5 GB, and I get 134 chapter files
of sizes in the range of 54 to 64 MB.

Okay?

Cheers,
Max

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 

split-example-non-streaming.xsl (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: asking for advice to simplify an stylesheet (XSLT 3.0 in streaming mode)

Martin Honnen-2
On 09.11.2016 14:19, Max-Gerd Retzlaff wrote:

> On Wed, Nov 9, 2016 at 12:09 PM, Martin Honnen <[hidden email]> wrote:
>> Can you post the original, non-streaming XSLT sample as well?
>
> I actually didn't have one. But I've written a simple version that you'll
> find attached. It's just a general identity transformation plus a special
> rule for "/example-file/book/chapter". XSLT 3.0 is actually not necessary
> for it.

See Mike's answer, for streaming it does not need any special treatment
other than a streaming XSLT 3.0 processor like Saxon 9.7 EE and is the
XSLT 3.0 version of your identity transformation plus a chapter template.


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: asking for advice to simplify an stylesheet (XSLT 3.0 in streaming mode)

Max-Gerd Retzlaff
In reply to this post by Max-Gerd Retzlaff
Hi,

On Wed, Nov 9, 2016 at 2:19 PM, Max-Gerd Retzlaff
<[hidden email]> wrote:
>> Can you post the original, non-streaming XSLT sample as well?
>
> I actually didn't have one. But I've written a simple version that you'll
> find attached.
> [...]
> So my book.xml has a size of 4,5 GB, and I get 134 chapter files
> of sizes in the range of 54 to 64 MB.

and, just for the fun of it, this is what happens if I start the non-streaming
version on the 4,5 GB xml file after not even 13 seconds: :)

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at net.sf.saxon.tree.tiny.TinyTree.ensureNodeCapacity(TinyTree.java:227)
    at net.sf.saxon.tree.tiny.TinyTree.addNode(TinyTree.java:349)
    at net.sf.saxon.tree.tiny.TinyBuilder.startElement(TinyBuilder.java:239)
    at net.sf.saxon.event.NamespaceReducer.startElement(NamespaceReducer.java:74)
    at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:305)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:380)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2787)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:118)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
    at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:451)
    at net.sf.saxon.event.Sender.send(Sender.java:179)
    at net.sf.saxon.Configuration.buildDocumentTree(Configuration.java:3808)
    at net.sf.saxon.s9api.DocumentBuilder.build(DocumentBuilder.java:369)
    at net.sf.saxon.Transform.processFile(Transform.java:1213)
    at net.sf.saxon.Transform.doTransform(Transform.java:795)
    at net.sf.saxon.Transform.main(Transform.java:77)

Cheers,
Max

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: asking for advice to simplify an stylesheet (XSLT 3.0 in streaming mode)

Max-Gerd Retzlaff
In reply to this post by Michael Kay
Hello Michael Kay,

On Wed, Nov 9, 2016 at 12:39 PM, Michael Kay <[hidden email]> wrote:
> I think it's as simple as this:

Yes. Wonderful. Thank you. Good to know 'on-no-match="shallow-copy"'.

The 'xsl:copy' recreates the node itself, then attributes are copied,
which creates the stub 'chapter' nodes. Also, this is a perfect space
to add other attributes to actually refer to the created files. Good.

Thanks,
Max

> <?xml version="1.0"?>
> <xsl:stylesheet version="3.0"
>                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>    <xsl:output indent="yes"/>
>
>    <xsl:mode streamable="yes" on-no-match="shallow-copy"/>
>
>    <xsl:template match="chapter">
>      <xsl:copy>
>        <xsl:copy-of select="@*"/>
>        <xsl:result-document href="{concat('chapter-', @number, '.xml')}">
>          <xsl:copy-of select="."/>
>        </xsl:result-document>
>      </xsl:copy>
>    </xsl:template>
>
> </xsl:stylesheet>
>
> Michael Kay
> Saxonica
>
>
>> On 9 Nov 2016, at 10:30, Max-Gerd Retzlaff <[hidden email]> wrote:
>>
>> Hello,
>>
>> I'm contacting you for advice for a better solution to the following task:
>>
>> I'm processing XML-Files > 4 GB with XSLT 3.0 in streaming mode using
>> Saxon-EE 9.7.0.10J from Saxonica as processor. The task is to extract
>> sections of a main document in separate files, and creating a new
>> shorter main document that contains stub nodes that just reference the
>> extracted sub-trees in the separate files.
>>
>>
>> I achieved a solution, but compared to XSLT in non-streaming mode
>> I seem to have to jump trough a lot of hoops; I cannot simply have
>> several matching statements since as soon as I introduce them,
>> Saxon complains about multiple consuming operands:
>>
>>> Static error at xsl:template on line 15 column 36 of split.xsl:
>>> XTSE3430: Template rule is declared streamable but it does not
>>>  satisfy the streamability rules.
>>> * There is more than one consuming operand: {xsl:apply-templates}
>>>  on line 16, and {xsl:apply-templates} on line 17
>>> Errors were reported during stylesheet compilation
>>
>> On http://www.saxonica.com/html/documentation/sourcedocs/streaming/xslt-streaming.html
>> I've read that 'xsl:choose' is an exception:
>>
>>> A construct is "consuming" if it reads a subtree of the source
>>> document, that is, if it makes a downwards selection from the
>>> context item. In general, constructs are not allowed to have two
>>> operands that are both consuming. Some exceptions to this are: the
>>> xsl:fork instruction; conditional expressions such as xsl:choose if
>>> each branch only contains one consuming expression; the map
>>> expression map{...} in XPath and the xsl:map instruction in XSLT.
>>
>> But even when I follow this approach, I still have to take care not to
>> have the construct 'consume' multiple times in a single branch (as
>> stated in the above text extract), and so I cannot simply compare
>> nodes to select an 'xsl:when' branch as this is also already
>> considered to be a 'consuming' expression.
>>
>>
>> I ended up fabricating a solution using 'xsl:choose', which does the
>> job, and produces the desired result. The only problem is that it
>> doesn't feel right: I now have conditional expressions based on string
>> comparison of node names and I have to recreate nodes from their node
>> names and attributes. By this, the code got significantly longer and
>> more complicated than a non-streaming implementation would have been.
>>
>> But apart from this it works, and it takes about 3m 30s for a 4.5 GB
>> file (on a Intel i7-6700 CPU with 3.40GHz), which is okay.
>>
>> The key question is: Is there a better way to make this task work?
>> The existing solution seems to be overly complicated.
>>
>> Attached please find a full example, containing the documented XSLT code
>> (split-example.xsl), the input file (input.xml), and resulting output
>> files (output.xml, chapter-1.xml, and chapter-2.xml).
>>
>> Thank you and cheers,
>> Max
>> <split-example.xsl><input.xml><output.xml><chapter-1.xml><chapter-2.xml>------------------------------------------------------------------------------
>> Developer Access Program for Intel Xeon Phi Processors
>> Access to Intel Xeon Phi processor-based developer platforms.
>> With one year of Intel Parallel Studio XE.
>> Training and support from Colfax.
>> Order your platform today. http://sdm.link/xeonphi_______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
>
> ------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: asking for advice to simplify an stylesheet (XSLT 3.0 in streaming mode)

Max-Gerd Retzlaff
In reply to this post by Martin Honnen-2
Martin,

On Wed, Nov 9, 2016 at 2:25 PM, Martin Honnen <[hidden email]> wrote:
>> I actually didn't have one. But I've written a simple version that you'll
>> find attached. It's just a general identity transformation plus a special
>> rule for "/example-file/book/chapter". XSLT 3.0 is actually not necessary
>> for it.
>
> See Mike's answer, for streaming it does not need any special treatment
> other than a streaming XSLT 3.0 processor like Saxon 9.7 EE and is the
> XSLT 3.0 version of your identity transformation plus a chapter template.

Thank you for your several mails well. It was the identity transformation,
now superfluous as of 'on-no-match' of 'xml:mode' in XSLT 3.0, that broke
streamability:

> Static error at xsl:template on line 11 column 36 of split-example-non-streaming.xsl:
>   XTSE3430: Template rule is declared streamable but it does not satisfy the streamability rules.
>   * In a streaming apply-templates instruction, the select expression cannot select
>   descendant elements (that is, it must not have crawling posture)
> Errors were reported during stylesheet compilation

Cheers, Max

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: asking for advice to simplify an stylesheet (XSLT 3.0 in streaming mode)

Martin Honnen-2
On 09.11.2016 16:09, Max-Gerd Retzlaff wrote:

> Thank you for your several mails well. It was the identity transformation,
> now superfluous as of 'on-no-match' of 'xml:mode' in XSLT 3.0, that broke
> streamability:
>
>> Static error at xsl:template on line 11 column 36 of split-example-non-streaming.xsl:
>>   XTSE3430: Template rule is declared streamable but it does not satisfy the streamability rules.
>>   * In a streaming apply-templates instruction, the select expression cannot select
>>   descendant elements (that is, it must not have crawling posture)
>> Errors were reported during stylesheet compilation

Yes, if you look at
https://www.w3.org/XML/Group/qtspecs/specifications/xslt-30/html/#built-in-templates-shallow-copy 
then you can see that the apply-templates is separated into

<xsl:template match="." mode="M">
   <xsl:copy validation="preserve">
     <xsl:apply-templates select="@*" mode="M"/>
     <xsl:apply-templates select="node()" mode="M"/>
   </xsl:copy>
</xsl:template>

instead of the classical

   apply-templates select="@* | node()"




------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Loading...