-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added README.asciidoc for parser-xml
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
== parser-xml | ||
:idprefix: id_ | ||
This addon provides *standalone* functionality, and *exports services* for use in other addons. | ||
It enables parsing of XML using the https://github.com/forge/xml-parser project | ||
|
||
=== Depends on | ||
[options="header"] | ||
|=== | ||
|Addon |Exported |Optional | ||
|resources | ||
|yes | ||
|yes | ||
|
||
|simple | ||
|yes | ||
|no | ||
|
||
|=== | ||
|
||
== Setup | ||
This Addon requires the following installation steps. | ||
|
||
=== Add configuration to pom.xml | ||
To use this addon, you must add it as a dependency in the *pom.xml* of your `forge-addon` classified artifact: | ||
[source,xml] | ||
---- | ||
<dependency> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>parser-xml</artifactId> | ||
<classifier>forge-addon</classifier> | ||
<version>${version}</version> | ||
</dependency> | ||
---- | ||
== Features | ||
XMLResource for XML files:: | ||
Allows easy manipulation of xml data | ||
+ | ||
[source,java] | ||
---- | ||
@Inject private ResourceFactory factory; | ||
XMLResource resource = factory.createResource(new File("pom.xml")).reify(XMLResource.class); | ||
Node node = resource.getXmlSource(); | ||
// Manipulate node | ||
... | ||
// save it | ||
resource.setContents(node); | ||
---- |