On 9/24/2006, John Gruber said:
That's a good suggestion, and indeed, it works. Although in fact, because
CDATA requires no escapes at all, you have to un-double the backslashes in
the example above.
Actually, no, the backslashes weren't escaped/doubled because of
XML. That's
not how XML escapes anything anyway.
XML:
<key>String Pattern</key>
<string><![CDATA[(?x:
(?> ' (?s: \. | [^'] )*? (?: ' | $ ) ) |
(?> " (?s: \. | [^"] )*? (?: " | $ ) )
)]]></string>
Your change from \\. to \. really changes the meaning of the original
pattern.
The \\. allowed the strings to contain escaped quotes. The \\.
would match
any escaped character (a literal '\' followed by any character).
With your change to \. it matches only a literal period.
So, there's no need to unescape the slashes when going from entity-encoded
XML PLIST to CDATA in an XML PLIST, but you do have to remember
to convert
the XML entities to plain characters.
Converting from the XML to the ASCII formatted PLIST file *does* require
doubling all the backslashes.
It's late and I'm very tired, so I hope that made some sort of sense.
Me, personally, I still find the "ASCII" plist format much easier on the
eyes, especially for shorter patterns.
Since you've said that twice, I've now provided ASCII formats of
both the
CLM template and the newLISP.plist file. Links are at the end of the
tutorial. (Oh and thanks for the link on your site, John. :-)
Seth
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <[EMAIL PROTECTED]>