Skip to content

XML connector: a filter on an attribute name in another case than the schema's finds nothing #218

Closed

Description

@maximthomas

Raised in the review of #217. Line references are to 953cb5a.

The framework compares attribute names without regard to case, and with #217 create and update write an attribute given in another case under the schema's name. A filter does not map the name. XMLFilterTranslator takes the element name from the filter's attribute as it is spelled (L66-L76), and every expression it builds gets the element name from there. The XQuery then matches element names exactly.

Observed with XMLFilterTranslator(false) and XMLHandlerImpl.search, on the test schema OpenICF-xml-connector/src/test/resources/test/xml_store/ef2bc95b-76e0-48e2-86d6-4d4f44d4e4a4.xsd, against one account stored as <icf:__NAME__>alice</icf:__NAME__> and <ri:lastname>Last-alice</ri:lastname>:

  • EqualsFilter(lastname=Last-alice) finds the account. LastName=Last-alice and LASTNAME=Last-alice find nothing.
  • EqualsFilter(__NAME__=alice) finds the account. __name__=alice finds nothing.

So a caller that spells a name differently from the schema gets an empty result instead of the entry. Before #217, update with LastName=X appended <ri:LastName>X</ri:LastName>, so a filter in that spelling at least found the values written in it. With #217, update writes <ri:lastname>X</ri:lastname>, and the filter finds nothing. Elements like <ri:LastName> that the old update wrote stay in existing files. A filter in that spelling still matches them, at the value they were left with.

A fix would map the filter's attribute name to the schema's spelling before the element name is built. checkAttribute does that in #217: it looks the name up exactly first, then without regard to case, and uses AttributeInfo.getName(). The translator is created in XMLConnector.createFilterTranslator (L201-L203), which has the handler and so the schema.

Activity

  1. self-assigned this
    on Nov 2, 2026
  2. added 2 commits that reference this issue on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingconnector:xmlXML connector

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions