ppkarwasz commented on PR #88: URL: https://github.com/apache/logging-log4j-tools/pull/88#issuecomment-1855856145
Hi @vy, > To check if I get the wiring right, I share my notes below. > > 1. A to-be-implemented `PluginScanner` generates `plugins.xml` (similar to the one in `test/resources/META-INF/log4j/plugins.xml`) from `log4j-core.jar`, `log4j-layout-template-json.jar`, etc. > > 2. Modello, provided with `src/main/mdo/plugins.xml`, generates DTOs and an XML reader/writer. > > 3. We use Modello-generated DTOs and the XML reader to read `plugins.xml`. > > 4. Using DTOs populated from the XML, we manually generate XSD ourselves. > > > Correct? Exactly > ### `plugins.xml` file name confusion I corrected it, thanks. > ### `src/site` > > `src/site` is hand-crafted as a showcase, right? Yes, I will use it later to test the generation of AsciiDoc. The idea is to know the rough structure of the documentation, so that we know what elements we need. In the showcase documentation attributes and elements are in separate sections for example, so I would like to distinguish the two types. > ### XML `group`s > > I think the problem you're describing is as follows: > > ``` > <complexType name="org.apache.logging.log4j.core.config.LoggerConfig"> > <sequence> > <group ref="log4j:org.apache.logging.log4j.core.config.AppenderRef.group" minOccurs="0" maxOccurs="unbounded"/> > <group ref="log4j:org.apache.logging.log4j.core.Filter.group" minOccurs="0"/> > </sequence> > <attribute name="name" type="string"/> > </complexType> > ``` > > Naively thinking, wouldn't omitting the `sequence` work? That is, > > ``` > <complexType name="org.apache.logging.log4j.core.config.LoggerConfig"> > <group ref="log4j:org.apache.logging.log4j.core.config.AppenderRef.group" minOccurs="0" maxOccurs="unbounded"/> > <group ref="log4j:org.apache.logging.log4j.core.Filter.group" minOccurs="0"/> > <attribute name="name" type="string"/> > </complexType> > ``` Unfortunately the XMLSchema XSD does not allow that. I think we'll need to decide whether writing elements in an arbitrary order is important to users. We can assume for now it isn't and improve the schema later. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
