I'm facing the following case of XSL transformation.
I have this:
<content>
xml_and_text_0
<break/>
xml_and_text_1
<break/>
...
<break/>
xml_and_text_n
</content>
I want to use XSL 2.0 to turn the above XML into this:
<content>
<block>
xml_and_text_0
</block>
<block>
xml_and_text_1
</block>
...
<block>
xml_and_text_n
</block>
</content>
(I'd also like to ignore some_xml_and_text_k = '', but for the moment let's assume they're non-empty)
I'm thinking I could use an approach similar to [XPath : select all following siblings until another sibling, but maybe there is a simpler approach (or a simpler XPath expression). For instance, is it possible to match all the siblings following/preceding the current item in a for-each loop?
EDIT: Note that xml_and_text_i is a mix of text and XML, similarly to XHTML, which I want to wrap within , so something like:
<break/>
this is an <ref id = "123">example</ref>, which is really <citation>awesome</citation>
<break/>
would become:
<block>this is an <ref id = "123">example</ref>, which is really <citation>awesome</citation></block>