passion_club
New Member
I have a complex long XHTML file, which contains CSS. Searching on google and on this site, I've found some libraries that can be useful on XHTML parsing:
- NSXMLParser
- TBXML
- And some others
- Detect on the XTHML file all tags with an \[code\]id\[/code\] or \[code\]class\[/code\] attribute and get the range of the string where they have effect (I cannot achieve this).
- Save all the CSS attributes on a \[code\]NSDictionary\[/code\], with more \[code\]NSDictionary\[/code\] objects inside. Something like this:\[code\]mainDict { object: dictionary { object: @"#00ff00" key: @"color" object: @"1em" key: @"font-size" } key: @"a id" object: anotherDictionary { ... } key: @"another id"}\[/code\]
- Convert these CSS attributes dictionary on the \[code\]NSAttributedString\[/code\]attributes dictionary.