I’m trying to set up a situation where a regular expression can occur in xml
I know that the xml parser will complain on several key values (namely, < and &) and from what i understand, attributes can not support CDATA tags.
however since in .net the lookbehind uses the < character, things become more difficult.
What’s the best way to handle this?
I’ve considered formatting these as the html equivalent first and decoding them when they’re being used. seems like it would work, but was hoping for something more clever.
Is there any more clever ways out there besides formatting as html and then decoding?
Why not just put them in elements? Either properly encode them, or else put them in CDATA tags. If you use any of the .NET XML APIs and not string manipulation, then .NET will do the encoding for you.