oscerd opened a new pull request, #29304: URL: https://github.com/apache/camel/pull/29304
Fixes [CAMEL-26519](https://issues.apache.org/jira/browse/CAMEL-26519). Test-only change. `DocExamplesXmlSchemaTest` skips a doc fragment that uses a namespace prefix its page declares elsewhere (`camel:`, `prop:`, `xsl:` ...), since the schemas cannot judge it. It recognised that case by looking for the English text `is not bound` in the parser's error message. The JDK words that message in the language of the default locale, so on a build that does not run in English the check fails on the complete Spring XML example of `using-propertyplaceholder.adoc`. Its `<camelContext>` is validated on its own, without the `xmlns:prop` declared on the enclosing `<beans>`: ``` Il prefisso "prop" per l'attributo "prop:stopOnException" associato a un tipo di elemento "multicast" non è associato. ``` German and French builds fail the same way, as the message is translated there too; CI runs in English, which is why only local builds failed. ### Change When validation fails, the test now asks the fragment itself whether it uses an undeclared prefix: `usesAnUndeclaredPrefix` parses it without namespaces (which accepts what a namespace-aware parser rejects) and looks for an element or attribute prefix with no `xmlns:` declaration on the element or an ancestor (`xml:` is bound by definition). A fragment that does is left alone, as before; any other failure is reported, as before. ### Tests `anUndeclaredPrefixIsLeftAloneInAnyLocale` switches the default locale to English, Italian, German, French and Japanese in turn and checks that a fragment and a `<camelContext>` using an undeclared `prop:` prefix are left alone, while a real mistake (a `<from>` with text content) is still reported in every one of them. It also checks the prefix detection directly: declared on an ancestor, `xml:`, an undeclared element prefix and an undeclared attribute prefix. Removing the fix (putting back the `is not bound` match) makes the new test fail in its Italian pass, in an English JVM: `a camelContext with an undeclared prefix, in it`. The whole camel-catalog suite (1124 tests) passes with `LANG=it_IT.UTF-8` and with `LANG=C.UTF-8`; before, it failed in Italian. Full reactor (`clean install -DskipTests`) green; nothing is regenerated. _Claude Code on behalf of oscerd_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
