TEIC / TEI

The Text Encoding Initiative Guidelines
https://www.tei-c.org
Other
271 stars 88 forks source link

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

Closed TEITechnicalCouncil closed 8 years ago

TEITechnicalCouncil commented 10 years ago

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.

Original comment by: @martindholmes

TEITechnicalCouncil commented 8 years ago

This issue was originally assigned to SF user: rahtz Current user is: sebastianrahtz

TEITechnicalCouncil commented 10 years ago

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.

Original comment by: @sebastianrahtz

TEITechnicalCouncil commented 10 years ago

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?

Original comment by: @martindholmes

TEITechnicalCouncil commented 10 years ago

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

bit of suck it and see, I think

Original comment by: @sebastianrahtz

TEITechnicalCouncil commented 10 years ago

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.

Original comment by: @lb42

TEITechnicalCouncil commented 10 years ago

"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

Original comment by: @sebastianrahtz

TEITechnicalCouncil commented 10 years ago

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

Original comment by: @lb42

TEITechnicalCouncil commented 10 years ago

Original comment by: @jamescummings

TEITechnicalCouncil commented 10 years ago

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

Original comment by: @jamescummings

TEITechnicalCouncil commented 10 years ago

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>

Original comment by: @sebastianrahtz

TEITechnicalCouncil commented 10 years ago

Original comment by: @sebastianrahtz

TEITechnicalCouncil commented 10 years ago

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.

Original comment by: @sebastianrahtz