org.jrdf.parser.rdfxml
Class XmlUtil

java.lang.Object
  extended byorg.jrdf.parser.rdfxml.XmlUtil

public class XmlUtil
extends Object


Constructor Summary
XmlUtil()
           
 
Method Summary
static int findSplitIndex(String uri)
          Tries to find a point in the supplied URI where this URI can be safely split into a namespace part and a local name.
static boolean isCombiningChar(char c)
           
static boolean isDigit(char c)
           
static boolean isExtender(char c)
           
static boolean isIdeographic(char c)
           
static boolean isLetter(char c)
           
static boolean isNCName(String name)
          Checks whether the supplied String is an NCName (Namespace Classified Name) as specified at http://www.w3.org/TR/REC-xml-names/#NT-NCName.
static boolean isNCNameChar(char c)
           
static String resolveEntities(String text)
          Replaces all XML character entities with the character they represent.
static String resolveEntity(String entName)
          Resolves an entity reference or character reference to its 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

resolveEntities

public static String resolveEntities(String text)
Replaces all XML character entities with the character they represent.


resolveEntity

public static String resolveEntity(String entName)
Resolves an entity reference or character reference to its value.

Parameters:
entName - The 'name' of the reference. This is the string between & and ;, e.g. amp, quot, #65 or #x41.
Returns:
The value of the supplied reference, or the reference itself if it could not be resolved.

findSplitIndex

public static int findSplitIndex(String uri)
Tries to find a point in the supplied URI where this URI can be safely split into a namespace part and a local name. According to the XML specifications, a local name must start with a letter or underscore and can be followed by zero or more 'NCName' characters.

Parameters:
uri - The URI to split.
Returns:
The index of the first character of the local name, or -1 if the URI can not be split into a namespace and local name.

isNCName

public static final boolean isNCName(String name)
Checks whether the supplied String is an NCName (Namespace Classified Name) as specified at http://www.w3.org/TR/REC-xml-names/#NT-NCName.


isNCNameChar

public static final boolean isNCNameChar(char c)

isLetter

public static final boolean isLetter(char c)

isIdeographic

public static final boolean isIdeographic(char c)

isCombiningChar

public static final boolean isCombiningChar(char c)

isDigit

public static final boolean isDigit(char c)

isExtender

public static final boolean isExtender(char c)