Schema Setup

Viewing 2 reply threads
  • Author
    Posts
    • #15653

      I have a schema that generates and XML file in the following structure (which is not what I want).

      <TransactionCategories>

      <TransactionCategory>

      <CategoryID AttributeName="CategoryID" />

      <CategoryID AttributeName="CategoryID" />

      <CategoryID AttributeName="CategoryID" />

      </TransactionCategory>

      </TransactionCategories>

      I have changed all the properties I thought neccessary but I can not get it to return in the format I would like.  I thought I should be changing the max occurs values in the schema.  Each piece of data is a child record versus a field element as you can notice by the schema xml output.  I want the structure to be as follows when the XML is created instead of whats listed above (repeating  <Transaction Category> value around CategoryID).

      <TransactionCategories ForeignKeyField="TransactionEntityID">

      <TransactionCategory>

      <CategoryID AttributeName="CategoryID" />

      </TransactionCategory>

      <TransactionCategory>

      <CategoryID AttributeName="CategoryID" />

      </TransactionCategory>

      <TransactionCategory>

      <CategoryID AttributeName="CategoryID" />

      </TransactionCategory>

      </TransactionCategories>

       

      Any suggestions or ideas to try are appreciated.

       

      Thanks!

    • #15655

      You need to set maxOccurs on the TransactionCategory record to be unbounded and the maxOccurs on the CategoryID to be 1 (if you leave this property blank it defaults to 1)

      TransactionCategories
          TransactionCategory maxOccurs=unbounded
              CategoryID maxOccurs=<blank>

      If you have set the Group maxOccurs on any record you should reset it.

      • #15660

        Thats what I originally tired… but I tried setting those values (not group max occurs) again and the result is the same.  Here is the output… any other ideas?

        <Transactions ForeignKeyField="CustomerEntityID">
        <Transaction EntityTypeID="4">
        <ID AttributeName="ID">15</ID>
        <RepairNumber AttributeName="RepairNumber">101</RepairNumber>
        <TransactionCategories ForeignKeyField="TransactionEntityID">
         <TransactionCategory>
        <CategoryID AttributeName="CategoryID">714</CategoryID>
          <CategoryID AttributeName="CategoryID">715</CategoryID>
          <CategoryID AttributeName="CategoryID">719</CategoryID>
          <CategoryID AttributeName="CategoryID" />
          <CategoryID AttributeName="CategoryID">877</CategoryID>
          <CategoryID AttributeName="CategoryID">178</CategoryID>
          <CategoryID AttributeName="CategoryID">302</CategoryID>
          <CategoryID AttributeName="CategoryID">5</CategoryID>
          </TransactionCategory>
          </TransactionCategories>
          </Transaction>
          </Transactions>
    • #15665

      The output is dependent on your mapping, not just the schema setup. Your for-each needs to drive the TransactionCategory
       node instead of the CategoryID node

Viewing 2 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.