Master file support for TEI documents

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
ttasovac
Posts: 44

Master file support for TEI documents

Sun Jul 08, 2018 7:17 pm

I'm trying to apply oXygen's master file support to TEI documents, but that doesn't seem to work. I've noticed one old question in the forum https://www.oxygenxml.com/forum/topic13310.html?hilit=tei%20master but the instructions provided there still don't seem to help.

I have a project in which the master file support is enabled. Then I have a file called master.xml which is recognized by oXygen as a master. Inside the body element it includes an external segment:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" type="application/xml"
   schematypens="http://purl.oclc.org/dsdl/schematron"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
  <teiHeader>
      <fileDesc>
         <titleStmt>
            <title>Title</title>
         </titleStmt>
         <publicationStmt>
            <p>Publication Information</p>
         </publicationStmt>
         <sourceDesc>
            <p>Information about the source</p>
         </sourceDesc>
      </fileDesc>
  </teiHeader>
  <text>
      <body>
         <entry>
            <form>
               <orth>entry-in-master-file</orth>
            </form>
         </entry>
         <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="entry.xml"></xi:include>
      </body>
  </text>
</TEI>


The file entry.xml looks like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:tei="http://www.tei-c.org/ns/1.0">
    <form>
        <orth>entry-in-module</orth>
    </form>
</entry>


When I try to validate the master file, oXygen will tell me:

Code: Select all

element "entry" not allowed here; expected the element end-tag or element "ab", "addSpan", "alt", "altGrp", "anchor", "annotationBlock", "app", "argument", "bibl", "biblFull", "biblStruct", "byline", "camera", "caption", "castList", "cb", "certainty", "cit", "classSpec", "closer", "constraintSpec", "damageSpan", "dataSpec", "dateline", "delSpan", "desc", "div", "div1", "docAuthor", "docDate", "eTree", "eg", "elementSpec", "entry", "entryFree" ...


even though the element entry is of course allowed right there. I already have one entry element in the master file — to show that it should work. Similarly, if I try to validate entry.xml, it will give me the same error.

My external module has the TEI namespace so that shouldn't be a problem.

What am I doing wrong?

I am attaching a link to a folder which contains the above set up for testing purposes.

https://www.dropbox.com/s/aey3ldjk1lz680f/master-support-for-tei.zip?dl=0

Any tips would be greatly appreciated.
Radu
Posts: 5563

Re: Master file support for TEI documents

Mon Jul 09, 2018 9:56 am

Hi,

If you open the entry.xml please change in it the:

Code: Select all

xmlns:tei="http://www.tei-c.org/ns/1.0"


to:

Code: Select all

xmlns="http://www.tei-c.org/ns/1.0"


It took me about 10-15 minutes to realize this was the mistake :)

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ttasovac
Posts: 44

Re: Master file support for TEI documents

Mon Jul 09, 2018 10:39 am

Thanks, Radu. It took me much longer yesterday and I still didn't see it! :) I can't believe I didn't realize it myself. Many thanks, indeed.
ttasovac
Posts: 44

Re: Master file support for TEI documents

Mon Jul 09, 2018 6:41 pm

Dear Radu,

I have a follow-up question here. I've discovered that the validation of xi:included modules doesn't work in oXygen if the module has non-ascii (for instance Cyrillic) letters in the file name.

Please see attached. The master file includes two files, one called entry.xml and the other called одредница.xml. The master file validates with both included files, but of the two module files only entry.xml validates. одредница.xml gives an error about how the file is missing TEI or teiCorpus elements, which means that oXygen is not properly recognizing that module file as being included in the master.

https://www.dropbox.com/s/aey3ldjk1lz680f/master-support-for-tei.zip?dl=0

Could you please take a look and let me know what's going on here. Is this a bug?

All best,
Toma
Radu
Posts: 5563

Re: Master file support for TEI documents

Tue Jul 10, 2018 9:44 am

Hi Toma,

From what it seems somehow Oxygen expects all xi:include references to be encoded as ASCII strings, for example if you replace:

Code: Select all

<xi:include href="одредница.xml"></xi:include>


with:

Code: Select all

<xi:include href="%D0%BE%D0%B4%D1%80%D0%B5%D0%B4%D0%BD%D0%B8%D1%86%D0%B0.xml"></xi:include>


Oxygen will start to "see" the relationship between the opened module and its master file.
What Oxygen does right now is not necessarily correct, I'll add an internal issue to look into this.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ttasovac
Posts: 44

Re: Master file support for TEI documents

Tue Jul 10, 2018 9:57 am

Тhanks, Radu.

I'd be most grateful if you could look into fixing this. Urlencoding filenames is really not a practical solution — because they are not human legible, and they would ruin the workflow I'm trying to set up now for our dictionary encoders. We need filenames to correspond to entry headwords and that means we need to be able utf8 strings in filenames.

Many thanks in advance.

All best,
Toma
Radu
Posts: 5563

Re: Master file support for TEI documents

Tue Jul 10, 2018 10:15 am

Hi Toma,

I understand, we'll try to have a fix for this in Oxygen 21 (around February 2019).
In the meantime you can define a validation scenario which validates the master file and associate it to the entire folder containing modules.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “Common Problems”

Who is online

Users browsing this forum: No registered users and 1 guest