public class XlsxParser extends Object
The syntax as follows
For example,
<foo a="a"/>
Result:
{
"foo": {
"a": "a"
}
}
For example,
<foo a="a">
<bar>baz</bar>
</foo>
Result:
{
"foo": {
"": ["a"], // store for the attr key info
"a": "a", // attribute
"bar": {
"_": "baz" // text only
}
}
}
For example,
<foo a="a">bar</foo>
Result:
{
"foo": {
"a": "a", // attribute
"_": "baz" // text only
}
}
For example,
<foo>bar</foo>
Result:
{
"foo": {
"_": "baz" // text only
}
}
For example,
<foo><bar>baz</bar></foo>
Result:
{
"foo": {
"bar": {
"_": "baz" // text only
}
}
}
For example,
<foo><bar a="a"></bar><bar b="b"></bar><baz/></foo>
Result:
{
"foo": {
"bar": [{
"a": "a"
}, {
"b": "b"
}],
"baz": null // self-closed tag
}
}
Constructor and Description |
---|
XlsxParser() |
Modifier and Type | Method and Description |
---|---|
static JSONObject |
parse(String name,
ZipInputStream zipFile) |
static void |
parseElement(XMLStreamReader reader,
JSONAware json,
Map<String,Supplier<JSONNode>> schemaNodes) |
static JSONObject |
parseXML(XMLStreamReader reader) |
public static JSONObject parse(String name, ZipInputStream zipFile) throws IOException, XMLStreamException
IOException
XMLStreamException
public static JSONObject parseXML(XMLStreamReader reader) throws XMLStreamException
XMLStreamException
public static void parseElement(XMLStreamReader reader, JSONAware json, Map<String,Supplier<JSONNode>> schemaNodes) throws XMLStreamException
XMLStreamException
Copyright © 2020. All rights reserved.