Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regex error in Log4j-config.xsd #2357

Closed
wants to merge 1 commit into from
Closed

Fix regex error in Log4j-config.xsd #2357

wants to merge 1 commit into from

Conversation

MalKeshar
Copy link

@MalKeshar MalKeshar commented Mar 7, 2024

Trivial fix of error "The value of the facet 'pattern' is not a valid regular expression"

Before:

$ xmllint --schema Log4j-config.xsd /tmp/log4j2.xml --noout
regexp error : failed to compile: Wrong escape sequence, misuse of character '\'
regexp error : failed to compile: internal: no atom generated
regexp error : failed to compile: generate transition: atom == NULL
regexp error : failed to compile: xmlFAParseAtom: expecting ')'
regexp error : failed to compile: xmlFAParseRegExp: extra characters
Log4j-config.xsd:131: element pattern: Schemas parser error : Element '{[http://www.w3.org/2001/XMLSchema}pattern':](http://www.w3.org/2001/XMLSchema%7Dpattern':) The value '(|disable|\$\{[^{}]+\})' of the facet 'pattern' is not a valid regular expression.
...

And few same messages

After:

$ xmllint --schema log4j-core/src/main/resources/Log4j-config.xsd /tmp/log4j2.xml --noout
/tmp/log4j2.xml validates

"The value of the facet 'pattern' is not a valid regular expression"
@vy
Copy link
Member

vy commented Mar 8, 2024

@MalKeshar, thanks, much appreciated! The XSD misses a huge set of the available components and I am actively working on a project that will auto-generate this file from scratch. I expect to deliver a complete XSD within a couple of weeks. To avoid merge conflicts, and since there is a better solution in the making, I am inclined to close this PR. @ppkarwasz, thoughts?

@ppkarwasz
Copy link
Contributor

ppkarwasz commented Mar 8, 2024

I am closing this, since we'll remove the manually written schema soon.

I added a task pointing to this PR in the #1954 milestone. @MalKeshar, while the specific problem you are reporting will automatically cease to exist, when the file is deleted, we'll apply the procedure you suggested to the generated XSD file.

@ppkarwasz ppkarwasz closed this Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants