2 * This file is part of "SnipSnap Radeox Rendering Engine".
4 * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel All Rights Reserved.
6 * Please visit http://radeox.org/ for updates and contact.
8 * --LICENSE NOTICE-- This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser
9 * General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any
12 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free
16 * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --LICENSE NOTICE--
18 package org.plog4u.wiki.macro.code;
20 import org.radeox.macro.code.DefaultRegexCodeFormatter;
21 import org.radeox.macro.code.SourceCodeFormatter;
24 * XmlCodeFilter colourizes Xml Code
26 * @author stephan @team sonicteam
28 * @version $Id: XmlCodeFilter.java,v 1.1 2004-12-24 11:11:13 axelcl Exp $
31 public class XmlCodeFilter extends DefaultRegexCodeFormatter implements SourceCodeFormatter {
32 private static final String KEYWORDS = "\\b(xsl:[^&\\s]*)\\b";
34 private static final String TAGS = "(</?.*?>)";
36 private static final String QUOTE = "\"(([^\"\\\\]|\\.)*)\"";
38 public XmlCodeFilter() {
39 super(QUOTE, "<b><font color=\"#2A00FF\">\"$1\"</font></b>");
40 addRegex(TAGS, "<b><font color=\"#7F9FBF\">$1</font></b>");
41 addRegex(KEYWORDS, "<b><font color=\"#750055\">$1</font></b>");
44 public String getName() {