tags:

views:

45

answers:

1

I was looking for a C/C++ library with a function that would allow you to search for a tag by name and attributes, and then return other attributes of the found tag, and most importantly, indicate which visible character position the tag occurred at.

Does jquery/javascript already allow this, and if so, do I just need something to process jquery/jscript from within C/C++, or is there in fact some native C/C++ library that's faster.

+2  A: 

Tagsoup > XML Parser > XPath > Attribute retrieval.

That's how I'd do it. That makes the most sense and gives you the most powerful parsing.

Stefan Kendall
what will it do with plain html (with <br> and so forth)
Mark
Mark
@Georg: You clearly haven't used tagsoup.
Stefan Kendall
@Mark: It turns <br> into <br />.
Stefan Kendall
@Mark: Tagsoup makes your HTML XML-parseable, which gives you greater power in extracting information from your document. I have used Tagsoup with XML parsers to much success in screen-scraping like this.
Stefan Kendall
Ah, no i hadn't. I read this like a sitemap with tagsoup being the main site...
Georg Fritzsche
tagsoup - OK I'll have a look.
Mark
Will not be able to fully evaluate tagsoup, etc. as I decided I didn't need to do what was I describing anyway.
Mark