03-04-2008 08:56 AM
03-04-2008 09:51 AM - edited 03-04-2008 09:53 AM
The easy way is if you know that this string is not changing much you treat it as a formated string and parse it using simple string functuions
ie first parse <Stations>%s<//Stations> and <Edges>%s<//Edges> The two slashes will cancle the escape clause of the string parser. Repete this process to get each station and attributes.
The harder way is to use an activeX or .net XML parser.
Paul
03-04-2008 10:38 AM
03-04-2008 11:22 AM
03-05-2008 01:53 AM
falkpl wrote:
The easy way is if you know that this string is not changing much you treat it as a formated string and parse it using simple string functuions
ie first parse%s and %s The two slashes will cancle the escape clause of the string parser. Repete this process to get each station and attributes.
The harder way is to use an activeX or .net XML parser.Paul
03-05-2008 07:25 AM
03-05-2008 10:10 AM
03-05-2008 10:50 AM
03-05-2008 11:20 AM
Parsing the complete XML is not easy I am talking about parsing a specific XML string that is known. I am not saying that Writing a complete XML Parser is easy. Sorry fpr the confusion. I still think that parsing known simple XML string to extract a few predefined values and attributes is not hard to do such as the initial XML string posted in this thread. This is what I based my answer on. If you have a vary complex XML schema or doc then use a fullblown parser.
Paul
03-05-2008 11:21 AM
@falkpl wrote:sorry I was a little tired yesterday. Yes match pattern will make a simple XML parser.Match the first Take string after match and match <\tag> then the string in the middle is the elements inner text. XML is a well formatted language so parsing is easy. I hav never used the easyXML toolkit so I cant vouch for it but know that Jim is very will respected in our community. I have made a simple vi in the past that takes a string tag name and returns an array or string arguments and the inner text of element or nothing if the tag is not matched. Parsing XML is not hard. use scan from string to convert your attribute values to floats and ints or even enums, this is not a problem either.paul