Johan Solve <[EMAIL PROTECTED]> wrote on 9/24/06 at 10:18 PM:

> Can't xml plist handle CDATA? Inside a CDATA block just about anything is 
> allowed (expect the closing CDATA marker). That would allow regex 
> expressions to be a bit more readable.
> 
> In that case it would go like this
> <string><![CDATA[(?x:
>       (?>  '   (?s: \\.  | [^'] )*?    (?: ' | $ ) ) |
>       (?>  "   (?s: \\.  | [^"] )*?    (?: " | $ ) )
>  )]]></string>

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.

Me, personally, I still find the "ASCII" plist format much easier
on the eyes, especially for shorter patterns.

XML:

    <key>String Pattern</key>
    <string><![CDATA[(?x:
          (?>  '   (?s: \.  | [^'] )*?    (?: ' | $ ) ) |
          (?>  "   (?s: \.  | [^"] )*?    (?: " | $ ) )
     )]]></string>


ASCII:

    "String Pattern" = "(?x:
          (?>   '  (?s: \\.  |  [^'] )*?    (?:  ' | $ ) ) |
          (?>  \"  (?s: \\.  | [^\"] )*?    (?: \" | $ ) )
    )";


But you're right that with CDATA, you don't have to worry about
escaping anything, other than that you can't include the closing
']]>' sequence literally within the CDATA.

-J.G.

--
------------------------------------------------------------------
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]>

Reply via email to