apache / logging-log4j-tools

Tools internally used by the Apache Log4j project
https://logging.apache.org/log4j/tools
Apache License 2.0
14 stars 18 forks source link

log4j-docgen: XSD generation doesn't allow @PluginValue annotated fields to be text content of the containing element #134

Open krallus opened 3 months ago

krallus commented 3 months ago

The log4j-config-2.xsd file generated by log4j-docgen and located at https://logging.apache.org/xml/ns/ does not allow for the <Property> element in log4j2.xml to contain a value as text content.

Using the generated XSD, this is valid:

<Property name="name2" value="value2"/>

but this is not valid:

<Property name="name1">value</property>

However, as seen here, both are valid forms.

In Property.java, value is annotated with @PluginValue. This is not the same as @PluginAttribute.

As implied in the description of PluginValue.java, the configuration for such an annotated field does not distinguish between attribute and "value" (text content), and so XSD generation of such annotated fields should allow for both (or, ideally, exclusively one or the other).

ppkarwasz commented 3 months ago

Thanks,

I'll add this to my TODO list.

Note: the documentation page will also change, since we have been strongly relying on the generated XSD to rewrite the documentation.