Skip to content

report length facets in JavaNotationHolderEx.validateLexical#72

Open
aizu-m wants to merge 1 commit into
apache:trunkfrom
aizu-m:notation-validatelexical-length
Open

report length facets in JavaNotationHolderEx.validateLexical#72
aizu-m wants to merge 1 commit into
apache:trunkfrom
aizu-m:notation-validatelexical-length

Conversation

@aizu-m

@aizu-m aizu-m commented Jun 25, 2026

Copy link
Copy Markdown

Spotted while comparing the two NOTATION validation paths against the anyURI ones. Setting a too-long value throws, but loading the same value from a document validates clean.

base NOTATION enumerates t:a and t:bcdefgh; a derived type adds maxLength=3
document value 't:bcdefgh' (length 9, still in the inherited enumeration)

before:  doc.validate() == true, no errors raised
after:   cvc-maxLength-valid.1.1  NOTATION length (9) is greater than maxLength facet (3)

validateLexical called check(v, sType) and dropped the boolean it returns, so the length, minLength and maxLength facets were never handed to the ValidationContext. check() is the same helper set_text uses, and that path does reject the value (PR #45). The enumeration check does not catch it because the value is a legitimate inherited enumeration member.

The anyURI sibling, JavaUriHolderEx.validateLexical, already reports these facets inline. This makes NOTATION report them the same way and leaves check() untouched for the set path.

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.

1 participant