public final class XmlHelper extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
XmlHelper.LaxValidationCase
Interface for providing exceptional cases in XML validation (e.g.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
append(org.apache.xmlbeans.XmlObject parent,
org.apache.xmlbeans.XmlObject childDoc)
Utility method to append the contents of the child docment to the end of
the parent XmlObject.
|
static void |
fixNamespaceForXsiType(org.apache.xmlbeans.XmlObject content,
Map<?,?> namespaces) |
static void |
fixNamespaceForXsiType(org.apache.xmlbeans.XmlObject object,
QName value) |
static String |
getLocalName(org.apache.xmlbeans.XmlObject element) |
static String |
getNamespace(org.apache.xmlbeans.XmlObject doc) |
static Map<?,?> |
getNamespaces(org.apache.xmlbeans.XmlObject xmlObject) |
static Node |
getNodeFromNodeList(NodeList nodeList)
Get element Node from NodeList.
|
static String |
getPrefixForNamespace(org.apache.xmlbeans.XmlObject element,
String namespace) |
static String |
getXPathPrefix(String prefix,
String namespace) |
static org.apache.xmlbeans.XmlObject |
loadXmlDocumentFromFile(File file)
Loads a XML document from File.
|
static void |
makeGmlIdsUnique(Node node)
Recurse through a node and its children and make all gml:ids unique
|
static void |
makeGmlIdsUnique(Node node,
Map<String,Integer> foundIds)
Recurse through a node and its children and make all gml:ids unique
|
static String |
parseHttpPostBodyWithParameter(Map<String,String[]> parameterMap)
Parses the HTTP-Post body with a parameter
|
static org.apache.xmlbeans.XmlObject |
parseXmlString(String xmlString) |
static boolean |
removeElement(org.apache.xmlbeans.XmlObject element)
Remove the element from XML document
|
static void |
removeNamespaces(org.apache.xmlbeans.XmlObject x)
Remove namespace declarations from an xml fragment (useful for moving all
declarations to a document root
|
static org.apache.xmlbeans.XmlObject |
substituteElement(org.apache.xmlbeans.XmlObject elementToSubstitute,
org.apache.xmlbeans.SchemaType schemaType,
QName name) |
static org.apache.xmlbeans.XmlObject |
substituteElement(org.apache.xmlbeans.XmlObject elementToSubstitute,
org.apache.xmlbeans.XmlObject substitutionElement) |
static void |
updateGmlIDs(Node node,
String gmlID,
String oldGmlID) |
static <X extends org.apache.xmlbeans.XmlObject,T extends Throwable> |
validateDocument(X doc,
Function<Throwable,T> supplier)
checks whether the XMLDocument is valid
|
static boolean |
validateDocument(org.apache.xmlbeans.XmlObject doc) |
public static String parseHttpPostBodyWithParameter(Map<String,String[]> parameterMap) throws DecodingException
parameterMap - Parameter mapDecodingException - * If the parameter is not supported by this SOS.public static org.apache.xmlbeans.XmlObject parseXmlString(String xmlString) throws DecodingException
DecodingExceptionpublic static Node getNodeFromNodeList(NodeList nodeList)
nodeList - NodeList.public static <X extends org.apache.xmlbeans.XmlObject,T extends Throwable> X validateDocument(X doc, Function<Throwable,T> supplier) throws T extends Throwable
doc - the document which should be checkedT - * if the Document is not validT extends Throwablepublic static boolean validateDocument(org.apache.xmlbeans.XmlObject doc)
throws DecodingException
doc - the XML document to validate.true if the given xml document is valid, else an exception is thrown.DecodingException - thrown if the given xml document is invalid.public static org.apache.xmlbeans.XmlObject loadXmlDocumentFromFile(File file) throws OwsExceptionReport
file - FileOwsExceptionReport - If an error occurspublic static void makeGmlIdsUnique(Node node)
node - The root nodepublic static void makeGmlIdsUnique(Node node, Map<String,Integer> foundIds)
node - The node to examinefoundIds - the already found idspublic static String getNamespace(org.apache.xmlbeans.XmlObject doc)
public static org.apache.xmlbeans.XmlObject substituteElement(org.apache.xmlbeans.XmlObject elementToSubstitute,
org.apache.xmlbeans.XmlObject substitutionElement)
public static org.apache.xmlbeans.XmlObject substituteElement(org.apache.xmlbeans.XmlObject elementToSubstitute,
org.apache.xmlbeans.SchemaType schemaType,
QName name)
public static String getPrefixForNamespace(org.apache.xmlbeans.XmlObject element, String namespace)
public static String getLocalName(org.apache.xmlbeans.XmlObject element)
public static void append(org.apache.xmlbeans.XmlObject parent,
org.apache.xmlbeans.XmlObject childDoc)
parent - Parent to append contents tochildDoc - Xml document containing contents to be appendedpublic static void removeNamespaces(org.apache.xmlbeans.XmlObject x)
x - The fragment to localizepublic static boolean removeElement(org.apache.xmlbeans.XmlObject element)
element - Element to removetrue, if element is removedpublic static void fixNamespaceForXsiType(org.apache.xmlbeans.XmlObject object,
QName value)
public static void fixNamespaceForXsiType(org.apache.xmlbeans.XmlObject content,
Map<?,?> namespaces)
public static Map<?,?> getNamespaces(org.apache.xmlbeans.XmlObject xmlObject)
Copyright © 2015–2021 52North Initiative for Geospatial Open Source Software GmbH. All rights reserved.