Loading ...
Sorry, an error occurred while loading the content.

The empty string or IDREFS

Expand Messages
  • Henri Sivonen
    Web Forms 2.0 has an attribute (form) that takes a list of IDs or the empty string (to denote that the form control is not associated with any form--not even
    Message 1 of 4 , Apr 4 12:42 AM
    • 0 Attachment
      Web Forms 2.0 has an attribute (form) that takes a list of IDs or the
      empty string (to denote that the form control is not associated with
      any form--not even an ancestor).

      If ID/IDREF checking is enabled, Jing does not allow me to do this
      attribute form {
      "" | xsd:ID
      }
      because the alternative types have different ID type.

      If I write a custom datatype that has IDREFS nature but passes the
      empty string, it still won't work, because RELAX NG DTD Compatibility
      requires that when an attribute has IDREFS nature, running split() on
      the value must return a list of one or more tokens (and here the list
      obviously has zero tokens).

      (In my opinion, the restriction placed by the spec is slightly too
      restrictive. The system could still work with split returning zero
      tokens for ID, IDREF and IDREF if that was defined to mean that no ID
      assignment nor referencing happens.)

      Is there any way to have an attribute value that both has the IDREFS
      nature and allows the empty string?

      --
      Henri Sivonen
      hsivonen@...
      http://hsivonen.iki.fi/
    • Henri Sivonen
      ... Doh. I meant attribute form { | xsd:IDREFS } -- Henri Sivonen hsivonen@iki.fi http://hsivonen.iki.fi/
      Message 2 of 4 , Apr 4 1:03 AM
      • 0 Attachment
        On Apr 4, 2006, at 10:42, Henri Sivonen wrote:

        > If ID/IDREF checking is enabled, Jing does not allow me to do this
        > attribute form {
        > "" | xsd:ID
        > }

        Doh. I meant
        attribute form {
        "" | xsd:IDREFS
        }

        --
        Henri Sivonen
        hsivonen@...
        http://hsivonen.iki.fi/
      • Eric van der Vlist
        Hi, ... This is forbidden per the first bullet point of the spec (http://relaxng.org/compatibility-20011203.html#id): * its parent is an attribute element In
        Message 3 of 4 , Apr 4 11:05 PM
        • 0 Attachment
          Hi,

          Le mardi 04 avril 2006 à 11:03 +0300, Henri Sivonen a écrit :
          > On Apr 4, 2006, at 10:42, Henri Sivonen wrote:
          >
          > > If ID/IDREF checking is enabled, Jing does not allow me to do this
          > > attribute form {
          > > "" | xsd:ID
          > > }
          >
          > Doh. I meant
          > attribute form {
          > "" | xsd:IDREFS
          > }

          This is forbidden per the first bullet point of the spec
          (http://relaxng.org/compatibility-20011203.html#id):

          * "its parent is an attribute element"

          In your case, the parent element of the "data" pattern would be a
          "choice"...

          ID/IDREF/IDREFS have been introduced in RNG as a "DTD Compatibility"
          feature. They try to mimic DTDs and have pretty much all the
          restrictions of DTDs (in other word, if you want to use them to do
          something a DTD can't do you're very likely out of luck!).

          See
          http://books.xmlschemata.org/relaxng/relax-CHP-8-SECT-3.html#relax-CHP-8-SECT-3.2 for more details.

          Hope this helps.

          Eric
          --
          GPG-PGP: 2A528005
          Curious about Relax NG? Read my book online.
          http://books.xmlschemata.org/relaxng/
          ------------------------------------------------------------------------
          Eric van der Vlist http://xmlfr.org http://dyomedea.com
          (ISO) RELAX NG ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
          (W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
          ------------------------------------------------------------------------
        • Henri Sivonen
          ... So it appears. :-( ... Well, fortunately the lexical space of datatypes with the ID-type ID is not restricted to NCName. So there is something that can be
          Message 4 of 4 , Apr 10 11:18 AM
          • 0 Attachment
            On Apr 5, 2006, at 09:05, Eric van der Vlist wrote:

            >> Doh. I meant
            >> attribute form {
            >> "" | xsd:IDREFS
            >> }
            >
            > This is forbidden per the first bullet point of the spec
            > (http://relaxng.org/compatibility-20011203.html#id):
            >
            > * "its parent is an attribute element"

            So it appears. :-(

            > ID/IDREF/IDREFS have been introduced in RNG as a "DTD Compatibility"
            > feature. They try to mimic DTDs and have pretty much all the
            > restrictions of DTDs (in other word, if you want to use them to do
            > something a DTD can't do you're very likely out of luck!).

            Well, fortunately the lexical space of datatypes with the ID-type ID
            is not restricted to NCName. So there is something that can be done
            that DTDs cannot do.

            Thanks.

            --
            Henri Sivonen
            hsivonen@...
            http://hsivonen.iki.fi/
          Your message has been successfully submitted and would be delivered to recipients shortly.