xsl-list
[Top] [All Lists]

Re: [xsl] group-starting-with and ending with

2020-03-08 06:56:43
Hi Byomokesh,

On Fri, Mar 6, 2020 at 12:17 PM Byomokesh Sahoo 
sahoo(_dot_)byomokesh(_at_)gmail(_dot_)com <
xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:


Here is my XML

<a><x>To</x> Test, <bb>Test1</bb>, <bb>Test2</bb>, <cc>Test3</cc>,
<dd>USA</dd></a>

Desired Output

<a><x>To</x> Test, <st><bb>Test1</bb>, <bb>Test2</bb></st>,
<cc>Test3</cc>, <dd>USA</dd></a>


You seem to want to, enclose a sequence of nodes delimited by structures
<bb>..</bb> and <bb>..</bb> with an element "st". My questions are as
follows,
Within your XML input document, can there be only one such sequence than
needs to be enclosed by an element "st"? If yes, then the solution could be
simple and shouldn't involve using XSLT instructions like
xsl:for-each-group.

Also I think, if you could have schema documents for your XML input and
output documents,then it could be possible to avoid lot of logic, error
handling etc with the XSLT stylesheet itself. When using the schema
documents for an XSLT transformation, lot of static/dynamic errors can be
emitted by the XML Schema validator that runs in-process the XSLT
transformation (that otherwise, you'd need to program in your XSLT
stylesheet when not using the schema documents).




-- 
Regards,
Mukul Gandhi
--~----------------------------------------------------------------
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>