[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How Best to Generate Result Documents from Nested

Subject: Re: How Best to Generate Result Documents from Nested Structures?
From: "Michael Sokolov msokolov@xxxxxxxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 25 May 2014 16:43:14 -0000
Re:  How Best to Generate Result Documents from Nested
What we do is to process the document in one pass, hierarchically, but storing the result documents in variables and inserting them *after* the recursion completes. Something like this:

<xsl:template match="*">
<xsl:variable name="doc">
<xsl:apply-templates />
<xsl:result-document href="..."><xsl:copy-of select="$doc" /></xsl:result:document>

On 5/25/2014 9:57 AM, Eliot Kimber ekimber@xxxxxxxxxxxx wrote:
The DITA for Publishers Word-to-DITA transformation framework takes as
input a DOCX document.xml file and produces as output one or more result
documents reflecting DITA maps and topics generated from the Word document.

The result documents come from a hierarchy, e.g., a map that references
topics using a hierarchy of nested links (topic references).

The way I've implemented this is to apply a series of transforms to the
DOCX that transforms the flat sequence of Word paragraphs into a hierarchy
of maps, topicrefs, and topics as a single XML document. From this
hierarchical document I then identify the result document boundaries,
still within a single XML document. Finally I process this "result
documents" document to generate each of the result documents. This
approach avoids the restriction on starting a new <xsl:result-document> in
the context of an existing <xsl:result-document>.

I'm in the midst of a significant refactor of this code and I'm wondering
if there's a better approach to this general problem of generating
multiple result documents from a hierarchy where the natural way to
process the hierarchy would be top-down, starting a new result document
for each descendant that generates one? This comes up in typical
"bursting" processes, where you're taking a single hierarchical XML
document and generating multiple result documents from it, reflecting the
hierarchy of the markup.

My approach has always been the above two-phase approach: process the
input document to produce a single-document result with the document
boundaries identified and then process that non-hierarchically in order to
produce the result documents.

This works fine but adds complexity to the business logic.

Is there some alternative approach that would be either less complex or
easier to understand or implement? How do other people address the
limitation on nested xsl:result-document?



Eliot Kimber, Owner
Contrext, LLC

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.