Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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
Reply With Quote
  #2 (permalink)  
Old June 26th, 2010, 06:42 AM
Friend of Wrox
Points: 1,676, Level: 16
Points: 1,676, Level: 16 Points: 1,676, Level: 16 Points: 1,676, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: , , .
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"/>
Reply With Quote
  #3 (permalink)  
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?
Reply With Quote
  #4 (permalink)  
Old June 26th, 2010, 01:36 PM
Friend of Wrox
Points: 1,676, Level: 16
Points: 1,676, Level: 16 Points: 1,676, Level: 16 Points: 1,676, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: , , .
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..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:21 PM.


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