Quantcast

a question about the use of XInclude in TEI documents.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

a question about the use of XInclude in TEI documents.

Martin Mueller
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: a question about the use of XInclude in TEI documents.

Imsieke, Gerrit, le-tex
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
>

--
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
[hidden email], http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: a question about the use of XInclude in TEI documents.

Matthew Davis-2
In reply to this post by Martin Mueller
Martin -

I implemented an XInclude in some of my files in fold in some general editorial notes so I could display them multiple times but wouldn’t have to repeat them across multiple files.  What I did to do that is format it something like this:

        <xi:include href="Quis_Dabit/Clopton_Editorial.xml" xpointer="EditNotes" parse="xml">
            <xi:fallback>
                <para>
                    <emphasis>The editorial notes were not collected.  Please check the xml wrapper to ensure it is pointing to the right location.<br/></emphasis>
                </para>
            </xi:fallback>
        </xi:include>

That xpointer and parse attributes are the pieces I think you may be missing.  You may not need the xpointer piece if you’re taking the whole file, but I do believe you’ll need the parse section.

I did get some validation errors from Oxygen, but running my xslt on the file resulted in correct html, so I think the fault may lie in Oxygen there. So I would suggest running the xslt and seeing if you get the expected result, and if not then incorporate the parse attribute, and then the xpointer attribute.

All the best,
—Matt

On Jan 29, 2017, at 4:18 PM, Martin Mueller <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: a question about the use of XInclude in TEI documents.

Dario Kampkaspar
In reply to this post by Imsieke, Gerrit, le-tex

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
Loading...