Subject: Re: [xsl] General algorithm for finding nodes between PIs From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 27 Jan 2017 15:06:49 -0000 |
Thanks for the reply. What I really want is this:
Input:
<?xml version="1.0" encoding="UTF-8"?> <info> <?Fm Condstart VbV-VCO?> <p>For this, use <b>that </b>to do that.</p> <p>Another paragraph</p> <?Fm Condend VbV-VCO?> <p><?Fm Condstart USB?>If you need this, do that.<?Fm Condend USB?></p> <p>Outside paragraph.</p> </info>
Output:
<?xml version="1.0" encoding="UTF-8"?> <info> <p platform="VbV-VCO">For this, use <b>that </b>to do that.</p> <p platform="VbV-VCO">Another paragraph</p> <p platform="USB">If you need this, do that.</p> <p>Outside paragraph.</p> </info>
The basic logic is this: given a "Condstart" processing instruction:
* If the first sibling is an element, then assign an attribute to all following sibling elements up to the corresponding Condend processing instruction.
* If the first sibling is a text node, then assign an attribute to the parent of the Condstart processing instruction.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] General algorithm for fin, Rick Quatro rick@xxx | Thread | Re: [xsl] General algorithm for fin, Rick Quatro rick@xxx |
Re: [xsl] General algorithm for fin, Rick Quatro rick@xxx | Date | Re: [xsl] General algorithm for fin, Rick Quatro rick@xxx |
Month |