[MEI-L] Converting specs to schema

Andrew Hankinson, Mr andrew.hankinson at mail.mcgill.ca
Sat Dec 3 23:24:53 CET 2011


Hi Thomas,

I usually follow these instructions:

http://www.wwp.brown.edu/outreach/seminars/_current/handouts/roma_CLI_MacOS_X.html

They say they're for OS X, but I don't see any real reason why they can't be used for Ubuntu too.

There are a couple caveats, though:

-- The Makefile for tei-roma is a bit weird for use on OSX, so it may also be for Ubuntu too if you want to store everything in /usr/local. I filed a bug about it*, but it still does weird things. If you want to keep the Roma configuration stuff in /usr/local/etc (instead of /etc) you will have to edit it. I can send more details about this if you like.

-- You may also have to reverse the order for the "Roma itself" and "Build TEI P5" steps. If you don't do the Build TEI P5 step first, the p5subset.xml file will not exist in your odd/ directory, and the roma build script will fail when it tests for it. If you do the `make oddschema` step first, though, it should produce one. Be careful, though -- if the process fails it will likely produce a file, but it will be empty. On my machine, a compiled p5subset.xml file is about 3.3MB.

I usually then alias the roma command in the shell like this (put this in .bashrc or .zshrc):


export MEI_LOCATION="/path/to/svn/mei/trunk/source/driver.xml"
export TEI_STYLESHEETS="/usr/local/share/xml/tei/stylesheet"

alias mei="/usr/local/bin/roma --localsource=$MEI_LOCATION --xsl=$TEI_STYLESHEETS --nodtd --noxsd $*"


Then I can just pass the customization in on the command line, e.g.,:

$> mei mei-all.xml

and it will create a "RomaResults" directory in the current working directory with the RNG file. (You should also be able to pass in an output directory if you don't want to put it in the CWD, e.g., mei mei-all.xml [outputdir])

Hope this helps!
-Andrew

* http://sourceforge.net/tracker/index.php?func=detail&aid=3304677&group_id=106328&atid=644062

On 2011-12-03, at 6:20 AM, TW wrote:

> Hi Raffaele,
> 
> 2011/12/2 Raffaele Viglianti <raffaeleviglianti at gmail.com>:
>> If I understand your problem correctly, you should create an ODD
>> customization. Look at /MEI_dev/customizations/mei-all.xml as an example.
>> That file selects all the modules. You can make a copy and comment out the
>> modules that you want to exclude.
>> 
>> At this point you have a few options to generate an RNG and XSD from the
>> source + customization. This is what I usually do on a Unix system:
>> 
>> 1. checkout TEI's trunk from sourceforge if you don't have it already
>> 2. make sure you have all the dependecies (trang, saxon, xmllint)
>> 3. go to /Roma
>> 4. run the command:
>> 
>> ./roma2 --xsl=../Stylesheets --localsource=fullPathTo_mei-2011-05-source.xml
>> fullPathToYourCustomization
>> 
>> 5. Under RomaResults you'll find the resulting RNG and XSD.
>> 
> 
> I need some more assistance.
> 
> Problem 1:  /trunk/Roma/roma2.sh relies on command "saxon".  On my
> Ubuntu Natty system I have the packages libsaxon-java, libsaxonb-java
> and libsaxon-java-gcj installed, but they don't come with this
> command.  So I changed "saxon" to "saxonb-xslt".  But then I get
> 
> Error at xsl:result-document on line 1851 of
> file:/home/tom/tei/trunk/Stylesheets/odds2/teiodds.xsl:
>  xsl:result-document is disabled when extension functions are disabled
> 
> So I inserted -ext:on, which *seemed* to get me somewhere (after I
> created some directory that Roma wanted to put the results).
> 
> Problem 2:  I did the following, using the unmodified mei-all.xml for testing:
> 
> 
> tom at desktop:~$ tei/trunk/Roma/roma2.sh --xsl=tei/trunk/Stylesheets
> --localsource=music-encoding/trunk/source/specs/mei-2011-05-source.xml
> music-encoding/trunk/customizations/mei-all.xml
> ========= Roma starts at 2011-12-03 12:05:09 ===========
> TEI stylesheet tree: tei/trunk/Stylesheets
> Results to: RomaResults
> Process music-encoding/trunk/customizations/mei-all.xml to create
> mei{.dtd|.xsd|.doc.xml|.rng|.rnc} in RomaResults
> ========= Roma version VVVERSION starts execution at 2011-12-03
> 12:05:10.208637972 ===========
> using /home/tom/music-encoding/trunk/source/specs/mei-2011-05-source.xml
> as default source
> 1. expand and simplify ODD
> 2. make RELAX NG from compiled ODD
> 3. make RELAX NG compact from XML
> 4. make XSD from RELAX NG
> /home/tom/RomaResults/mei.rng:11:13: error: restriction violation:
> "start" contains "empty"
> 
> 
> ERROR:  trang fails.
> This was a fatal error. 2011-12-03 12:05:14
> 5. make DTD from compiled ODD
> ========= 2011-12-03 12:05:16.785145931 Roma ends
> 
> 
> The generated RNG looks like:
> 
> 
> <?xml version="1.0" encoding="utf-8"?>
> <grammar xmlns="http://relaxng.org/ns/structure/1.0"
> xmlns:xlink="http://www.w3.org/1999/xlink"
> datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
> ns="http://www.music-encoding.org/ns/mei">
>  <!--
> Schema generated from ODD source 2011-12-03T12:05:14Z.
> Edition:
> Edition Location: http://www.tei-c.org/Vault/P5//
> 
> -->
>  <!---->
>  <start>
>    <empty/>
>  </start>
> </grammar>
> 
> 
> Something tells me this is flawed.
> 
> I saw there are Debian packages available[1] and added them to my
> software sources.  I installed the packages tei-roma, saxon and
> tei-p5-xsl2.  The result was pretty much the same:
> 
> 
> tom at desktop:~/music-encoding/trunk/customizations$ roma mei-all.xml mei-all
> ========= Roma starts at 2011-12-03 12:13:48 ===========
> TEI stylesheet tree: /usr/share/xml/tei/stylesheet
> Results to: mei-all
> Process mei-all.xml to create mei{.dtd|.xsd|.doc.xml|.rng|.rnc} in mei-all
> ========= Roma version 4.7 starts execution at 2011-12-03
> 12:13:49.646907172 ===========
> 1. expand and simplify ODD
> 2. make RELAX NG from compiled ODD
> 3. make RELAX NG compact from XML
> 4. make XSD from RELAX NG
> /home/tom/music-encoding/trunk/customizations/mei-all/mei.rng:11:13:
> error: restriction violation: "start" contains "empty"
> 
> 
> ERROR:  trang fails.
> This was a fatal error. 2011-12-03 12:14:00
> 5. make DTD from compiled ODD
> ========= 2011-12-03 12:14:03.531732571 Roma ends
> 
> 
> What can I do?
> 
> Thanks!
> Thomas
> 
> 
> [1] http://tei.oucs.ox.ac.uk/teideb/
> 
> _______________________________________________
> mei-l mailing list
> mei-l at lists.uni-paderborn.de
> https://lists.uni-paderborn.de/mailman/listinfo/mei-l




More information about the mei-l mailing list