Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Sort of XML file to read
- This topic has 4 replies, 1 voice, and was last updated 9 years, 5 months ago by
community-content.
-
AuthorPosts
-
-
March 21, 2006 at 5:42 AM #14419
Hello
Next interesting file type is \”like xml\” file but if I make schema of this file schema only has element \”column name\” and I am not able to get data which is in file.
in file data goes like this :
<column name=\”COLUMN1\”>[b:f11d272c02]Data1C1[/b:f11d272c02]</column>
COLUMN1 is a DB column to add data and Data1C1 is data to add into DB.I was able to extract column names correctly into DB but not the data I desired.
It cannot be read as a positional flat file because length of data differs and length of column names differs.
I can make another app to deal with this to read in in db but I rather use BTS to do this.
[code:1:f11d272c02]
<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>
<messages xmlns=\"Columned_Data_File1\">
<message type=\"COL\" action=\"A\" date_time=\"2004-10-28T17:36:41+01:00\">
<header>
<dealing_company_code>Company</dealing_company_code>
</header>
<body>
<record_info><record>
<column name=\"COLUMN1\">Data1C1</column>
<column name=\"COLUMN2\">Data2C1</column>
<column name=\"COLUMN3\">Data3C1</column>
<column name=\"COLUMN4\">Data4C1</column>
<column name=\"COLUMN5\">Data5C1</column>
<column name=\"COLUMN6\">Data6C1</column>
<column name=\"COLUMN6\">Data7C1</column>
</record>
<record>
<column name=\"COLUMN1\">Data1C2</column>
<column name=\"COLUMN2\">Data2C2</column>
<column name=\"COLUMN3\">Data3C2</column>
<column name=\"COLUMN4\">Data4C2</column>
<column name=\"COLUMN5\">Data5C2</column>
<column name=\"COLUMN6\">Data6C2</column>
<column name=\"COLUMN6\">Data7C2</column>
</record>
</record_info>
</body>
</message>
</messages>
[/code:1:f11d272c02] -
March 22, 2006 at 5:49 AM #14420
Hi Greg
Idea is to receive that XML file as described. When building schema for this xml only attribute for data is \”column name\” which is not usable. After column name comes data which I want to save to SQL server DB
example :
<column name=\”ACCESSORY\”>BR6</column>I am able to extract ACCESSORY but i am not able to extract the value of that column BR6
I have idea to use normal updategram with this file to save it into db. I think I have a mapping problem how to map ACCESSORY column’s data BR6 to certain column in update schema.
Does this help a bit?
\\R
-
March 23, 2006 at 7:24 AM #14421
Hi Greg
Now it works. Thank’s for assistance.
\\R
-
March 21, 2006 at 9:01 PM #14422
I am bit confused about what you are trying to do.
Are you receiving a flat file, xml file.
What type of database are you trying to add the data to – SQL, Oracle?How are you adding the data – updategram, stored procedure?
Can you provide more information about the end to end process.
-
March 22, 2006 at 7:53 AM #14423
The easiest way to do this is to use a map with a Logical Equals and Value Mapping Flattening functoid.
For every column in the output schema you will need a Logical Equals (LE) functoid and a Value Mapping (VM) functoid
Connect the column name attribute to each LE functoid then add a constant Input parameter to this functoid set the value to the column name.
Connect this LE functoid output to the VM functoid input.
Connect the Column element to the VM functoid
Connect the output of the VM functoid to the appropriate element on the output schema.
Repeat this process for each column on the output schema.The order of input parameters on the Value Mapping functoids is important.
The end effect is
If column/@name = \”COLUMN1\” then put column/text() in <column1>
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.