public class XMLParser
extends java.lang.Object
Constructor and Description |
---|
XMLParser() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
findAttribute(java.lang.String content,
java.lang.String name)
This method parses a xml tag for a single named attribute.
|
static java.util.Map<java.lang.String,java.lang.String> |
findAttributes(java.lang.String content)
This method parses a xml tag for attributes.
|
static java.util.List<java.lang.String> |
findNoEmptyTags(java.lang.String content,
java.lang.String tag)
This method find not-empty tags inside a string and returns a list with all
tags.
|
static java.util.List<java.lang.String> |
findTags(java.lang.String content,
java.lang.String tag)
This method find specific tags inside a string and returns a list with all
tags.
|
static java.lang.String |
findTagValue(java.lang.String content,
java.lang.String tag)
This method returns the tag value of a single tag.
|
static java.lang.String |
findTagValueOld(java.lang.String content,
java.lang.String tag)
Deprecated.
|
static java.util.List<java.lang.String> |
findTagValues(java.lang.String content,
java.lang.String tag)
This method returns all tag values within a string with multiple xml tags.
|
static ItemCollection |
parseItemStructure(java.lang.String xmlContent)
This method parses the xml content of a item element and returns a new
ItemCollection containing all item values.
|
static ItemCollection |
parseTag(java.lang.String xmlContent,
java.lang.String tag)
This method parses the xml content of a XML tag and returns a new
ItemCollection containing all embedded tags.
|
public static java.util.Map<java.lang.String,java.lang.String> findAttributes(java.lang.String content)
content
- public static java.lang.String findAttribute(java.lang.String content, java.lang.String name)
content
- public static java.util.List<java.lang.String> findTags(java.lang.String content, java.lang.String tag)
e.g. an empty tag:
or a tag with content:
Note: In case of complex XML with not empty tags use the method 'findNoEmptyTags'
content
- - XML datatag
- - XML tagpublic static java.util.List<java.lang.String> findNoEmptyTags(java.lang.String content, java.lang.String tag)
e.g.:
Note: To fine also empty tags use 'findTags'
content
- - XML datatag
- - XML tagpublic static java.util.List<java.lang.String> findTagValues(java.lang.String content, java.lang.String tag)
returns
2016-12-31|2016-12-31
content
- - XML datatag
- - XML tagpublic static java.lang.String findTagValue(java.lang.String content, java.lang.String tag)
E.g.
returns
2016-12-31
content
- - XML datatag
- - XML tagfindTagValues
@Deprecated public static java.lang.String findTagValueOld(java.lang.String content, java.lang.String tag)
public static ItemCollection parseItemStructure(java.lang.String xmlContent) throws PluginException
<item>
<modelversion>1.0.0</modelversion>
<task>1000</task>
<event>10</event>
</item>
evalItemCollection
- PluginException
public static ItemCollection parseTag(java.lang.String xmlContent, java.lang.String tag) throws PluginException
MultiValues are currently not supported.
Example:
The tag 'code' of:
<code>
<modelversion>1.0.0</modelversion>
<task>1000</task>
<event>10</event>
</code>
Returns an ItemCollection with 3 items (modelversion, task and event)
evalItemCollection
- PluginException
Copyright © 2006–2022 Imixs Software Solutions GmbH. All rights reserved.