xproc / 3.0-steps

Repository for change requests to the standard step library and for official extension steps
10 stars 7 forks source link

Clarify XC0023 in p:rename #559

Closed ndw closed 4 months ago

ndw commented 5 months ago

Currently, the description of p:rename says:

It is a dynamic error (err:XC0023) if the pattern matches anything other than element, attribute or processing instruction nodes.

I think we should add:

It is a dynamic error (err:XC0023) if the pattern matches anything other than element, attribute or processing instruction nodes, or if it matches more than one attribute on a single element .

This is to cover the following error case:

         <p:rename match="@test:foo|@test:moo"
                   new-name="test:baz"
                   xmlns:test="http://test.com"/>

where the input is:

      <doc test:foo="value" test:moo="otherValue"
           xmlns:test="http://test.com"/>

I think this is an erratum. It's logically an error condition, it's just a question of what error should be raised. We could invent a new error code, but it seems so similar to the other errors that I don't think it's necessary.