xmlet / XsdParser

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

Inconsistent Readme.md #47

Closed wolfomat closed 1 year ago

wolfomat commented 1 year ago

First of all, thank you for contributing this library!

Now the issue:

In the README.md there's a simple usage example:

public class ParserApp {
    public static void main(String [] args) {
        String filePath = "Your file path here.";
        XsdParser parserInstance1 = new XsdParser(filePath);

        //or

        String jarPath = "Your jar path here.";
        String jarXsdPath = "XSD file path, relative to the jar root.";
        XsdParserJar parserInstance2 = new XsdParserJar(jarPath, jarXsdPath);

        Stream<XsdElement> elementsStream = parserInstance1.getResultXsdElements(filePath);
        Stream<XsdSchema> schemasStream = parserInstance1.getResultXsdSchemas(filePath);
    }
}

Calling the Lines:

        Stream<XsdElement> elementsStream = parserInstance1.getResultXsdElements(filePath);
        Stream<XsdSchema> schemasStream = parserInstance1.getResultXsdSchemas(filePath);

Is not possible, since there's no overload of those functions. Correct is:

        Stream<XsdElement> elementsStream = parserInstance1.getResultXsdElements();
        Stream<XsdSchema> schemasStream = parserInstance1.getResultXsdSchemas();

Without the filePath. I've wondered about this redudancy, since the Parser gets the Paths.

lcduarte commented 1 year ago

Hello,

Thanks for using the library and the issue.

I probably fixed the redundancy a long time ago and forgot to update the readme, it's updated now.