Package fr.paris.lutece.util.xml
Class XmlUtil
- java.lang.Object
-
- fr.paris.lutece.util.xml.XmlUtil
-
public final class XmlUtil extends Object
This class provides utils for XML document management.
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROPERTIES_XML_HEADER
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddElement(StringBuffer strXmlBuffer, String strTag, int nValue)Add an element to an XML document buffer.static voidaddElement(StringBuffer strXmlBuffer, String strTag, String strValue)Add an element to an XML document bufferstatic voidaddElement(StringBuffer strXmlBuffer, String strTag, String strValue, Map<?,?> attrList)Add an element to an XML document buffer with attributesstatic voidaddElementHtml(StringBuffer strXmlBuffer, String strTag, String strValue)Add a CDATA type element to XML document buffer.static voidaddElementHtml(StringBuffer strXmlBuffer, String strTag, String strValue, Map<?,?> attrList)Add a CDATA type element to XML document buffer.static voidaddEmptyElement(StringBuffer strXmlBuffer, String strTag, Map<?,?> attrList)Add an empty element (< />) to an XML document buffer.static voidbeginElement(StringBuffer strXmlBuffer, String strTag)Add an opening tag for an element in a XML document bufferstatic voidbeginElement(StringBuffer strXmlBuffer, String strTag, Map<?,?> attrList)Add an opening tag for an element in a XML document bufferstatic voidendElement(StringBuffer strXmlBuffer, String strTag)Add a closing tag for an element in a XML document bufferstatic StringgetXmlHeader()Gets the header of an XML file
-
-
-
Field Detail
-
PROPERTIES_XML_HEADER
public static final String PROPERTIES_XML_HEADER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getXmlHeader
public static String getXmlHeader()
Gets the header of an XML file- Returns:
- The header
-
addElement
public static void addElement(StringBuffer strXmlBuffer, String strTag, String strValue)
Add an element to an XML document buffer- Parameters:
strXmlBuffer- The XML document bufferstrTag- The tag name of the element to addstrValue- The value of the element
-
addEmptyElement
public static void addEmptyElement(StringBuffer strXmlBuffer, String strTag, Map<?,?> attrList)
Add an empty element (< />) to an XML document buffer.- Parameters:
strXmlBuffer- The XML document bufferstrTag- The tag name of the element to addattrList- The attributes list
-
addElement
public static void addElement(StringBuffer strXmlBuffer, String strTag, String strValue, Map<?,?> attrList)
Add an element to an XML document buffer with attributes- Parameters:
strXmlBuffer- The XML document bufferstrTag- The tag name of the element to addstrValue- The value of the elementattrList- the attribute list
-
addElement
public static void addElement(StringBuffer strXmlBuffer, String strTag, int nValue)
Add an element to an XML document buffer.- Parameters:
strXmlBuffer- The XML document bufferstrTag- The tag name of the element to addnValue- The value of the element
-
addElementHtml
public static void addElementHtml(StringBuffer strXmlBuffer, String strTag, String strValue)
Add a CDATA type element to XML document buffer.- Parameters:
strXmlBuffer- The XML document bufferstrTag- The tag name of the element to addstrValue- The value of the element
-
addElementHtml
public static void addElementHtml(StringBuffer strXmlBuffer, String strTag, String strValue, Map<?,?> attrList)
Add a CDATA type element to XML document buffer.- Parameters:
strXmlBuffer- The XML document bufferstrTag- The tag name of the element to addstrValue- The value of the elementattrList- The attributes list
-
beginElement
public static void beginElement(StringBuffer strXmlBuffer, String strTag)
Add an opening tag for an element in a XML document buffer- Parameters:
strXmlBuffer- The XML document bufferstrTag- The tag name of the element to add
-
beginElement
public static void beginElement(StringBuffer strXmlBuffer, String strTag, Map<?,?> attrList)
Add an opening tag for an element in a XML document buffer- Parameters:
strXmlBuffer- The XML document bufferstrTag- The tag name of the element to addattrList- The attributes list
-
endElement
public static void endElement(StringBuffer strXmlBuffer, String strTag)
Add a closing tag for an element in a XML document buffer- Parameters:
strXmlBuffer- The XML document bufferstrTag- The tag name of the element to add
-
-