Re: Aggregating results: hints wanted

Dear Wendell,

In addition to what Geert proposed, you might find the following example 
useful that uses XSLT steps in order to combine (and transform) document 
fragments:
https://github.com/gimsieke/epubcheck-xproc/blob/master/xproc/kindle.xpl#L47

epub:htmlreport 
(https://github.com/gimsieke/epubcheck-xproc/blob/master/xproc/epub.xpl#L530) 
accepts a sequence of documents as inputs and assembles them by XSLT. 
The individual documents contain XHTML body fragments which are rendered 
reports of individual checks: epub:basic and epub:spinehtml.
(Of course you may assemble another intermediate format than HTML that 
you distilled from your individual SVRLs.)

Note that the assembly will be performed by an XSLT that accepts 
multiple documents (a sequence) as input. These documents will be 
available as the default collection in the stylesheet: 
https://github.com/gimsieke/epubcheck-xproc/blob/master/xsl/assemble-reports.xsl#L78

The epub:basic step, whose rendered report will be combined with the 
rendered Schematron report, also involves combining the outputs (of 3 
individual basic validation steps) to one single HTML. This is performed 
by another XSLT stylesheet.

The sole purpose of the p:for-each 
(https://github.com/gimsieke/epubcheck-xproc/blob/master/xproc/basic.xpl#L54) 
is to create a sequence that will be slurped by the XSLT of 
epub:render-plain-reports 
(https://github.com/gimsieke/epubcheck-xproc/blob/master/xproc/epub.xpl#L498) 
using the default collection in another XSL: 
https://github.com/gimsieke/epubcheck-xproc/blob/master/xsl/plain-html-report.xsl#L19

That’s how I did that. Maybe combining the fragments by p:wrap-sequence 
and then transforming the result would have been the cleaner approach.

Caveat: This experimental XProc EPUB checker has been my playground to 
learn XProc. We are currently redesigning it as a more generic framework 
to test and convert XML-based document formats such as IDML, OOXML, ODF, 
XHTML, …

Gerrit


On 2012-01-25 21:29, Wendell Piez wrote:
> Hi,
>
> Not having quite the time to give to XProc as I'd like, I'm fumbling
> along and managing mostly, but occasionally need some advice. (Honestly,
> I feel the way many XSLT newbies must. I get the general idea, but the
> core concepts -- to say nothing of specific aspects of its design -- are
> just not embedded well enough into my brain for me to have much
> confidence that I'm thinking about it right.)
>
> My current problem is as follows: I have a pipeline of XSLT
> transformations (it's actually twelve steps long), which works well, but
> I would also like to intervene at points with Schematron validation. I
> get how I can capture the results of a validation (its 'report' port)
> while the input, having been validated, can go on to the next step in
> the pipeline.
>
> However, I'd like to do this with several discrete Schematrons operating
> on the results of several of my XSLT steps, but bundle all their reports
> together into a single result (which I might then process with more XSLT).
>
> (I know this may seem odd, but the pipeline is a sort of upconversion
> from arbitrary inputs, and I'm trying to detect problems in the input at
> the time when they are easiest to detect.)
>
> I can see how I could use p:pack to pack two of them together, but what
> if I have more than two?
>
> Do I have to use p:pack repeatedly? (And perhaps p:unwrap to unwrap the
> wrappers that get introduced every time I pack?)
>
> I imagine there must be a more graceful way, and would be grateful for
> any advice or corrections.
>
> Cheers,
> Wendell
>
> ======================================================================
> Wendell Piez mailto:wapiez@mulberrytech.com
> Mulberry Technologies, Inc. http://www.mulberrytech.com
> 17 West Jefferson Street Direct Phone: 301/315-9635
> Suite 207 Phone: 301/315-9631
> Rockville, MD 20850 Fax: 301/315-8285
> ----------------------------------------------------------------------
> Mulberry Technologies: A Consultancy Specializing in SGML and XML
> ======================================================================
>

-- 
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit.imsieke@le-tex.de, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler

Received on Wednesday, 25 January 2012 21:23:40 UTC