[Top] [All Lists]

Re: [xsl] xsl:for-each in Corresp Tag

2020-02-12 19:15:08

I looked at the example and I wonder if much of it, if not everything,
could not be accomplished with good old-fashioned template matching,
no use of for-each whatsoever.

Byomokesh have you tried <xsl:apply-templates/> and if not, why not?
It will probably do most if not everything you need, much more easily
than the "pull" you have in your example (which is what we call this
kind of xsl:for-each).

Regards, Wendell

Regards, Wendell

On Wed, Feb 12, 2020 at 12:45 PM Martin Honnen 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

On 12.02.2020 18:06, Byomokesh Sahoo 
sahoo(_dot_)byomokesh(_at_)gmail(_dot_)com wrote:

I am facing difficulty to get required output in different structure of
<corres>. Find the below three types of tagging structure.

Not getting exact output if apply <xsl:for-each> on below three type of

Desired Output

<corresp><x>Correspondence to</x> Anne Marie Darling,
<institution><department>Department of Epidemiology</department>,
<institution-name>Boston University</institution-name></institution>,
<street>715 Albany Street</street>, <country>USA</country>;

<corresp><x>Correspondence to</x> Anne Marie Darling,
<institution><department>Department of Epidemiology</department>,
<postal-code>02118</postal-code>, <country>USA</country>;

<corresp>Joanne Lawrence, Association of British Neurologists, Ormond
House, 27 Boswell Street, London WC1N 3JZ, UK;

Kindly suggest.

Please also tell us whether you can use XSLT 2 or 3 as it looks to me
you want to wrap some adjacent nodes or nodes starting with a certain
elements into an "institution" element, such task are usually easier
with XSLT 2/3 and for-each-group group-starting-with or group-adjacent,
even if the mixed content you have will make it harder than using a
simple for-each-group.

...Wendell Piez... ...wendell -at- nist -dot- gov...
...wendellpiez.com... ...pellucidliterature.org... ...pausepress.org...
...github.com/wendellpiez... ...gitlab.coko.foundation/wendell...
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>