apache / apache/logging-log4j-tools

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

Open
#134 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
Java
Stars
18
Forks
19
PR merge metrics
No merged PRs in 30d

Description

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

Using the generated XSD, this is valid:
```xml

```
but this is not valid:
```xml
value
```
However, as seen [here](https://logging.apache.org/log4j/2.x/manual/configuration.html#concise-syntax), **both** are valid forms.

In [Property.java](https://github.com/apache/logging-log4j2/blob/main/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Property.java), `value` is annotated with `@PluginValue`. This is not the same as `@PluginAttribute`.

As implied in the description of [PluginValue.java](https://github.com/apache/logging-log4j2/blob/main/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/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).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.