Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 24th, 2010, 07:57 PM
Registered User
 
Join Date: Jun 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default creating a publication (or book) from multiple XML files

I have a question regarding how to combine multiple files into a single publication, or book.

To start with, I will have five different XSL-FO styles sheets (right now three are complete) for these XML files (of varying numbers), depending on which schema validates them. Now, these files when combined will comprise a document. They are referenced in what is a "publication module". This is just another XML file that gives the identifying information (not including file extension) for each of the XML files that make up that publication.

I am not sure how I should go about using this "publication module" to assemble a book. As it is now, each stylesheet for each different schema type has it's own headers and footers, which need to remain as is, but further information will need to be added, such as the publication number and so on.

I have done some reading regarding the use of the document() function, but am not sure if this the correct route to take. Should I create a stylesheet that includes the other stylesheets and uses this function?

If anyone has any ideas, or has come into a similar situation, the help will be very appreciated.

Thank you
 
Old June 26th, 2010, 06:42 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

If you are using a "publication module" like in s1000d than the document() function works great. I use a "Pipe Line" methodology. I write my xslt to process all my files into a temporary document or multiply temporary documents, then covert them to xsl-fo, then send them through a xsl-fo processor.

Something like this:

Code:
<xsl:variable name="tempDoc">
	<xsl:for-each select="document('some.xml')">
		<xsl:for-each select="root">
			<xsl:element name="newRoot">
				<xsl:copy>
					<xsl:copy-of select="@*"/>
					<xsl:apply-templates/>
				</xsl:copy>
			</xsl:element>
		</xsl:for-each>
	</xsl:for-each>
</xsl:variable>
<xsl:value-of select="$tempDoc/newRoot"/>
 
Old June 26th, 2010, 12:33 PM
Registered User
 
Join Date: Jun 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

S1000D is exactly what I am working with. So, to make sure I followed what you are saying. You read each XML file, based on the publication module, into a new document, and ten convert that to FO and then process?
 
Old June 26th, 2010, 01:36 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Exactly. You will have some challenges processing the <refdm>s that are not required in your publication module. Also, resolving xrefs across data modules when the author uses duplicate @ids.

Fun stuff... Email me directly with any S1000D question.

Regards,

Phil

Last edited by bonekrusher; June 26th, 2010 at 01:43 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to process multiple input xml files with a single xslt ? Divya XSLT 12 October 9th, 2018 03:01 AM
downloading the wrox publication book njyothi82 J2EE 3 July 26th, 2007 12:04 AM
grouping multiple xml files in one file bcogney XSLT 3 April 21st, 2006 03:58 AM
Importing Multiple files in Multiple tables Versi Suomi Access 6 June 1st, 2005 08:47 AM
Multiple XML files matched with common Number Id gurbani XSLT 3 June 23rd, 2004 05:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.