xsl-list
[Top] [All Lists]

RE: merging the contents of consecutive duplicate elements

2005-10-17 15:47:18
Yes, it can be done (search for "positional grouping"). But the code for
doing it depends rather on the content model for the parent element of
"info". It also depends on whether you're using 1.0 or 2.0.

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: Annmarie Rubin (anrubin) [mailto:anrubin(_at_)cisco(_dot_)com] 
Sent: 17 October 2005 23:36
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Cc: Annmarie Rubin (anrubin)
Subject: [xsl] merging the contents of consecutive duplicate elements

Hello list,
 
I haven't found this in the archives. I have XML that can contain
duplicate, consecutive elements with different contents, for example:
 
<info>
      <para>text A </para>
      <note>note A </note>
 </info>
 <info>
      <para>text B</para>
      <note>note B</note>
      <para>text C</para>
  </info>
 
Is there a way to do the following:
 
merge the contents of the duplicate elements into a single 
info element,
for example:
 
<info>
    <para>text A</para>
    <note>note A</note>
    <para>text B</para>
    <note>note B</note>
    <para>text C</para> 
</info>
 
Thanks,
 
Ann Marie
 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>