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

Re: Collection is not working for Bulk XML

Subject: Re: Collection is not working for Bulk XML
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 8 Jun 2018 16:49:32 -0000
Re:  Collection is not working for Bulk XML
Please don't tell us your code "isn't working" - tell us how it fails. That's
how we diagnose problems - we look at the symptoms. Without symptoms, it's
like telling your doctor you don't feel well without saying where it hurts.

Tell us precisely what you did, and precisely what happened.

Michael Kay
Saxonica

> On 8 Jun 2018, at 17:44, Rahul Singh rahulsinghindia15@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Hi,
>
> I have bulk XML's and stored in directory C:/Users/1289568903/Desktop/Data
as below:
>
> a.xml:
>
> 	<?xml version="1.0" encoding="UTF-8"?>
> 	<mailInfoData>
> 	<mailInfo>rahuls@xxxxxxxxx <mailto:rahuls@xxxxxxxxx></mailInfo>
> 	</mailInfoData>
>
> b.xml:
>
> 	<?xml version="1.0" encoding="UTF-8"?>
> 	<mailInfoData>
> 	<mailInfo>rahult@xxxxxxxxx <mailto:rahult@xxxxxxxxx></mailInfo>
> 	</mailInfoData>
>
> c.xml:
>
> 	<?xml version="1.0" encoding="UTF-8"?>
> 	<mailInfoData>
> 	<mailInfo>rahulc@xxxxxxxxx <mailto:rahulc@xxxxxxxxx></mailInfo>
> 	</mailInfoData>
>
> I need output as below from all xml:
>
> <mailCollect>
> 	a.xml <mailInfo>rahuls@xxxxxxxxx <mailto:rahuls@xxxxxxxxx></mailInfo>
> 	b.xml <mailInfo>rahult@xxxxxxxxx <mailto:rahult@xxxxxxxxx></mailInfo>
> 	c.xml <mailInfo>rahulc@xxxxxxxxx <mailto:rahulc@xxxxxxxxx></mailInfo>
> </mailCollect>
>
> And below is my XSL code but collection is not working:
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform
<http://www.w3.org/1999/XSL/Transform>"
xmlns:fo="http://www.w3.org/1999/XSL/Format
<http://www.w3.org/1999/XSL/Format>"
xmlns:xs="http://www.w3.org/2001/XMLSchema <http://www.w3.org/2001/XMLSchema>"
xmlns:fn="http://www.w3.org/2005/xpath-functions
<http://www.w3.org/2005/xpath-functions>">
> 	<xsl:output method="xml" indent="yes"/>
> 	<xsl:strip-space elements="*"/>
> 	<xsl:param name="DocumentsURI"
select="'file:///C:/Users/1289568903/Desktop/Data'"/>
> 	<xsl:template match="node()|@*">
> 		<xsl:copy>
> 			<xsl:apply-templates select="node()|@*"/>
> 		</xsl:copy>
> 	</xsl:template>
> 	<xsl:template match="/">
> 		<xsl:result-document href="Merged.xml" method="xml" indent="yes">
> 			<mailCollect>
> 				<xsl:for-each
select="collection(concat($DocumentsURI,'?select=*.xml;recurse=yes;on-error=i
gnore'))">
> 					<xsl:apply-templates select="/mailInfo"/>
> 				</xsl:for-each>
> 			</mailCollect>
> 		</xsl:result-document>
> 	</xsl:template>
> </xsl:stylesheet>
>
>
> Thanks.
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <-list/293509> (by email <>)

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.