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