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

Re: How to create multiple Html files considering att

Subject: Re: How to create multiple Html files considering attribute values in XML
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Sat, 20 Aug 2011 19:34:54 +0200
Re:  How to create multiple Html files considering  att
Sanjaya Liyanage wrote:
Hi all,
    I want to create multiple Html files considering attribute values in XML.

My XML

<School>

<Student age="17">
<firstname>kasun</firstname>
<lastname>lakpriya<lastname>
</Student>
<Student age="17">
<firstname>thiwanka</firstname>
<lastname>somasiri</lastname>
</Student>
<Student age="20">
<firstname>eshan</firstname>
<lastname>sudharaka</lastname>
</Student>
<Student id="20">
<firstname>haritha</firstname>
<lastname>tennakoon</lastname>
</Student>
<School>

    I want to generate two html files and each should contain the
details of students with same age.(here one html for students with age
17 and the other for age 20).How can I implement this in XSLT?Any help
is welcome.Thank you

XSLT 2.0 as implemented by Saxon 9, AltovaXML, XQSharp can create multiple output files e.g.
<xsl:template match="/">
<xsl:for-each-group select="School/Student" group-by="@age">
<xsl:result-document href="Students-aged-{current-grouping-key()}.xml">
<Students>
<xsl:copy-of select="current-group()"/>
</Students>
</xsl:result-document>
</xsl:for-each-group>
</xsl:template>





--


	Martin Honnen --- MVP Data Platform Development
	http://msmvps.com/blogs/martin_honnen/

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.