|
-
May 9th, 2012, 07:01 AM
#1
Parse XML
I am struck with parsing this xml File can any one help me to parse this.
- <site>
- <transactionList>
- <transaction uniqueId="14141414" type="debit" baseType="debit">
<description>CHECK # 998</description>
<checkNumber>998</checkNumber>
<amount curCode="USD">59.00</amount>
<link>link</link>
<category>category</category>
<transDate localFormat="MM/dd/yy">2005-07-16T00:00:00</transDate>
</transaction>
- <transaction uniqueId="1111111" type="deposit" baseType="credit">
<description>DESC</description>
<link>http://www.altova.com</link>
<amount curCode="USD">343465.00</amount>
<transDate localFormat="yyyy-MM-dd">2005-07-16T00:00:00</transDate>
<postDate localFormat="yyyy-MM-dd">2005-07-16T00:00:00</postDate>
<checkNumber>DAG-333</checkNumber>
<category categoryId="333">other</category>
</transaction>
</transactionList>
</site>
Following is the error I received while parsing this XML File
Data at the root level is invalid. Line 1, position 1.
-
May 10th, 2012, 01:26 AM
#2
Re: Parse XML
It helps nothing you just give us the XML code. We need your VB code as well, because your error may be in there..
-
May 10th, 2012, 01:51 AM
#3
Re: Parse XML
Thanks a lot for your reply. I have chosen SSIS (ETL tool) to parse XML file.
-
May 10th, 2012, 04:17 AM
#4
Re: Parse XML
Why are these '-' characters in the xml?
Code:
- <site>
- <transactionList>
- <transaction uniqueId="14141414" type="debit" baseType="debit">
<description>CHECK # 998</description>
<checkNumber>998</checkNumber>
<amount curCode="USD">59.00</amount>
<link>link</link>
<category>category</category>
<transDate localFormat="MM/dd/yy">2005-07-16T00:00:00</transDate>
</transaction>
- <transaction uniqueId="1111111" type="deposit" baseType="credit">
<description>DESC</description>
<link>http://www.altova.com</link>
<amount curCode="USD">343465.00</amount>
<transDate localFormat="yyyy-MM-dd">2005-07-16T00:00:00</transDate>
<postDate localFormat="yyyy-MM-dd">2005-07-16T00:00:00</postDate>
<checkNumber>DAG-333</checkNumber>
<category categoryId="333">other</category>
</transaction>
</transactionList>
</site>
-
May 18th, 2012, 03:17 PM
#5
Re: Parse XML
The XmlDocument class can be used to parse XML data.
-
May 18th, 2012, 03:44 PM
#6
Re: Parse XML
I too think those dashes are the problem.
They would be interpreted as "data" since they are not tags. And the first thing in this document is a dash.
I think they come from copying a XML file when opening it in Internet Explorer (the +/- icons are for unfolding nodes).
-
May 18th, 2012, 04:10 PM
#7
Re: Parse XML
 Originally Posted by TomasRiker
I think they come from copying a XML file when opening it in Internet Explorer (the +/- icons are for unfolding nodes).
Yes, this happens when opening in Firefox also. There is a dash in front of each tag which spans multiple lines.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|