View Single Post
Old 08-14-2013, 07:05 PM   #11
Man Eating Duck
Addict
Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.
 
Posts: 254
Karma: 69786
Join Date: May 2006
Location: Oslo, Norway
Device: Kobo Aura, Sony PRS-650
Quote:
Originally Posted by DiapDealer View Post
On the subject of using a true "parser" vs regex to modify x?(ht)?ml:
<diatribe>.*</diatribe>
<Offtopic>
I love regex, it's a wonderful tool in my belt, and I use it all the time for everything from Indesign styling to converting SQL schemas between RDBMS varieties. I have used it almost daily at my place of employment for more than ten years, and consider myself pretty proficient. I also know its limitations. The much regretted example was something you (well, obviously not you or I, but you understand what I mean) might expect to work, but it doesn't.
</Offtopic>

This is almost completely irrelevant to what I want to accomplish, though, which is to do all these operations *moving css definitions* in bulk, including between file types, with the click of a button. Without humans crafting queries whatsoever, be it xpath or regex. When I just want to get on with reading the damn book, large parts of this cleaning is just a chore, better left to computer logic. Sigil do include the XML parser Xerces, but no CSS parser I could spot in the source, although there is some regex-based logic which parses at least parts of CSS (like class names). I will make a serious attempt implementing what I mention, but whether I can do much that is useful is left to be seen.
Man Eating Duck is offline   Reply With Quote