I have the Data below and I am trying to select all the nodes except RejectedRecords and all of its children.
<?xml version="1.0" encoding="UTF-8"?>
<inmsg>
<BPDATA>
<DATE_TIME>10072014084945</DATE_TIME>
</BPDATA>
<Orders>
<Rejected>
<RejectedRecords>
<RecordNumber>1</RecordNumber>
<RecordError>State Code is invalid</RecordError>
</RejectedRecords>
<RejectedRecords>
<RecordNumber>2</RecordNumber>
<RecordError>State Code is invalid</RecordError>
</RejectedRecords>
<FileName>Foo1.txt</FileName>
<MessageType>Rejected</MessageType>
<RecordCount>2</RecordCount>
<TotalAmount>1050.01</TotalAmount>
</Rejected>
<Unrestricted>
<FileName>Foo2.txt</FileName>
<MessageType>UnrestrictedState</MessageType>
<RecordCount>2</RecordCount>
<TotalAmount>100.10</TotalAmount>
</Unrestricted>
</Orders>
<PrimaryDocument SCIObjectID="6442821469081a3a3node1"/>
</inmsg>
I have tried a number of statements such as
//*/node()[not(parent::RejectedRecords) and not(self::RejectedRecords) and not(self::RecordNumber) and not(self::RecordError)]
//*[not(parent::RejectedRecords) and not(self::RejectedRecords)]
//*[not(descendant-or-self::RejectedRecords)]
No matter what I have used I am still getting the RejectedRecords node and its children because it is coming in with the Rejected node. What am I doing wrong?