public final class DOMHelper extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
DOMHelper.NodeMapVisitor |
static interface |
DOMHelper.NodeVisitor |
Modifier and Type | Method and Description |
---|---|
static Node |
getElementNode(Node base,
Path path) |
static Node |
getElementNode(Node base,
String name)
Gets the first child element node having the given name.
|
static String |
getNodeValue(Element base,
Path path)
Gets the value of the node at the given path relative to the given base
element.
|
static void |
loadFragment(Element el,
String fragment)
Parses a string containing XML and returns a DocumentFragment containing
the nodes of the parsed XML.
|
static void |
visitAttributes(Context ctx,
XAnnotatedList xam,
Node base,
String name,
String attrName,
DOMHelper.NodeVisitor visitor,
Collection<Object> result) |
static void |
visitElements(Context ctx,
XAnnotatedList xam,
Node base,
String name,
DOMHelper.NodeVisitor visitor,
Collection<Object> result) |
static void |
visitMapAttributes(Context ctx,
XAnnotatedMap xam,
Node base,
String name,
String attrName,
DOMHelper.NodeMapVisitor visitor,
Map<String,Object> result) |
static void |
visitMapElements(Context ctx,
XAnnotatedMap xam,
Node base,
String name,
DOMHelper.NodeMapVisitor visitor,
Map<String,Object> result) |
static void |
visitMapNodes(Context ctx,
XAnnotatedMap xam,
Element base,
Path path,
DOMHelper.NodeMapVisitor visitor,
Map<String,Object> result) |
static void |
visitNodes(Context ctx,
XAnnotatedList xam,
Element base,
Path path,
DOMHelper.NodeVisitor visitor,
Collection<Object> result)
Visits the nodes selected by the given path using the given visitor.
|
public static String getNodeValue(Element base, Path path)
For element nodes the value is the text content and for the attributes node the attribute value.
public static void visitNodes(Context ctx, XAnnotatedList xam, Element base, Path path, DOMHelper.NodeVisitor visitor, Collection<Object> result)
public static void visitAttributes(Context ctx, XAnnotatedList xam, Node base, String name, String attrName, DOMHelper.NodeVisitor visitor, Collection<Object> result)
public static void visitElements(Context ctx, XAnnotatedList xam, Node base, String name, DOMHelper.NodeVisitor visitor, Collection<Object> result)
public static void visitMapNodes(Context ctx, XAnnotatedMap xam, Element base, Path path, DOMHelper.NodeMapVisitor visitor, Map<String,Object> result)
public static void visitMapAttributes(Context ctx, XAnnotatedMap xam, Node base, String name, String attrName, DOMHelper.NodeMapVisitor visitor, Map<String,Object> result)
public static void visitMapElements(Context ctx, XAnnotatedMap xam, Node base, String name, DOMHelper.NodeMapVisitor visitor, Map<String,Object> result)
public static Node getElementNode(Node base, String name)
Copyright © 2011 Nuxeo SA. All Rights Reserved.