net.sourceforge.nite.util
Class XMLutils

java.lang.Object
  extended by net.sourceforge.nite.util.XMLutils

public class XMLutils
extends java.lang.Object

Some factored out utilities for dealing with XML, special characters etc.

Author:
Jonathan Kilgour, UEdin

Constructor Summary
XMLutils()
           
 
Method Summary
static java.lang.String escapeAttributeValue(java.lang.String in)
          escape an attribute value - put quotes round it and escape any special characters
static int escapeChars(char[] chin, int start, int length, char[] chout)
          Escape special characters for writing.
static java.lang.String escapeText(java.lang.String in)
          escape text for serializing to XML - just escape any special characters
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLutils

public XMLutils()
Method Detail

escapeAttributeValue

public static java.lang.String escapeAttributeValue(java.lang.String in)
escape an attribute value - put quotes round it and escape any special characters


escapeText

public static java.lang.String escapeText(java.lang.String in)
escape text for serializing to XML - just escape any special characters


escapeChars

public static int escapeChars(char[] chin,
                              int start,
                              int length,
                              char[] chout)
Escape special characters for writing.

Parameters:
ch - The character array containing the string @param start The start position of the input string within the character array
length - The length of the input string within the character array @param out Character array to receive the output. In the worst case, this should be 8 times the length of the input array. @return * The number of characters used in the output array