edu.stanford.smi.protege.storage.xml
Class XMLUtil
java.lang.Object
edu.stanford.smi.protege.storage.xml.XMLUtil
public class XMLUtil
- extends Object
Escape special XML characters.
This code was inspired by that from the Apache Xerces project
Method Summary |
static String |
escape(char ch)
If there is a suitable entity reference for this
character, return it. |
static String |
escape(String source)
Escapes a string so it may be returned as text content or attribute
value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XMLUtil
public XMLUtil()
escape
public static String escape(char ch)
- If there is a suitable entity reference for this
character, return it. The list of available entity
references is almost but not identical between
XML and HTML.
escape
public static String escape(String source)
- Escapes a string so it may be returned as text content or attribute
value. Non printable characters are escaped using character references.
Where the format specifies a deault entity reference, that reference
is used (e.g. <).
- Parameters:
source
- the string to escape.
Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2011 Stanford University.