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

Re: Combining two files

Subject: Re: Combining two files
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Sun, 12 Dec 2010 00:42:43 +0000
Re:  Combining two files
On 12/12/2010 00:31, Mark wrote:
I actually wrote this several years ago when I was just learning XSLT. Since it worked, I moved on to tougher problems. I am embarrassed to ask, but what is it I donbt understand? I could not get these two files combined without doubling one of them until I used bdummy.xmlb (an empty xml file) in the bat file command line:

You haven't said what else you tried, so it's hard to tell you why it didn't work. Not sure what you mean by "without doubling one of them". If you don't want a dummy input file you can always change match="/*" on this template to name="main", and set -it:main on the command line. And delete the "* |" from the select, which doesn't seem to be doing anything useful.


Michael Kay
Saxonica


java -jar c:\Users\HP\saxon\saxon9.jar dummy.xml xslt\40Combine.xsl > work\40Combined.xml


My style sheet 40Combine.xsl consists of a single template:

<xsl:template match="/*">
<xsl:copy>
<xsl:copy-of select="* | document('../work/22Authors.xml')/*/*" copy-namespaces="no"/>
<xsl:copy-of select="* | document('../work/35Subjects.xml')/*/*" copy-namespaces="no"/>
</xsl:copy>
</xsl:template>




22Authors.xml contains:
<List>
<Item>
<Heading entry="author"> Tabor, South Dakota. Chamber of Commerce </Heading>
<Article>
<Title>Czech days stamp cancellation</Title>
<IssueName>May/Jun</IssueName>
<Year>2007</Year>
<Page>22</Page>
<IssueNumber>3</IssueNumber>
</Article>
<Article>
<Title>Czech days stamp cancellation</Title>
<IssueName>May/Jun</IssueName>
<Year>2008</Year>
<Page>2</Page>
<IssueNumber>3</IssueNumber>
<Comment>
<Article>
<Person>Dennis Povondra</Person>
<Title>Philatelic news and views</Title>
<IssueName>May/Jun</IssueName>
<IssueNumber>3</IssueNumber>
<Year>2008</Year>
<Page>27</Page>
</Article>
</Comment>
</Article>
</Item>
<!bmany more items b>
</List


35Subjects.xml contains a similar set of items:
<List>
<Item>
<Heading id="A1" entry="subject"> TC!bor, Bohemia</Heading>
<Level1>
<SubDiv1 id="A1-2" catalog="1" scott-number="716" pofis-number="849">1955</SubDiv1>
<Article>
<Person>Bulletin of the Ministry of Posts</Person>
<Title>New issues [Title varies or absent]</Title>
<IssueName>Nov</IssueName>
<IssueNumber>9</IssueNumber>
<Year>1955</Year>
<Page>134</Page>
</Article>
</Level1>
</Item>
<!bmany more items b>
</List>


Thanks,
Mark

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.