public class XMLUtils extends Object
| Constructor and Description |
|---|
XMLUtils() |
| Modifier and Type | Method and Description |
|---|---|
static BXML<?> |
concatenate(BXML<?> firstSeq,
BXML<?> secondSeq)
Concatenate two XML sequences and produce a single sequence.
|
static BJSON |
convertToJSON(BXML xml,
String attributePrefix,
boolean preserveNamespaces)
Converts given xml object to the corresponding json.
|
static BXML<?> |
createXMLComment(String content)
Create a comment type BXML.
|
static BXML<?> |
createXMLElement(BXMLQName startTagName,
BXMLQName endTagName,
String defaultNsUri)
Create an element type BXML.
|
static BXML<?> |
createXMLProcessingInstruction(String tartget,
String data)
Create a processing instruction type BXML.
|
static BXML<?> |
createXMLText(String content)
Create a comment type BXML.
|
static BXML<?> |
parse(InputStream xmlStream)
Create a XML sequence from string inputstream.
|
static BXML<?> |
parse(Reader reader)
Create a XML sequence from string reader.
|
static BXML<?> |
parse(String xmlStr)
Create a XML item from string literal.
|
static BXML |
tableToXML(BTable table,
boolean isInTransaction)
|
public static BXML<?> parse(String xmlStr)
xmlStr - String representation of the XMLpublic static BXML<?> parse(InputStream xmlStream)
xmlStream - XML input streampublic static BXML<?> parse(Reader reader)
reader - XML readerpublic static BXML<?> concatenate(BXML<?> firstSeq, BXML<?> secondSeq)
firstSeq - First XML sequencesecondSeq - Second XML sequencepublic static BXML<?> createXMLElement(BXMLQName startTagName, BXMLQName endTagName, String defaultNsUri)
startTagName - Name of the start tag of the elementendTagName - Name of the end tag of elementdefaultNsUri - Default namespace URIpublic static BXML<?> createXMLComment(String content)
content - Comment contentpublic static BXML<?> createXMLText(String content)
content - Text contentpublic static BXML<?> createXMLProcessingInstruction(String tartget, String data)
tartget - PI targetdata - PI datapublic static BJSON convertToJSON(BXML xml, String attributePrefix, boolean preserveNamespaces)
xml - XML object to get the corresponding jsonattributePrefix - Prefix to use in attributespreserveNamespaces - preserve the namespaces when convertingCopyright © 2018 WSO2. All rights reserved.