Re: a question about the use of XInclude in TEI documents.
Dario Kampkaspar <[email protected]>
| Newsgroups | gmane.text.tei.general |
|---|---|
| Message-ID | <[email protected]> |
Dear Martin and all,
Gerrit's hint is most likely the right one. An XML-file is processed
as-is after the XInclude has been processed. That means in particular
that any XML imported stays in whatever namespace it is in.
If no namespace is given, then the snippet is in no namespace which
seems to be the case here. Hence, changing the XML to be included to
<lg xmlns="http://www.tei-c.org/ns/1.0>
<l>Mary had a little lamb</l>
<l>Its fleece was white as snow</l>
</lg>
should do the trick.
While Matthew's hint at the @parse parameter is not incorrect, assuming
the target to be XML is the default behaviour (otherwise, with
@parse=text, it will be treated more or less like CDATA). Also, while
using the xi:fallback mechanism can help to avoid (fatal) parser errors,
it is not required for XInclude to work.
Hope this helps,
All best,
Dario
On 29.01.2017 22:21, Imsieke, Gerrit, le-tex wrote:
> I think you’ll have to put the standalone lg document in the TEI
> namespace.
>
> On 29.01.2017 22:18, Martin Mueller wrote:
>> I am puzzled by the use of Xinclude in TEI . Given a minimal TEI
>> document
>> with a
>> body
>>
>> <body>
>> <p>some text</p>
>> </body>
>>
>> I can add as a right sibling to <p>:
>>
>> <lg>
>> <l>Mary had a little lamb</l>
>> <l>Its fleece was white as snow</l>
>> </lg>
>>
>> The resulting document will validate. If I now try to replace the <lg>
>> element with an XInclude command like
>>
>> <body>
>> <p>some text</p>
>> <xi:include
>> href="http://panini.northwestern.edu/mmueller/littlelamb2.xml"
>> xmlns:xi="http://www.w3.org/2001/XInclude"/>
>> </body>
>>
>>
>> oXygen gives me a validating error message about <lg> not being allowed
>> in this position. On the other hand, a transformation will produce the
>> correct result.
>>
>> Am I doing something wrong or is the error message in error?
>>
>> I looked in the Guidelines for help with XInclude. A search for the term
>> leads you to a section on stand-off markup, which is not very helpful to
>> non-technical users like myself. There is no example of the most obvious
>> case (including a TEI fragment like the <lg> element above). In
>> particular, there is no help with the how, what, and where of required
>> namespaces, which I always find a particularly tricky thing to get
>> right.
>> A little tutorial on the TEI Wiki would be helpful, and I'd be happy to
>> help with writing it if somebody with a clearer understanding could
>> point
>> the way.
>>
>>
>>
>>
>>
>>
>>
>> Martin Mueller
>> Professor emeritus of English and Classics
>> Northwestern University
>>
>
--
Dario Kampkaspar
Editionsprojekt Karlstadt – Editionsprojekt Rist – DARIAH-DE
Herzog August Bibliothek
Lessingplatz 1
D-38304 Wolfenbüttel
Phone: +49 - 53 31 - 808-321