Putting it in containers means that I need to get the text blocks. When I
find them I need to put part of it in a textbox and part of it in a
listview/listbox. Here is an example of the text blocks I need to parse.
'following line goes inside a listbox/listview
99999 A description of the item in question
'following steps go inside a textbox
1. step 1
2. step 2
3. step 3
and the steps list continues until another 5 digit number is found. This is
the parsing detail that I need for right now.
"Martin Honnen" <ma*******@yahoo.dewrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Andy B wrote:
>I need to search an xml element for blocks of text. The start of the text
block will have a 5 digit number in it and i then need to read until the
next 5 digit number. After this, I need to put them in different
containers of their own. Where would I start?
To find the text contents of the XML element itself you can use XmlReader
or XPathDocument/XPathNavigator or XmlDocument or (with .NET 3.5) LINQ to
XML. Then to parse that block of text it sounds as if regular expressions
could help e.g.
\d{5}.*?\d{5}
is a regular expression matching five digits, anything else and five
digits.
If you want to manipulate the XML (not sure whether "put them in different
containers" relates to XML) then XmlDocument or LINQ to XML are the right
APIs.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/