複数の要素と兄弟のテキストノードを1つの要素として結合するための提案が必要です。下記のサンプルのxref要素を参照してください。複数の要素を1つの要素として結合する
Input: <section><p>These pages are all about XSLT, an XML-based language <xref ref-type="bibr" rid="r1">1</xref><xref ref-type="bibr" rid="r2"/>--<xref ref-type="bibr" rid="r3">3</xref> for translating one set of XML into another set of XML, <xref ref-type="bibr" rid="r3">3</xref>, <xref ref-type="bibr" rid="r5">5</xref><xref ref-type="bibr" rid="r6"/>--<xref ref-type="bibr" rid="r7">7</xref> or into HTML. Of course, there are all sorts of other pages <xref ref-type="bibr" rid="r1">7</xref>, <xref ref-type="bibr" rid="r3">8</xref> around that cover XSLT. <xref ref-type="bibr" rid="r12">12</xref>, <xref ref-type="bibr" rid="r15">15</xref><xref ref-type="bibr" rid="r16"/><xref ref-type="bibr" rid="r17"/><xref ref-type="bibr" rid="r18"/><xref ref-type="bibr" rid="r19"/>--<xref ref-type="bibr" rid="r20">20</xref></p></section>
Output: <section><p>These pages are all about XSLT, an XML-based language <xref ref-type="bibr" rid="r1 r2 r3">1--3</xref> for translating one set of XML into another set of XML, <xref ref-type="bibr" rid="r3 r5 r6 r7">3, 5--7</xref> or into HTML. Of course, there are all sorts of other pages <xref ref-type="bibr" rid="r7 r8">7, 8</xref> around that cover XSLT. <xref ref-type="bibr" rid="r12 r15 r16 r17 r18 r19 r20">12, 15--20</xref></p></section>
マージは文字(、)スペースをカンマまたは()スペースまたは場合にのみ起こるはず( - )2つのハイフンまたは空外部参照要素(<xref ref-type="bibr" rid="r2"/>
)は外部参照要素わたってるしき表示されます。
E.g.
Input content: <xref ref-type="bibr" rid="r3">3</xref>, <xref ref-type="bibr" rid="r5">5</xref><xref ref-type="bibr" rid="r6"/>--<xref ref-type="bibr" rid="r7">7</xref>
Expected ouput: <xref ref-type="bibr" rid="r1 r2 r3">1--3</xref>
おかげで、よろしく バラXSLT 2.0を使用して
のようなアプローチを使用することができますあなたはマージしたいときとそうでないときにマージしたい。 'xref'要素のいくつかは隣接していますが、いくつかはテキストノードで区切られています。マージしたいテキストはどれですか? '--'と'、 'のみです。または任意の句読点? –