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

collection is not working

Subject: collection is not working
From: "Rahul Singh rahulsinghindia15@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 2 Apr 2018 16:38:57 -0000
 collection is not working
Hi,

I have 100 xml file which contains xml data with schemalocation namespace
in root element, i have written xslt to merge file name with schema name in
one file but i am not able to generate my output :

*Input: *
*aa.xml*
<?xml version="1.0" encoding="UTF-8"?>
*<article xsi:noSchemaLocation="aa.xsd">*
<name>aaas</name>
</article>


*bb.xml*
<?xml version="1.0" encoding="UTF-8"?>
*<article xsi:noSchemaLocation="bb.xsd">*
<name>ars</name>
</article>


*cc.xml*
<?xml version="1.0" encoding="UTF-8"?>
*<article> xsi:noSchemaLocation="cc.xsd"*
<name>tytu</name>
</article>


*Expected output:*

Filename  Schema name
aa.xml      aa.xsd
bb.xml      bb.xsd
cc.xml      cc.xsd


*code:*

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" xmlns:fo="
http://www.w3.org/1999/XSL/Format" xmlns:xs="
http://www.w3.org/2001/XMLSchema" xmlns:fn="
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/rahul/Downloads/ARB/ARB'"/>
    <xsl:template match="node()|@*">
        <xsl:copy>
            <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="/">
        <!--Generating Result Docuemnt-->
        <xsl:result-document href="Merged.xml" method="xml" indent="yes">
            <Articles>
                <xsl:for-each
select="collection(concat($DocumentsURI,'?select=*.xml;recurse=yes;on-error=ignore'))">
                    <xsl:apply-templates select="/article"/>
                </xsl:for-each>
            </Articles>
        </xsl:result-document>
    </xsl:template>
</xsl:stylesheet>

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.