![]() |
|
Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
I hate to look like an XML ayatollah but I think you are going down a slippery path. XML is XML, and what you want is not XML. XML gives you native ways to encode your "literal" chunks so the parser is happy with them. You should use them. If you want a different format then you should use a pre-processor, to turn your quasi-XML into real XML. As the XML parser will never see the original file you can just have a special marker for the beginning and end of literal code, you don't need to use attributes on existing tags. You can basically use anything, I would use something illegal in XML and unlikely to happen in your literal text, &&& for example, or a tag if you really want to: You pre-processor would then be as simple as this:
another regular para <literal>more <> code & stuff</literal> </doc> </code>Frankly using CDATA sections is simpler and let your original documents be well-formed XML, but that's your call. In reply to Re: CDATA-like "literal" tags in XML-like data
by mirod
|
|