xsl-list
[Top] [All Lists]

[xsl] Is this a grouping task?

2019-10-22 13:07:26
Hi All,

 

Here is my input document:

 

<root>

    <topic id="idm140322603719792">

        <chgdesc revnbr="42">Content</chgdesc>

        <title line-break="0">Content</title>

        <revst/>

        <para>Content</para>

        <revend/>

        <para>Content</para>

        <revst/>

        <note>

            <para>Content</para>

        </note>

        <revend/>

        <para>Content</para>

        <revst/>

        <para>Content</para>

        <para>Content</para>

        <revend/>

    </topic>

</root>

 

In my output, I need to add an attribute to the sibling elements between the
<revst> and <revend> elements. Here is the desired output:

 

<root>

    <topic id="idm140322603719792">

        <chgdesc revnbr="42">Content</chgdesc>

        <title line-break="0">Content</title>

        <para rev="changed">Content</para>

        <para>Content</para>

        <note rev="changed">

            <para>Content</para>

        </note>

        <para>Content</para>

        <para rev="changed">Content</para>

        <para rev="changed">Content</para>

    </topic>

</root>

 

I am using XSLT 2 and think this may require a for-each-group solution. Any
advice would be appreciated. Thank you very much.

 

Rick

 

Rick Quatro

Carmen Publishing Inc.

rick(_at_)frameexpert(_dot_)com

585-729-6746

www.frameexpert.com/store/

 
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>