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

multiple files to single file problem

Subject: multiple files to single file problem
From: "Ganesh Babu N" <nbabuganesh@xxxxxxxxx>
Date: Tue, 9 Dec 2008 18:55:58 +0530
 multiple files to single file problem
Hai All,

I am processing number of files recursively and getting title and
author information from them. I could able to get the title without
any problem as it will be one in a file. But When it coming to author
info I am getting strange results.

Sample XML:


<author-group>
<author><given-name>V.E.</given-name><surname>Blinov</surname></author>
<author><given-name>A.V.</given-name><surname>Bogomyagkov</surname></author>
<author><given-name>N.Yu.</given-name><surname>Muchnoi</surname></author>
<author><given-name>S.A.</given-name><surname>Nikitin</surname></author>
<author><given-name>I.B.</given-name><surname>Nikolaev</surname></author>
<author><given-name>A.G.</given-name><surname>Shamov</surname></author>
<author><given-name>V.N.</given-name><surname>Zhilich</surname>
<cross-ref refid="cor1"><sup>&#x204E;</sup></cross-ref>
<e-address type="email">zhilich@xxxxxxxxxx</e-address></author>
<affiliation><textfn>Budker Institute of Nuclear Physics, Novosibirsk,
Russia</textfn></affiliation><correspondence
id="cor1"><label>&#x204E;</label><text>Corresponding
author.</text></correspondence>
</author-group>

My XSL:

	<xsl:template match="/" name="main">
		<xsl:element name="cover-body">
			<xsl:for-each select="for $x in collection('file:///D:/cover/sample
xmls/pageall/else/nima?select=*.xml;recurse=yes;on-error=ignore')
return $x">
				<xsl:variable name="a" select="document(document-uri(/))"/>
				<xsl:element name="para">
					<xsl:element name="aid">
						<xsl:value-of select="$a/article/item-info/aid"/>
					</xsl:element>
					<xsl:element name="aug">
						<xsl:element name="author">
							<xsl:value-of select="$a/article/head/author-group/author/given-name"/>
							<xsl:text/>
							<xsl:value-of select="$a/article/head/author-group/author/surname"/>
						</xsl:element>
					</xsl:element>
					<xsl:element name="article">
						<xsl:value-of select="$a/article/head/title"/>
					</xsl:element>
				</xsl:element>
			</xsl:for-each>
		</xsl:element>
	</xsl:template>

Resultant output:

<aug><author>V.E. A.V. N.Yu. S.A. I.B. A.G. V.N. Blinov Bogomyagkov
Muchnoi Nikitin Nikolaev Shamov Zhilich</author></aug>

All the given-names are come first and surnames are next. Please help
me getting this result.

Required Output:

<aug>
<author>V.E. Blinov</author>
<author>A.V. Bogomyagkov</author>
<author>N.Yu. Muchnoi</author>
<author>S.A. Nikitin</author>
<author>I.B. Nikolaev</author>
<author>A.G. Shamov</author> and
<author>V.N. Zhilich</author>
</aug>

Regards,
Ganesh

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.