On Thu, Feb 03, 2022 at 01:53:29PM -0800, Tim Bray wrote: > > Then if you look at 9.10.5 "Usage Examples", the examples make it pretty > clear what's happening, and that the namespace prefix has to be used in the > element. > > But, I think that since this is not an XML best practice, practitioners > should be warned that their XML infrastructure has to be capable of this > optional behavior.
<https://www.w3.org/2001/tag/doc/qnameids> may be relevant background reading. This document seems to acknowledge that references to prefixes may indeed exist in attribute values or element content. Section 5 says: "[...] it is already established practice. It is simply not practical to suggest that this usage should be forbidden on architectural grounds. It seems that XML schema's QName type has similar issues like YANG's identityref type regarding the need to map prefixes to namespace URI. > By the way, everywhere else in 7950, when you have an xmlns:whatever= > definition, the "whatever" prefix is used in the intended way, in front of > element and attribute names. So really, this one "Usage Examples" section > is the only place where it's explicit what's going on. The YANG leafs are typed and most types are harmless. A schema aware processor will know which XML elements can carry prefixed values. > So: No, those sections aren't wrong. Yes, in an ideal world they should be > changed. Or, just put the language in future YANG-related RFCs. It's a > short paragraph. The IETF meanwhile has ~55 published RFCs that contain YANG modules (and the industry has way more YANG modules). I am not sure how meaningful it is to start now to put language into all future RFCs that contain YANG modules to warn people that they will need an XML parser that exposes prefix to namespace URI bindings. (And then there are like other RFCs that used XSD QNames that may require a similar warning.) /js -- Jürgen Schönwälder Jacobs University Bremen gGmbH Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany Fax: +49 421 200 3103 <https://www.jacobs-university.de/> _______________________________________________ netmod mailing list [email protected] https://www.ietf.org/mailman/listinfo/netmod
