#669 Explanation of schemaSpec/@start could be more helpful

AMBER
closed
None
5(default)
2014-05-19
2014-05-16
Martin Holmes
No

If I'm creating a customization, and I want to make it possible for one of my own elements to serve as the root of a file, my instinct would be to use the namespace of the element like this:

<schemaSpec ident="landscapes" start="TEI li:property" xmlns:li="http://hcmc.uvic.ca/ns/landscapes">

However, if you do that, only the TEI element will be available as the root of your document. What you must do instead is this:

<schemaSpec ident="landscapes" start="TEI property">

In other words, you have to omit all mention of the namespace. I guess that what this really means is that the @start element is expecting the @ident values of elements defined in the schema, not their QNames. You can figure this out from the SVG example, but I think it would be clearer if the definition of @start specified explicitly that what's required is the bare @ident with no namespace qualification.

I have no idea what happens if you want to have a custom element in your own namespace, but which has the same local name as an existing TEI element. That's probably a bad idea for all sorts of reasons, but it shouldn't be structurally impossible; namespaces are supposed to allow for this sort of thing.

Discussion

  • the @start wants the names of patterns not elements; we name patterns after elements, but its not compulsory. So namespaces are not relevant. If you wanted to distinguish TEI from non-TEI, you'd use the @prefix stuff.

     
  • Martin Holmes
    Martin Holmes
    2014-05-19

    How would I do that? Say I had a mixed-namespace document with TEI and XHTML, and I wanted to allow documents to be rooted on tei:div or xhtml:div. How would I do that?

     
  • i think i may have been lying, actually. I have no idea now :-{

    bit of suck it and see, I think

     
  • Lou Burnard
    Lou Burnard
    2014-05-19

    Well, after all that running you probably deserve a bit of a lie down. However, I think the prtoblem here is that we map the @start attribute on <schemaSpec> to the RelaxNG <start> element, but not all the features supported by the latter are available on the former. For example, we don't support the ability to specify whether multiple start patterns are combined or interleaved. And we don't offer the opportunity to specify a default namespace, which RNG offers via its @ns attribute. If we want to do that, we'd need to define an new ODD feature, methinks.

     
  • "we don't support the ability to specify whether multiple start patterns are combined or interleaved". what??? I don't understand what that might mean.

    why would we care about the default namespace in a RELAX NG schema when it is automatically generated? i cant see how it impacts on the user

     
  • Lou Burnard
    Lou Burnard
    2014-05-19

    Look at the spec for the <start element in RELAXNG,

     
    • On 19 May 2014, at 16:12, Lou Burnard louburnard@users.sf.net wrote:

      Look at the spec for the <start element in RELAXNG,

      I did, and I can’t see any sense. can you think of a real example?

      Sebastian Rahtz
      Director (Research) of Academic IT
      University of Oxford IT Services
      13 Banbury Road, Oxford OX2 6NN. Phone +44 1865 283431

      Não sou nada.
      Nunca serei nada.
      Não posso querer ser nada.
      À parte isso, tenho em mim todos os sonhos do mundo.

       
  • James Cummings
    James Cummings
    2014-05-19

    Assigning to Sebastian Rahtz for triaging, reporting to council, etc.

     
  • James Cummings
    James Cummings
    2014-05-19

    • assigned_to: Sebastian Rahtz
     
  • duly extended prose in USE.

    example as requested:

    <schemaSpec prefix="tei_" ident="testmixed" xml:lang="en" start="TEI div my_div">
            <moduleRef key="core"/>
            <moduleRef key="tei"/>
            <moduleRef key="header"/>
            <moduleRef key="textstructure"/>
        <elementSpec ident="div" prefix="my_" mode="add">
          <classes>
            <memberOf key="model.divLike"/>
          </classes>
          <content allowText="true">
          </content>
        </elementSpec>
    </schemaSpec>
    
     
    • status: open --> closed