chriselectrix 0 Newbie Poster

Hi All

I have the following XML (which is generated automatically and cannot be modified):

<ExportQuery>
  <ELEC01_SOWaitingParts3>
    <OrderDtl_PartNum><![CDATA[UK MUNSTD 20 BOX OF 100]]></OrderDtl_PartNum>
    <JobOper_OprSeq><![CDATA[10]]></JobOper_OprSeq>
    <Part_PartNum><![CDATA[UK MUNSTD 20 BOX OF 100]]></Part_PartNum>
    <OrderDtl_OrderNum><![CDATA[18432]]></OrderDtl_OrderNum>
    <OrderHed_OrderNum><![CDATA[18432]]></OrderHed_OrderNum>
    <JobHead_PartNum><![CDATA[UK MUNSTD 20 BOX OF 100]]></JobHead_PartNum>
    <JobHead_JobComplete><![CDATA[Yes]]></JobHead_JobComplete>
    <JobOper_JobNum><![CDATA[018957]]></JobOper_JobNum>
    <JobOper_OpCode><![CDATA[GB STORE]]></JobOper_OpCode>
    <JobOper_OpDesc><![CDATA[GET BATCH STORES]]></JobOper_OpDesc>
    <JobOper_OpComplete><![CDATA[No]]></JobOper_OpComplete>
    <JobOper_QtyCompleted><![CDATA[0.00]]></JobOper_QtyCompleted>
    <FalseJobNum><![CDATA[18957]]></FalseJobNum>
  </ELEC01_SOWaitingParts3>
  <ELEC01_SOWaitingParts3>
    <OrderDtl_PartNum><![CDATA[UK MUNSTD 20 BOX OF 100]]></OrderDtl_PartNum>
    <JobOper_OprSeq><![CDATA[20]]></JobOper_OprSeq>
    <Part_PartNum><![CDATA[UK MUNSTD 20 BOX OF 100]]></Part_PartNum>
    <OrderDtl_OrderNum><![CDATA[18432]]></OrderDtl_OrderNum>
    <OrderHed_OrderNum><![CDATA[18432]]></OrderHed_OrderNum>
    <JobHead_PartNum><![CDATA[UK MUNSTD 20 BOX OF 100]]></JobHead_PartNum>
    <JobHead_JobComplete><![CDATA[No]]></JobHead_JobComplete>
    <JobOper_JobNum><![CDATA[018957]]></JobOper_JobNum>
    <JobOper_OpCode><![CDATA[BOX]]></JobOper_OpCode>
    <JobOper_OpDesc><![CDATA[BOX]]></JobOper_OpDesc>
    <JobOper_OpComplete><![CDATA[No]]></JobOper_OpComplete>
    <JobOper_QtyCompleted><![CDATA[0.00]]></JobOper_QtyCompleted>
    <FalseJobNum><![CDATA[18957]]></FalseJobNum>
  </ELEC01_SOWaitingParts3>
  <ELEC01_SOWaitingParts3>
    <OrderDtl_PartNum><![CDATA[UK MUNSTD 20 BOX OF 100]]></OrderDtl_PartNum>
    <JobOper_OprSeq><![CDATA[30]]></JobOper_OprSeq>
    <Part_PartNum><![CDATA[UK MUNSTD 20 BOX OF 100]]></Part_PartNum>
    <OrderDtl_OrderNum><![CDATA[18432]]></OrderDtl_OrderNum>
    <OrderHed_OrderNum><![CDATA[18432]]></OrderHed_OrderNum>
    <JobHead_PartNum><![CDATA[UK MUNSTD 20 BOX OF 100]]></JobHead_PartNum>
    <JobHead_JobComplete><![CDATA[No]]></JobHead_JobComplete>
    <JobOper_JobNum><![CDATA[018957]]></JobOper_JobNum>
    <JobOper_OpCode><![CDATA[INV TRAN]]></JobOper_OpCode>
    <JobOper_OpDesc><![CDATA[INVENTORY TRANSFER]]></JobOper_OpDesc>
    <JobOper_OpComplete><![CDATA[No]]></JobOper_OpComplete>
    <JobOper_QtyCompleted><![CDATA[0.00]]></JobOper_QtyCompleted>
    <FalseJobNum><![CDATA[18957]]></FalseJobNum>
  </ELEC01_SOWaitingParts3>
</ExportQuery>

The 3 blocks of data all relate to the same JobOper_JobNum = 18957

However, the first block of data has JobOper_OpComplete = Yes and the next two blocks of data say JobOper_OpComplete = No.

There are hundreds of jobs listed in my XML and there may be several jobs / part.

I ONLY want to display the FIRST block in a sequence where JobOper_Complete = No for each Job Number.

The expected results from the above are:

<OrderDtl_PartNum><![CDATA[UK MUNSTD 20 BOX OF 100]]></OrderDtl_PartNum>
    <JobOper_OprSeq><![CDATA[20]]></JobOper_OprSeq>
    <Part_PartNum><![CDATA[UK MUNSTD 20 BOX OF 100]]></Part_PartNum>
    <OrderDtl_OrderNum><![CDATA[18432]]></OrderDtl_OrderNum>
    <OrderHed_OrderNum><![CDATA[18432]]></OrderHed_OrderNum>
    <JobHead_PartNum><![CDATA[UK MUNSTD 20 BOX OF 100]]></JobHead_PartNum>
    <JobHead_JobComplete><![CDATA[No]]></JobHead_JobComplete>
    <JobOper_JobNum><![CDATA[018957]]></JobOper_JobNum>
    <JobOper_OpCode><![CDATA[BOX]]></JobOper_OpCode>
    <JobOper_OpDesc><![CDATA[BOX]]></JobOper_OpDesc>
    <JobOper_OpComplete><![CDATA[No]]></JobOper_OpComplete>
    <JobOper_QtyCompleted><![CDATA[0.00]]></JobOper_QtyCompleted>
    <FalseJobNum><![CDATA[18957]]></FalseJobNum>

After this has been done, I then want to sort the data by JobOper_JobNum in Ascending order.

ANY HELP WOULD BE APPRECIATED.

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.