XAML Stripper |
Post Reply |
Author | |
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
Posted: 07 August 2009 at 2:27pm |
Here's my first attempt at a generic XAML markup stripper. It seems to
work pretty well so far (test against CJ markup examples). It's not as
efficient as it could be (I could be short-circuiting the main loop in
more places, and maybe even handle entities in the first pass), but it
should do if you don't have to convert a lot of items. I will see if I
have time to optimize it, but if anyone wants to pick up the task, I
won't complain
Some decisions had to made about whitespace handling - I decided to collapse them all just like Markup display does, but this may not be suitable for all purposes (e.g. matching against data from the source that you generated the markup from). I also decided to add space between plain text from different tags. This isn't always the desired result (for example, the baseline example has a a space between the word Baseline and the number 2 in the converted text, that doesn't appear on the markup display. But it is the preferable result in more cases so I went with it). Here's the source: uploads/20090809_155906_StripMarkup.zip Bug reports welcome, of course. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
Updated (latest version always in first post) - bug fixes for handling spaces between attribute name and equal sign, as well as for missing inline Text/Content attribute when tag is self-closed and last item.
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |