使用范围:UI2
Contents
class Xml ($UI/system/lib/base/xml)
XML工具类
Constructor Top
Xml () |
Static Methods Top
Object | eval (Node context, String xpathExp, String resultType, String namespaces) | |
Object | eval2 (Node context, String xpathExp, String resultType, String namespaces) | |
Document | fromString (String xmlStr) | |
Node | getChildByName (Node context, String name) | |
String | getNodeText (Node context, String xpathExp, String defaultValue) | |
Integer | insertNodes (Node context, String xpathExp, List nodes, Boolean isBefore) | |
void | removeNodes (Node context, String xpathExp) | |
Integer | replaceNodes (Node context, String xpathExp, List nodes) | |
void | setNodeText (Node context, String xpathExp, String text) | |
String | toString (Node xmlNode) |
Constructor details
Top
public
Xml
()
XML工具类
public
Xml
()
XML工具类
Static Methods Detail Top
static
public
Object
eval
(Node context, String xpathExp, String resultType, String namespaces)
在指定的节点上执行XPath, 返回相应的节点
static
public
Object
eval2
(Node context, String xpathExp, String resultType, String namespaces)
在指定的节点上执行XPath, 返回相应的节点(简化版本)
static
public
Document
fromString
(String xmlStr)
将String格式的XML转换成XML对象
static
public
Node
getChildByName
(Node context, String name)
根据tagName获取子节点
static
public
String
getNodeText
(Node context, String xpathExp, String defaultValue)
获取节点文本内容, 如果节点存在,返回指定的默认值
插入节点
static
public
void
removeNodes
(Node context, String xpathExp)
删除节点
替换节点
static
public
void
setNodeText
(Node context, String xpathExp, String text)
设置节点文本内容
static
public
String
toString
(Node xmlNode)
将XML对象转换成String格式