xmlet / XsdParser

A Parser that parses a XSD file into a Java Structure.
MIT License
80 stars 34 forks source link

Missing attribute default values #73

Closed skfcz closed 14 hours ago

skfcz commented 1 day ago

Describe the bug The default values defined in an attribute definition are not parsed into the model

Expected behavior The default values should be available in the XsdAttriibute#defaultElement

Library Version Current master b7855d6

Solution

The default value is available in the map with the key 'default'.

The valuse of the map are then copied into XsdAttribute#defaultElement using
public class XsdAttribute extends XsdNamedElements { ... this.defaultElement = attributesMap.getOrDefault(DEFAULT_ELEMENT_TAG, defaultElement);

with the key public abstract class XsdAbstractElement { ... public static final String DEFAULT_ELEMENT_TAG = "defaultElement";

Changing to public static final String DEFAULT_ELEMENT_TAG = "default";

fixes the problem

lcduarte commented 1 day ago

Hello,

Thanks for the issue and the fix. I'll try to deploy a new version with the fix some time this week

lcduarte commented 14 hours ago

Hello,

The new version with the fix is available, 1.2.17.