How to Parse Tables in XML - 04-22-2010 , 10:18 AM
New to XML, I'm using ds.ReadXML(sFilePath) in my XMLHelper as dataset
In my test page I'm adding a table to the ds XMLTables, cols TableName &
ChildNode, then for each dt in ds.tables rows.add(dt.tablename...
But, my tables are not what I would expect; for example, in the following
<?xml version="1.0" encoding="utf-8" ?>
- <TXLife xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<VendorName VendorCode="000">Partner Company</VendorName>
<TransType tc="121">Order Request</TransType>
I expect a table named - <UserAuthRequest> but not another - <UserPswd>
I would like a table UserAuthRequest, with cols...
I would expect that there is an easy way to specify how the XML is parsed
into tables, perhaps during the read XML?
Re: How to Parse Tables in XML - 04-22-2010 , 10:28 AM
table and leaf element and attributes serve as columns of tables in the
schema respectively as values of rows in the data.
You can define an XML schema for the mapping and read that in with
ReadXmlSchema() before doing ReadXml() but that is not going to complete
change the table and relation structure, it is more aimed at defining
the simple types for leaf element and for attributes (e.g. whether
<foo>2</foo> is treated as a column with string content, int content or
See http://msdn.microsoft.com/en-us/library/bfdchewb(v=VS.90).aspx or
the corresponing section in your local MSDN library installation for
Martin Honnen --- MVP Data Platform Development
Re: How to Parse Tables in XML - 04-22-2010 , 11:21 AM
Martin, thanks for your post.
I really shouldn't have used "expected", I see why the userPswd is another
table, I should've said, "wanted". Anyway, I really don't need the ability to
have distinct tables. I'm planning on using/reading an XML template, then
update only certain contents of my XML before sending it on as a unique
order, but I thought it would be useful later in my project.
"Martin Honnen" wrote:
|Thread Tools||Search this Thread|