[DLL] XML Parser?
Post all your application ideas, thoughts and suggestions in here to inspire others or kick-off a project.
9 posts
Page 1 of 1
Hello,
I have an idea for anyone willing. Maybe you could create an XML parser? Not only would it give you an idea, but it would help people like me, who can't really figure out how to parse it manually. It could be called simply, like:
ParseXML.ReadVal("valname")
and maybe even a write function.
I hope someone does this
~GoodGuy17
I have an idea for anyone willing. Maybe you could create an XML parser? Not only would it give you an idea, but it would help people like me, who can't really figure out how to parse it manually. It could be called simply, like:
ParseXML.ReadVal("valname")
and maybe even a write function.
I hope someone does this
~GoodGuy17
Can't you just use the System.XML namespace? There are plenty of classes for parsing XML there.
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
Lol easy to do with Regular expressions , I wrote a html parser before which is very much like xml, but you should just use System.XML, no need to rewrite that
It is not that similar, there are some major differences. Maybe i'll try to make one.
The essence is in there
<tagname> </endswithslash>
<tagname> </endswithslash>
Axel wrote:Lol easy to do with Regular expressions , I wrote a html parser before which is very much like xml, but you should just use System.XML, no need to rewrite thatRegex is not the right tool for XML or HTML. You need an enormous expression to handle incorrect input in addition to the valid HTML. I would be suprised to see anyone at mandais level make a HTML/XML parser with regex.
There are several small regexes to catch simple tags, but once a nested tag with the same identifier occours (<tagID bla=""><tagID bla="nested tag"></tagID></tagID>), you will have large problems. The regex
<([A-Z][A-Z0-9]*)\b[^>]*>.*?</\1> will match a tag with no nested identical tags. In the string <tagID bla=""><tagID bla="nested tag"></tagID></tagID> this regex will match <tagID bla=""><tagID bla="nested tag"></tagID></tagID>
If you make a little adjustment, and make one of the stars greedy, in the HTML file
<div>
</div>
<div>
</div>
the regex would match
<div>
</div>
<div>
</div>
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
Parsing big files actually doesn't take long. Instead of [A-Z][A-Z0-9] I'd use [\w|\W]+ instead
I didnt say anything about how long it takes, just how many flaws it would create. \w is the same as [A-Z][A-Z0-9]
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
I know it is, but your regex could be optimized to be much shorter. And that one is basic, if you keep improving it it wont create any flaws
I made some code for parsing subtitle formats (srt & ass) and it was much longer than that piece lol
I made some code for parsing subtitle formats (srt & ass) and it was much longer than that piece lol
9 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023