Skip to content

Latest commit

 

History

History
47 lines (42 loc) · 1.04 KB

README.asciidoc

File metadata and controls

47 lines (42 loc) · 1.04 KB

parser-xml

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

Addon Exported Optional

resources

no

no

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:

<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

@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);