This is an automated email from the ASF dual-hosted git repository. pjfanning pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/poi-xmlbeans.git
commit 4fb0123dac0bb243bf533d9590fe588a3ee1de0d Author: PJ Fanning <[email protected]> AuthorDate: Mon Nov 16 05:12:50 2026 +0100 expect strict assessment of Any2LocalT's no-namespace attribute Since #168 a restriction's attribute wildcard takes processContents from its own anyAttribute, so Any2LocalT's ##local wildcard is strict rather than the base type's skip. No global no-namespace attribute is declared, so an unqualified attribute is not resolved, as Xerces also reports. Co-Authored-By: Claude Opus 5.5 <[email protected]> --- .../scomp/derivation/restriction/detailed/AttrWCRestriction.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/test/java/scomp/derivation/restriction/detailed/AttrWCRestriction.java b/src/test/java/scomp/derivation/restriction/detailed/AttrWCRestriction.java index 755ee23d..d2a9fdb0 100644 --- a/src/test/java/scomp/derivation/restriction/detailed/AttrWCRestriction.java +++ b/src/test/java/scomp/derivation/restriction/detailed/AttrWCRestriction.java @@ -58,7 +58,9 @@ public class AttrWCRestriction { * should be able to replace the any w/ local... * attrs not in target ns are therefore illegal * Skip to strict - * No namespace should be OK, any other namespace should be notOK + * A no-namespace attribute matches the wildcard, but the restriction's own anyAttribute is strict + * (XML Schema 1.0 3.4.2) and no global no-namespace attribute is declared, so it is not resolved. + * Any other namespace does not match the wildcard at all. */ @Test void testAny2LocalStrict() throws Throwable { @@ -68,9 +70,12 @@ public class AttrWCRestriction { " xmlns:foo=\"http://xbean/scomp/derivation/AttributeWCRestriction\"" + " testattribute=\"XBean\"/>"; Any2LocalDocument doc = Any2LocalDocument.Factory.parse(input); - assertTrue(doc.validate(validateOptions)); + assertFalse(doc.validate(validateOptions)); + assertArrayEquals(new String[]{XmlErrorCodes.ASSESS_ATTR_SCHEMA_VALID$NOT_RESOLVED}, + getErrorCodes(validateOptions)); //a diff ns is not OK + validateOptions = createOptions(); input = "<foo:Any2Local " + " xmlns:foo=\"http://xbean/scomp/derivation/AttributeWCRestriction\"" + --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
