INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How do I output un-deleted judgment?

How do I output un-deleted judgment?

(OP)
I have added new xml code because the previous code was incomplete.
I would like to return (output) only non-deleted judgment information, the original (base judgment information) when all of the amendments to it have been deleted and only a single instance of each judgment.
How do I do this?
Here is my xml 1.0 document

CODE --> xml

<?xml version="1.0" encoding="UTF-8"?>
<Pipeline xmlns="">
	<SourceXML>
		<Integration>
			<Case>
				<JudgmentEvent InternalID="1734529845" ID="175057896" Date="05/05/2016">
					<JudgmentEventType InternalID="13024" Word="JUDGGR">Judgment</JudgmentEventType>
					<IssueDate>05/05/2016</IssueDate>
					<AgingClockActionKey Word="SP">Stops case aging clock</AgingClockActionKey>
					<TimestampCreate>05/05/2016 09:40:03:713</TimestampCreate>
					<TimestampChange>05/05/2016 10:39:11</TimestampChange>
					<Deleted>true</Deleted>
					<RecordingNeeded>false</RecordingNeeded>
					<AmendReason InternalID="11091" Word="CTORDER">Court Order</AmendReason>
					<Judgment ID="3532520" InternalID="1612847489"/>
					<JudgmentEvent InternalID="1734529843" ID="175057895" Date="05/05/2016">
						<JudgmentEventType InternalID="13024" Word="JUDGGR">Judgment</JudgmentEventType>
						<IssueDate>05/05/2016</IssueDate>
						<AgingClockActionKey Word="SP">Stops case aging clock</AgingClockActionKey>
						<TimestampCreate>05/05/2016 09:38:56:520</TimestampCreate>
						<TimestampChange>05/05/2016 10:43:07</TimestampChange>
						<Deleted>false</Deleted>
						<RecordingNeeded>false</RecordingNeeded>
						<Judgment ID="3532519" InternalID="1612847488"/>
					</JudgmentEvent>
				</JudgmentEvent>
				<JudgmentEvent InternalID="1734529863" ID="175057907" Date="05/05/2016">
					<JudgmentEventType InternalID="13024" Word="JUDGGR">Judgment</JudgmentEventType>
					<IssueDate>05/05/2016</IssueDate>
					<AgingClockActionKey Word="SP">Stops case aging clock</AgingClockActionKey>
					<TimestampCreate>05/05/2016 10:43:07:857</TimestampCreate>
					<TimestampChange>05/06/2016 09:09:58</TimestampChange>
					<Deleted>true</Deleted>
					<RecordingNeeded>false</RecordingNeeded>
					<AmendReason InternalID="11091" Word="CTORDER">Court Order</AmendReason>
					<Judgment ID="3532521" InternalID="1612847490"/>
					<JudgmentEvent InternalID="1734529843" ID="175057895" Date="05/05/2016">
						<JudgmentEventType InternalID="13024" Word="JUDGGR">Judgment</JudgmentEventType>
						<IssueDate>05/05/2016</IssueDate>
						<AgingClockActionKey Word="SP">Stops case aging clock</AgingClockActionKey>
						<TimestampCreate>05/05/2016 09:38:56:520</TimestampCreate>
						<TimestampChange>05/05/2016 10:43:07</TimestampChange>
						<Deleted>false</Deleted>
						<RecordingNeeded>false</RecordingNeeded>
						<Judgment ID="3532519" InternalID="1612847488"/>
					</JudgmentEvent>
				</JudgmentEvent>
			</Case>
		</Integration>
	</SourceXML>
	<CourtXML/>
</Pipeline> 

Correct output should look like this

CODE --> xml

<CourtDecisions>
    <FamilyJudgment judgmentKey="3532520">
        <JudgmentEventTypeText>Judgment</JudgmentEventTypeText>
        <JudgmentEventDate>2016-05-05</JudgmentEventDate>
        <AmendedJudgment>
            <AmendedReasonText>Court Order</AmendedReasonText>
            <AmendedDate>2016-05-05</AmendedDate>
            <JudgmentReference judgmentKey="3532519"/>
        </AmendedJudgment>
    </FamilyJudgment> 
</CourtDecisions> 

RE: How do I output un-deleted judgment?

I'm curious, but I don't understand the logic of your data, because you say non-deleted judgment, but both judgements

CODE

<Judgment ID="3532520" InternalID="1612847489"/> 
and

CODE

<Judgment ID="3532521" InternalID="1612847490"/> 
have inside

CODE

<Deleted>false</Deleted> 
Then what is the reason that your desired output is only the first i.e.

CODE

<FamilyJudgment judgmentKey="3532520"> 
Other thing is that you have in your XML the mark JudgmentEvent embedded

CODE

<JudgmentEvent InternalID="1734529845" ID="175057896" Date="05/05/2016">
   ...
   <JudgmentEvent InternalID="1734529843" ID="175057895" Date="05/05/2016">
   ...
   </JudgmentEvent>
</JudgmentEvent> 
It would may difficult to use SAX parser.





RE: How do I output un-deleted judgment?

(OP)
I have resolved this issue by adding a condition

CODE --> xslt

<JudgmentEvent> 
.

Here is my solution in xslt

CODE --> xslt

<xsl:for-each select="descendant::JudgmentEvent[(Deleted='false') and (count(parent::JudgmentEvent[Deleted='false'])=0)]/Judgment"> 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close