[tei-council] Conference call Nov. 29

Syd Bauman Syd_Bauman at Brown.edu
Sat Nov 27 14:56:19 EST 2004


> ...
> <xsl:when test="starts-with(@target,'#')">
> <a href="{@target}">
>     <xsl:apply-templates 
> select="key('IDS',substring-after(@target,'#'))" mode="xref"/>
> </a>
> ....

Sorry, my XSLT just isn't that good. Some things I don't understand. 

   <xsl:when test="starts-with(@target,'#')">

The test here checks that the first character of the value
of the target= attribute is "#". Is that sufficient? We haven't
agreed on the details yet, but the suggestion was that target= be
declared as either
   xsd:anyURI			# for P4 IDREF
or
   list { xsd:anyURI+ }		# for P4 IDREFS
Will a conforming processor have already handled whitespace issues?

Although I found no prose to that effect, if I read the schema
provided in <ref
target="http://www.w3c.org/TR/xmlschema-2/#schema">XML Schema Part 2:
Datatypes</ref> correctly, it should, at least for xsd:anyURI.
(Search for the string "anyURI.whitespace".)

I realize I didn't ask for sample code to handle the new version of
IDREFS, but I am a bit concerned about leading & trailing whitespace
for a RelaxNG list. <ref
target="http://books.xmlschemata.org/relaxng/ch09s09.html">The
book</ref> doesn't really say either way. I suppose it's worth a tiny
test, and we can at least see what particular processors do. Perhaps
I'll try to whip one up later today.


   select="key('IDS',substring-after(@target,'#'))"
   mode="xref"

Here I'm a bit lost. The first line selects all nodes for which the
IDS key matches the value of target= after the "#". So supposedly
somewhere there's some code to set the key for each element to its
xml:id= value, right? I'm guessing the mode=xref business tells XSLT
which of several possible modes to use when processing the templates
that are selected -- I'm guessing that if no 'xref' mode is defined
for a template that is selected, nothing happens.


Maybe I should ask for a more specific example. We have a drama
encoded as follows.

P4
--
<castList>
   <!-- ... -->
   <castItem><role id="r.jp">Colonel Juan Peron</role></castItem>
   <!-- ... -->
</castList>
<!-- ... -->
<sp who="r.jp">
   <speaker>Col. P.</speaker>
   <p> ... </p>
</sp>

P5
--
<castList>
   <!-- ... -->
   <castItem><role xml:id="r.jp">Colonel Juan Peron</role></castItem>
   <!-- ... -->
</castList>
<!-- ... -->
<sp who="#r.jp">
   <speaker>Col. P.</speaker>
   <p> ... </p>
</sp>


In both cases we want to ignore <speaker> elements and precede each
<sp> element with
   <span class="speaker">[content of correct <role> here]:</span>

How much more complicated is the P5 code than the P4 code? (I realize
that if users start doing things like
who="ftp://my.project.server/authLists/dramaRoles.xml#jp", or
who="https://my.project.server/authList.xml#xpath(//div[@type='roles']/div[@n='Evita']/role[7])
that processing will be much more complicated. But the fact that
processing for new functionality may not be easy doesn't give me
hives they way that my concern that processing what used to be easy
(the Col. Peron case, above) will become hard does.)




More information about the tei-council mailing list