Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattsse/plcopen-xml
java parser for the plcopen-xml standard
https://github.com/mattsse/plcopen-xml
Last synced: 18 days ago
JSON representation
java parser for the plcopen-xml standard
- Host: GitHub
- URL: https://github.com/mattsse/plcopen-xml
- Owner: mattsse
- License: gpl-3.0
- Created: 2018-01-18T22:48:12.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-20T23:25:14.000Z (almost 7 years ago)
- Last Synced: 2024-10-06T21:42:11.197Z (about 1 month ago)
- Language: Java
- Size: 188 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# plcopen-xml
Bindings for the [plcopen-xml](http://www.plcopen.org/pages/tc6_xml/) format.
The Class hierachy is compliant to its [schema](src/main/resources/tc6_xml_v201.xsd).
### Usage
#### Parse plc-open xml file
```java
import org.plcopen.xml.tc60201.*;
File xml = new File("plc-xml.xml");
Project project = PlcXmlUtil.unmarshal(xml);```
#### Filtering
Filter the whole project tree
```java
// get all Pou Objects in the project
List allPous = project.getAllChildren(Pou.class);```
#### Save project as plc-open xml file
```java
import org.plcopen.xml.tc60201.*;
File output = new File("plc-xml.xml");
PlcXmlUtil.marshall(project, output);```
### Troubleshooting
In case of namespace issues, edit the namespace annotation (`@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.plcopen.org/xml/tc6_0200"`) in [package-info](./src/main/java/org/plcopen/xml/tc60201/package-info.java) to the correct version.