I have an xml document loaded into a string that I need to parse. below is
the first few elements in the xml string.
<?xml version="1.0" standalone="yes"?>
<xs:schema id="NewDataSet" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="CustomerShortName">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CreateDate" type="xs:dateTime" />
.... there is more I didn't show......
I need to step through it and if you look closely you see 2 keys
identifying column names, CustomerShortName and CreateDate
they are defined as
<xs:element name="CustomerShortName">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
and
<xs:element name="CreateDate" type="xs:dateTime" />
I need to step through the entire xml document and retrieve out
CustomerShortName, string, 10
and
CreateDate, dateTime
can someone show me how to parse this? 4 1018
If you need to "step through" XML you should use an SAX Parser. DOM Parsers
read in the entire document and then allow you to parse, SAX will actually
raise events for elements being read/parsed.
There is a free SAX Parser that comes with the Visual Basic Resource Kit I
believe.
-CJ
"Keith Henderson" <kh********@projectresources.nospam.com> wrote in message
news:uQ**************@TK2MSFTNGP15.phx.gbl... I have an xml document loaded into a string that I need to parse. below
is the first few elements in the xml string.
<?xml version="1.0" standalone="yes"?> <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xs:element name="NewDataSet" msdata:IsDataSet="true"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="Table"> <xs:complexType> <xs:sequence> <xs:element name="CustomerShortName"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="10" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="CreateDate" type="xs:dateTime" /> .... there is more I didn't show......
I need to step through it and if you look closely you see 2 keys identifying column names, CustomerShortName and CreateDate
they are defined as <xs:element name="CustomerShortName"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="10" /> </xs:restriction> </xs:simpleType> </xs:element>
and
<xs:element name="CreateDate" type="xs:dateTime" />
I need to step through the entire xml document and retrieve out CustomerShortName, string, 10 and CreateDate, dateTime
can someone show me how to parse this?
In article <uQ**************@TK2MSFTNGP15.phx.gbl>, Keith Henderson wrote: I have an xml document loaded into a string that I need to parse. below is the first few elements in the xml string.
<?xml version="1.0" standalone="yes"?> <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xs:element name="NewDataSet" msdata:IsDataSet="true"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="Table"> <xs:complexType> <xs:sequence> <xs:element name="CustomerShortName"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="10" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="CreateDate" type="xs:dateTime" /> .... there is more I didn't show......
I need to step through it and if you look closely you see 2 keys identifying column names, CustomerShortName and CreateDate
they are defined as <xs:element name="CustomerShortName"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="10" /> </xs:restriction> </xs:simpleType> </xs:element>
and
<xs:element name="CreateDate" type="xs:dateTime" />
I need to step through the entire xml document and retrieve out CustomerShortName, string, 10 and CreateDate, dateTime
can someone show me how to parse this?
You'll probably want to look at the documentation and example for
System.Xml.XmlTextReader....
--
Tom Shelton [MVP]
In article <uw*************@TK2MSFTNGP11.phx.gbl>, CJ Taylor wrote: If you need to "step through" XML you should use an SAX Parser. DOM Parsers read in the entire document and then allow you to parse, SAX will actually raise events for elements being read/parsed.
There is a free SAX Parser that comes with the Visual Basic Resource Kit I believe.
-CJ
I think that XmlTextReader meets these requirements...
from the docs:
XmlTextReader Class
Represents a reader that provides fast, NON-CACHED, forward-only access
to XML data.
I don't think he really needs the resource kit....
--
Tom Shelton [MVP] This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Krakatioison |
last post by:
My sites navigation is like this:
http://www.newsbackup.com/index.php?n=000000000040900000
, depending on the variable "n" (which is always a number), it will take me
anywhere on the site......
|
by: Stu Cazzo |
last post by:
I have the following:
String myStringArray;
String myString = "98 99 100";
I want to split up myString and put it into myStringArray.
If I use this:
myStringArray = myString.split(" ");
it...
|
by: John F Dutcher |
last post by:
I use code like the following to retrieve fields from a form:
recd =
recd.append(string.ljust(form.getfirst("lname",' '),15))
recd.append(string.ljust(form.getfirst("fname",' '),15))
etc.,...
|
by: Derek Hart |
last post by:
I wish to execute code from a string. The string will have a function name,
which will return a string:
Dim a as string
a = "MyFunctionName(param1, param2)"
I have seen a ton of people...
|
by: Angus Leeming |
last post by:
Hello,
Could someone explain to me why the Standard conveners chose to typedef
std::string rather than derive it from std::basic_string<char, ...>?
The result of course is that it is...
|
by: Fred |
last post by:
Hi,
I am parsing a small xml document and the parseing goes 'all funny'
when parsing this element: <useragent>Mozilla/4.61 (WinNT;
I)</useragent>
I've created a subclass of...
|
by: Kevin C |
last post by:
Quick Question:
StringBuilder is obviously more efficient dealing with string concatenations
than the old '+=' method... however, in dealing with relatively large string
concatenations (ie,...
|
by: An S. |
last post by:
I have created a little "update" system, that tells when a update from
nvidia is released, currently it tells it from a "simple" protocol "S2P", i
have been told that XML, is much easier, for the...
|
by: Keith Henderson |
last post by:
I have an xml document loaded into a string that I need to parse. below is
the first few elements in the xml string.
<?xml version="1.0" standalone="yes"?>
<xs:schema id="NewDataSet" xmlns=""...
|
by: Brian Henry |
last post by:
How would you parse this type of file into an array?
"Test","Help, data","hello there, this text has commas","commas seperate
data, and in quotes they dont"
where the double quotes are the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |