Results 1 to 1 of 1
  1. #1
    Join Date
    Sep 2008
    Posts
    1

    Unanswered: OPENXML with Multiple Multi-Line Message

    Hi! We have an XML message like this:
    ----------------------
    Code:
    <ShipNotice>
      <ShipDate>2008-09-24</ShipDate>
      <ShipNoticeDetails>
        <EquipmentDetails>
          <LineNumber>1</LineNumber>
          <EquipmentID>E1</EquipmentID>
        </EquipmentDetails>
        <EquipmentDetails>
          <LineNumber>2</LineNumber>
          <EquipmentID>E2</EquipmentID>
        </EquipmentDetails>
        <ProductDetails>
          <LineNumber>1</LineNumber>
          <EquipmentDetailsLineNumber>1</EquipmentDetailsLineNumber>
          <Quantity>43.90</Quantity>
        </ProductDetails>
        <ProductDetails>
          <LineNumber>2</LineNumber>
          <EquipmentDetailsLineNumber>2</EquipmentDetailsLineNumber>
          <Quantity>44.05</Quantity>
        </ProductDetails>
      </ShipNoticeDetails>
    </ShipNotice>
    As you can see, under <ShipNoticeDetails> there are two elements (two of each), <EquipmentDetails> and <ProductDetails>, they are one to one mapping. The link is the <EquipmentDetailsLineNumber> element under <ProductDetails>.

    How can I get results in 2 rows like this using OPENXML? Or is there a way to do it without using OPENXML?

    Code:
    ShipDate  EqLineNum  EquipmentID ProLineNum ProdEqLineNum Quantity
    --------  ---------  ----------  ---------  ------------  ----------
    20080926  1          E1          1          1             43.90
    20080926  2          E2          2          2             44.05
    Thank you!
    Grace
    Last edited by gylirm; 09-30-08 at 16:48.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •