[jdom-interest] Attribute name verification special casing for xml:base

Jason Hunter jhunter at acm.org
Sun Jun 16 22:41:24 PDT 2002


Strictly speaking, would "foo:space" be legit and operate the same as
"xml:space" if the "foo" prefix mapped to the standard XML namespace
URI?  If so, then I'm OK with passing it in as normal.  If not, it's a
special case since the prefix is hard-coded.

-jh-

Elliotte Rusty Harold wrote:
> 
> The checkAttributeName() method in Verifier currently allows xml:base
> and xml:space as special cases:
> 
>     public static String checkAttributeName(String name) {
>         // Check basic XML name rules first
>         String reason;
>         if ((reason = checkXMLName(name)) != null) {
>             return reason;
>         }
> 
>         // Allow xml:space, xml:lang, and xml:base as special cases
>         if (name.equals("xml:space") ||
>             name.equals("xml:lang")) {
>             return null;
>         }
> 
> At a minimum we need to add xml:base as another special case since it is
> now officially endorsed by the W3C and has been for some time:
> 
>     public static String checkAttributeName(String name) {
>         // Check basic XML name rules first
>         String reason;
>         if ((reason = checkXMLName(name)) != null) {
>             return reason;
>         }
> 
>         // Allow xml:space, xml:lang, and xml:base as special cases
>         if (name.equals("xml:space") ||
>             name.equals("xml:lang") ||
>             name.equals("xml:base")) {
>             return null;
>         }
> 
> An alternative would be not to special case these at all, and just have
> clients pass in the relevant namespaces and prefixes for xml: if they
> want to use these attributes.
> 
> Thoughts?
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list