Sign In/My Account | View Cart  
advertisement

Article:
 Grouping With XSLT 2.0
Subject: Issue in grouping with XSLT 2.0
Date: 2005-03-23 01:17:11
From: dearlk

I am trying to group the content in my xml file as shown below using XSLT 2.0 but not getting the desired output also shown below.


Any help from anybody would be great for me.


Thank you.


----------------------------------------
Source XML
+++++++++++++++++++++++++
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<Story>
<chaptertitle>Chapter name</chaptertitle>
<para>This is a para</para>
<para>This is a para</para>
<sectiontitle>Section name</sectiontitle>
<para>This is a para</para>
<para>This is a para</para>
<subsectiontitle>Subsection name</subsectiontitle>
<para>This is a para</para>
<articletitle>Article name</articletitle>
<para>This is a para</para>
<para>This is a para</para>
<articletitle>Article name</articletitle>
<para>This is a para</para>
<sectiontitle>Section name</sectiontitle>
<para>This is a para</para>
<para>This is a para</para>
</Story>
</Root>


+++++++++++++++++++++++++++++
Desired Output
++++++++++++++++++++++++++++++


<?xml version="1.0" encoding="UTF-8"?>


<chapter>


<chaptertitle>Chapter name</chaptertitle>


<para>This is a para</para>


<para>This is a para</para>


<section>


<sectiontitle>Section name</sectiontitle>


<para>This is a para</para>


<para>This is a para</para>


<subsection>


<subsectiontitle>Subsection name</subsectiontitle>


<para>This is a para</para>


<article>


<articletitle>Article name</articletitle>


<para>This is a para</para>


<para>This is a para</para>


</article>


<article>


<articletitle>Article name</articletitle>


<para>This is a para</para>


</article>


</subsection>


</section>


<section>


<sectiontitle>Section name</sectiontitle>


<para>This is a para</para>


<para>This is a para</para>


</section>


</chapter>




Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Newest First
  • Issue in grouping with XSLT 2.0
    2005-03-23 05:17:58 Bob DuCharme [Reply]

    In general, the XSL-list at http://www.mulberrytech.com/xsl/xsl-list/ is the best place to get answers about problems with specific stylesheets and source files. Many people, including leading XSLT experts, will see your questions very quickly there.

Sponsored By: