XML Schema spec: Attribute Wildcard Intersection

Discussion in 'XML' started by Alain Frisch, May 2, 2005.

  1. Alain Frisch

    Alain Frisch Guest

    Hello,

    The following rule in the XML Schema spec, section "Schema Component
    Constraint: Attribute Wildcard Intersection" seems strange to me:

    =======================================
    3 If either O1 or O2 is a pair of not and a value (a namespace name or
    ·absent·) and the other is a set of (namespace names or ·absent·), then
    that set, minus the negated value if it was in the set, minus ·absent· if
    it was in the set, must be the value.
    =======================================


    I don't understand the rationale behind "minus ·absent· if it was in the
    set". This means that ·absent· is removed whenever it appears in the set.
    It would be natural to remove it iff the second component of the "not"
    pair is ·absent·.

    Can someone explain the rationale behind the spec ?

    -- Alain Frisch
    Alain Frisch, May 2, 2005
    #1
    1. Advertising

  2. In article <d566bp$2rv4$>,
    Alain Frisch <> wrote:

    >3 If either O1 or O2 is a pair of not and a value (a namespace name or
    >·absent·) and the other is a set of (namespace names or ·absent·), then
    >that set, minus the negated value if it was in the set, minus ·absent· if
    >it was in the set, must be the value.


    >I don't understand the rationale behind "minus ·absent· if it was in the
    >set". This means that ·absent· is removed whenever it appears in the set.
    >It would be natural to remove it iff the second component of the "not"
    >pair is ·absent·.


    >Can someone explain the rationale behind the spec ?


    The case described is the intersection of ##other and and set of
    namespaces. In this context, "absent" means "no-namespace".

    When the target namespace is absent, ##other means any non-absent
    namespace. When the target namespace is not absent, ##other means any
    *non-absent* namespace other than the target namespace. I think the
    idea behind this is that ##other is intended to allow extensibility by
    having attributes from other namespaces, not by having attributes in
    no namespace.

    So in the latter case, the intersection should exclude both the target
    namespace and absent.

    Now for some reason that is not clear to me [*], the namespace
    constraint ##other is not represented as a pair of "not" and (a set of
    the target namespace and absent), but merely as a pair of "not" and
    the target namespace. So to make the intersection give the right
    answer, the spec has to give the peculiar definition quoted.
    Similarly, it has to give a peculiar definition for "Wildcard allows
    Namespace Name" a few paragraphs earlier.

    [*] It's probably one of those "historical" reasons.

    -- Richard
    Richard Tobin, May 2, 2005
    #2
    1. Advertising

  3. Alain Frisch

    Alain Frisch Guest

    Richard Tobin, dans le message (comp.text.xml:68011), a écrit :
    > When the target namespace is absent, ##other means any non-absent
    > namespace. When the target namespace is not absent, ##other means any
    > *non-absent* namespace other than the target namespace.


    Many thanks, I missed that. It makes perfect sense, now. I was also
    wondering about rule 6, but it is now clear as well.

    I have another question. Rule 5 is:

    =============================================
    If the two are negations of different namespace names, then the
    intersection is not expressible.
    =============================================

    Can this actually happen in a valid XML Schema document? Does the spec
    make it impossible with another condition somewhere else? Otherwise, how
    is the processor supposed to handle this case?


    -- Alain
    Alain Frisch, May 3, 2005
    #3
  4. In article <d575lm$1c13$>,
    Alain Frisch <> wrote:
    >I have another question. Rule 5 is:
    >
    >=============================================
    >If the two are negations of different namespace names, then the
    >intersection is not expressible.
    >=============================================
    >
    >Can this actually happen in a valid XML Schema document? Does the spec
    >make it impossible with another condition somewhere else? Otherwise, how
    >is the processor supposed to handle this case?


    It can happen, if you restrict one ##other wildcard with another
    (obviously you must have imported a schema for another namespace to be
    able to do this).

    I think the processor is supposed to handle it by saying "you can't do
    that".

    -- Richard
    Richard Tobin, May 3, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,497
    Markus
    Nov 23, 2005
  2. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,170
    Stanimir Stamenkov
    Apr 25, 2005
  3. Replies:
    7
    Views:
    819
  4. Andrew Chen
    Replies:
    1
    Views:
    181
    David Chelimsky
    Mar 25, 2008
  5. Henry Law
    Replies:
    12
    Views:
    196
    Anno Siegel
    Jun 18, 2005
Loading...

Share This Page