you're reading...

Syntax Highlighter’s taste of XML

Just thought I’d post what I just finished coding up….so far this is outside of the working project; but I will reintegrate this soon and start work on recoding the finding/highlighting part to use the new stuff. With the way this is set up I can’t think of languages that won’t work well with it; but I’m sure some exist.

A copy of the current output of my LanguageDefinition.xml file follows the break, and it was generated using the XmlSerializer and an instance of my LanguageDefinition class. I’ve slightly edited the output to remove the XML namespace stuff from the LanguageDefinition element since it was making the content too wide.

<?xml version="1.0"?>
<LanguageDefinition languageNames="c#,cs,csharp">
    <languagePart name="keywords" cssClass="keyword" order="1">
      <regex>(?<=\b) ( {0} ) (?=\b)</regex>
      <regexOptions>Multiline IgnorePatternWhitespace</regexOptions>
    <languagePart name="literals" cssClass="cs-literals" order="2">
      <regex>(?<=\b) ( {0} ) (?=\b)</regex>
      <regexOptions>Multiline IgnorePatternWhitespace</regexOptions>
    <languagePart name="preprocessor" cssClass="cs-preprocessor" order="3">
      <regex>(?<=\b) ( {0} ) (?=\b)</regex>
      <regexOptions>Multiline IgnorePatternWhitespace</regexOptions>

About James

I am a Senior Developer/Consultant for InfoPlanIT, LLC. I previously spent over 7 years as a Product Manager for what eventually became ComponentOne, a division of GrapeCity. While there, I helped to create ActiveReports 7, GrapeCity ActiveAnalysis, and Data Dynamics Reports.


No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: