#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2016
    Posts
    16
    Rep Power
    0

    How do I get the first FamilyJudgement from xml doc?


    I would like to output the first FamilyJudgement from my xml document. How do I do it?

    Expected output
    Code:
    <FamilyJudgment judgmentKey="3928551">
    	<JudgmentEventTypeText>Custody order</JudgmentEventTypeText>
    </FamilyJudgment>
    xml document
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <CaseNotification>
    	<CourtDecisionNotification>
    		<TriggeredDateTime>2016-07-12T15:05:45-05:00</TriggeredDateTime>
    		<NotificationEvent>CourtDecisionModified</NotificationEvent>
    		<FamilyJudgment judgmentKey="3928551">
    			<JudgmentEventTypeText>Custody order</JudgmentEventTypeText>
    			<JudgmentEventDate>2016-07-12</JudgmentEventDate>
    			<Custody>
    				<CustodyDescriptionText>Legal custody</CustodyDescriptionText>
    			</Custody>
    		</FamilyJudgment>
    		<FamilyJudgment judgmentKey="3928551">
    			<JudgmentEventTypeText>Custody order</JudgmentEventTypeText>
    			<JudgmentEventDate>2016-07-12</JudgmentEventDate>
    			<Custody>
    				<CustodyDescriptionText>Legal custody</CustodyDescriptionText>
    			</Custody>
    		</FamilyJudgment>
    	</CourtDecisionNotification>
    </CaseNotification>
  2. #2
  3. Maddening Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,453
    Rep Power
    9645
    The XPath is, of course,
    Code:
    /CaseNotification/CourtDecisionNotification/FamilyJudgment
    Put that in a <copy-of> to copy the entire node.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2016
    Posts
    16
    Rep Power
    0
    Thanks for your help

IMN logo majestic logo threadwatch logo seochat tools logo