1
내가있는 XML을 구조 다음재구성 노드
<xml>
<object context="3-cumulative" >
<metadata>
<ref cite="4.2" relevance="first.2"/>
</metadata>
<body>
<para>
<text>
applicable on and after December 14,2007.
</text>
</para>
</body>
</object>
<object context="1-cumulative" >
<metadata>
<ref cite="4.2" relevance="first.1"/>
</metadata>
<body>
<para>
<text>
applicable on and after December 14,2006.
</text>
</para>
</body>
</object>
<object context="1-cumulative" >
<metadata>
<related-content-ref cite="5 annuity" relevance="first.1"/>
</metadata>
<body>
<para>
<text>
applicable on and after December 14, 2008
</text>
</para>
</body>
</object>
<mainbody>
<num cite="4.2">4.2</num>
<num cite="2" type="para">2</num>
<heading>Stock exchanges</heading>
<prov-body>
<text>
Notwithstanding the provisions of a convention ... as defined in the
<italic>Income Tax Act</italic>.
</text>
<prov>
<num cite="1 annuity"/>
<num cite="5 annuity"/>
<num cite="3 annuity"/>
<heading>“annuity”</heading>
<text>
<term>“annuity”</term>does not include any pension payment ...
</text>
<text>
any pension payment ...
</text>
</prov>
</prov-body>
</mainbody>
</xml>
내가 필요로하는 모든 객체/메타 데이터/심판/@ "mainbody"에서 발견 된 인용한다 경우 NUM/@ 인용 및 객체/@ 컨텍스트가 ' 1 누적 '이면 객체의 para/text는 첫 번째 텍스트 노드의 끝에 복사해야하며 object/metadata/ref/@ relevance로 정렬해야합니다. 또는 "mainbody"에서 object/metadata/ref/@ cite가 발견 된 경우 num/@ cite와 object/@ context가 '3-cumulative'이면 객체의 para/text는 자신의 텍스트 요소가있는 첫 번째 Text 노드 뒤에 복사해야하며 객체/메타 데이터/ref/@ 관련성별로 정렬해야합니다.
출력은 다음과 같아야합니다.
<xml>
<mainbody>
<num cite="4.2">4.2</num>
<num cite="2" type="para">2</num>
<heading>Stock exchanges</heading>
<prov-body>
<text>
Notwithstanding the provisions of a convention ... as defined in the
<italic>Income Tax Act</italic>.
**applicable on and after December 14, 2006**
</text>
<text> **applicable on and after December 14, 2007** </text>
<prov>
<num cite="1 annuity"/>
<num cite="5 annuity"/>
<num cite="3 annuity"/>
<heading>“annuity”</heading>
<text>
<term>“annuity”</term>does not include any pension payment ...
**applicable on and after December 14, 2008**
</text>
<text>
any pension payment ...
</text>
</prov>
</prov-body>
</mainbody>
</xml>
감사 Dimitre. – atif
@atif : 오신 것을 환영합니다. –