Closed dmj closed 10 months ago
Actually, if there is an <altIdent>
(or <altIdent>
s) that gets grabbed as the local name. So something like QName( ( @ns, ''http://www.tei-c.org/ns/1.0')[1], ( child::tei:altIdent[ lang( $currentLanguage ) ], @ident )[1] )
.
Except that we have just decided that a pre-processing step should ensure that there is only 1 <altIdent>
(of the proper language) child of any given <*Spec>
element, or only 1 that is annotated in some way that tells processor to use it. Thus:
QName( ( @ns, ''http://www.tei-c.org/ns/1.0')[1], ( child::tei:altIdent[ WHATEVER ], @ident )[1] )
, where [ WHATEVER ]
is not needed if we decide on only 1, or is [ @atop:useMe eq 'true']
or whatever.
To summarize the reasoning pro pre-processor: The altIdent supplies the recommended XML name for an element, class, attribute, etc. in some language. An elementSpec can have zero or more altIdent elements. When transpiling ODD to RNG we do not know which one to use or (!) if we should use altIdent over @ident at all.
For the transpiler we might define the following rules:
-or-
@sydb Is the pre-processing step that eliminates unwanted altIdents for other languages part of the creation of the processedODD? If so, aren't we going against what Council recommended wrt languages, that we preserve all language versions through the entire process up to the RNG generation?
@martindholmes ATOP will have two steps: a) process the source ODD to create a fully functional ODD w/ all external references resolved and b) transpile this ODD to a RelaxNG grammar. Removing ambiguities is the first part of the second step.
@all: What about the @ns attribute of the containing schemaSpec?
Does
<schemaSpec ns="http://example.com/ns">
<elementSpec ident="foobar"/>
</schemaSpec>
mean that the namespace URI of the element 'foobar' is 'http://example.com/ns'? In other words: Does an elementSpec inherit the @ns from an ancestor schemaSpec?
@dmj That's what I meant: the ambiguity fixes take place as part of a first pass in the second phase.
One reason I would like us to clarify our nomenclature is to make it easier to talk about these things:
See TEIC/TEI#2285.
@sydb, @HelenaSabel and I 2023-12-06: We see the current implementation of atop:get-element-qname() as correct and fully functional in the context of transpilation. However, we're now wondering how this bears on the question of how we decide when a downstream elementSpec constitutes a modification of an upstream one. Is it:
@ident
and the effective namespace are identical; or@ident
attribute matches. It appears that the current Stylesheets require no. 2; that means that @ident
is crucial and the only thing which matches a downstream modification to an upstream declaration is that attribute. This means that you can't use a modification to change the namespace of an element. But presumably nobody has ever tried to do this.
The
<elementSpec>
documents the structure, content, and purpose of a single element type. An XML element has a name which is a QName consisting of a possibly empty namespace URI, an optional prefix and a local name. The QName of a specified element is obtained as followed:@ns
attribute.@ident
attribute.The QName of a specified element thus can be constructed as follows:
QName( (@ns, 'http://www.tei-c.org/ns/1.0')[1], @ident)