Is it possible to get restrictions of specific element when I'm parsing XML file in Java?
For example, if I have a schema:
<xs:element name="MyString" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
when I get node MyString during XML file parsing I want to be able to acquire information that its restrictions are xs:string and maxLength = 100.
I would recommend this project.
It is the same jaxb plugin as Puce linked, but with proper maven project and some improvements.
You could look for/ write a JAXB plugin to generate Bean Validation Annotations (JSR-303), e.g.:
http://metro.1045641.n5.nabble.com/JAXB-plugin-to-generate-Bean-Validation-Annotations-JSR-303-td5598189.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With