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

Matthew Davis <[email protected]>
Newsgroups gmane.text.tei.general
Message-ID <[email protected]>
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 <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.