KenTan85
asked on
Grouping
Hi,
how do i get this output??
thanks...
how do i get this output??
thanks...
input:
<?xml version="1.0" encoding="UTF-8"?>
<content>
<CaseName>testing</CaseName>
<judgments>
<Judge>Andrew Ang J</Judge>
<para1>there is some text 1<para2>para 2 text 1</para2></para1>
<para1>there is some text 2</para1>
<para1>there is some text 3</para1>
<para1>there is some text 4</para1>
<heading1>first heading</heading1>
<para1>there is some text 5</para1>
<Judge>Andrew Ang J</Judge>
<heading1>first heading</heading1>
<para1>there is some text 6</para1>
<heading2>second heading</heading2>
<para1>there is some text 7</para1>
<para1>there is some text 8</para1>
<para1>there is some text 9</para1>
<heading3>third heading</heading3>
<para1>there is some text 10<para2>para 2 text 2</para2></para1>
<heading3>third heading</heading3>
<para1>there is some text 10<para2>para 2 text 2</para2></para1>
</judgments>
</content>
output:
<content>
<CaseName>testing</CaseName>
<judgments>
<judgment>
<Judge>Andrew Ang J</Judge>
<para1>there is some text 1<para2>para 2 text 1</para2></para1>
<para1>there is some text 2</para1>
<para1>there is some text 3</para1>
<para1>there is some text 4</para1>
<section>
<heading1>first heading</heading1>
<para1>there is some text 5</para1>
<Judge>Andrew Ang J</Judge>
</section>
<section>
<heading1>first heading</heading1>
<para1>there is some text 6</para1>
<section>
<heading2>second heading</heading2>
<para1>there is some text 7</para1>
<para1>there is some text 8</para1>
<para1>there is some text 9</para1>
<section>
<heading3>third heading</heading3>
<para1>there is some text 10<para2>para 2 text 2</para2></para1>
</section>
<section>
<heading3>third heading</heading3>
<para1>there is some text 10<para2>para 2 text 2</para2></para1>
</section>
</section>
</section>
</judgment>
</judgments>
</content>
can you tell me what the trigger is for a new judgment?
Is it correct that
- the source has changed and the <judgment> has gone from the source, but you need it in the result
- the <judgment>s are created by encountering a <judge> element
Is it correct that
- the source has changed and the <judgment> has gone from the source, but you need it in the result
- the <judgment>s are created by encountering a <judge> element
ASKER
yup.
new <judgment> are created whenever it encounter a new <judge> element
new <judgment> are created whenever it encounter a new <judge> element
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Open in new window