Options

XML port export structure

racakaracaka Member Posts: 4
Hi,

I would need some help. I have a table with two fields.

I need to export all the records in this table, first field as an attribute, and second field as an element. Now I have "unnecessary" elements around, for the table source type XML port row.

My XML port seems like this:
TagName	TagType	SourceType	 DataSource
Tablename	Element	Table <Tablename>(Tablename)
  Field1	 Element	Field <Tablename>::Field1
    Field2  Attribute Field <Tablename>::Field2

I awaited there will be a root node for the table, and all the records within.
But I have <Tablename> nodes around each record:
<Tablename>
   <Field1 Field2="data11">data12</Field1>
</Tablename>
<Tablename>
   <Field1 Field2="data21">data22</Field1>
</Tablename>
<Tablename>
   <Field1 Field2="data31">data32</Field1>
</Tablename>

May I have this without separated <Tablename> nodes for every record, like this?:
<Tablename>
   <Field1 Field2="data11">data12</Field1>
   <Field1 Field2="data21">data22</Field1>
   <Field1 Field2="data31">data32</Field1>
</Tablename>

What do you think? Any help is warmly welcome.
Thanks,
Rac

Comments

  • Options
    PeterDPeterD Member Posts: 66
    Did you indent your elements?

    Something like:
    Tablename 
      Field1 
      Field2
    
  • Options
    racakaracaka Member Posts: 4
    Thanks, I did.
    I corrected the formatting of my original post.

    And yes, this is why I await this node should appear only once, and to contain all the records within that node.

    It works, if I use only attributes within that element with Table source type to enumerate all the records in the table.
    However, if I would enumerate all the records as elements, I get "double" elements:
    <Table><Record>Data1</Record></Table>
    <Table><Record>Data2</Record></Table>
    

    I need only:
    <Table>
       <Record>Data1</Record>
       <Record>Data2</Record>
    </Table>
    
Sign In or Register to comment.