Protege 3.5

edu.stanford.smi.protege.storage.xml
Class XMLUtil

java.lang.Object
  extended by 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


Constructor Summary
XMLUtil()
           
 
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
 

Constructor Detail

XMLUtil

public XMLUtil()
Method Detail

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.

Protege 3.5

Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2013 Stanford University.