여러 요소와 형제 텍스트 노드를 단일 요소로 병합하려면 제안이 필요합니다. 아래에 언급 된 샘플에서 xref 요소를 참조하십시오.여러 요소를 단일 요소로 병합
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>
병합 현상이 발생하는 경우에만 문자 (,) 공간 또는() 공백이나와 쉼표 (-) 두 개의 하이픈 또는 빈 외부 참조 요소 (<xref ref-type="bibr" rid="r2"/>
가) 외부 참조 요소 inbetween 나타납니다.
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>
감사합니다 감사합니다 발라
같은 방법을 사용할 수 있습니다
for-each-group select="node()" group-adjacent="boolean(self::xref | self::text()[matches(., $pattern)]
를 사용하여 인접 노드를 찾을 때 규칙을 설명 할 수 병합하고 싶을 때와 병합하고 싶을 때. 'xref' 요소 중 일부는 인접하지만 일부는 텍스트 노드로 구분됩니다. 병합하고자하는 텍스트는 어느 것이고, 단지'--'와','입니까? 아니면 구두점이 있습니까? –