TEI/Ant question

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

TEI/Ant question

Hayim Lapin
Dear all,
This is really an Ant/Oxygen question rather than TEI, but it affects a customization of TEI consortium generated transformation scenarios. If someone can help please feel free to contact me off list.

I have generated a customized build file based on the ones that TEI generated that does a two-step xslt transformation of (1) docx files to vanilla TEI and (2) from vanilla TEI to semantic/schema specific TEI.
The step I'd like to introduce is do apply that conversion to all the files in a directory.

I understand that this is possible but I am having trouble sorting out the details.

Many thanks in advance,
HL
--
Reply | Threaded
Open this post in threaded view
|

Re: TEI/Ant question

Peter Stadler
Hi Hayim,

afaik the ANT tasks that transform TEI documents always expect a single file. That said, you could
a) create a wrapper around these tasks (e.g. `for i in *.xml ; do ant $i ; done` in bash or create a transformation scenario in oXygen and apply this to your project files) OR
b) modify the underlying ANT XSLT task [1] (within `common/teianttasks.xml`) not to use the @in attribute (which allows only a single file) but nested resource collections .

Hope that helps
Peter

[1] https://ant.apache.org/manual/Tasks/style.html

> Am 11.09.2017 um 16:32 schrieb Hayim Lapin <[hidden email]>:
>
> Dear all,
> This is really an Ant/Oxygen question rather than TEI, but it affects a customization of TEI consortium generated transformation scenarios. If someone can help please feel free to contact me off list.
>
> I have generated a customized build file based on the ones that TEI generated that does a two-step xslt transformation of (1) docx files to vanilla TEI and (2) from vanilla TEI to semantic/schema specific TEI.
> The step I'd like to introduce is do apply that conversion to all the files in a directory.
>
> I understand that this is possible but I am having trouble sorting out the details.
>
> Many thanks in advance,
> HL
> --
Reply | Threaded
Open this post in threaded view
|

Re: TEI/Ant question

Radu Coravu
Hi Hayim,

As you mentioned you are using Oxygen, another workaround to making the
ANT script work in batch mode (which would probably be the more
appropriate solution) would be to go to the Oxygen Project view, add in
it the folder which contains the DOCX files, then right click that
folder and use the "Transform" submenu to apply a transformation
scenario. The scenario will be applied sequentially for each of the DOCX
files.
In order for this to work the ANT transformation scenario can define a
custom parameter which takes the value "${cf}" (an editor variable that
Oxygen will expand to the current file) and the build.xml can read that
parameter and use its value as the path to the DOCX which needs to be
converted.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 9/11/2017 5:57 PM, Peter Stadler wrote:

> Hi Hayim,
>
> afaik the ANT tasks that transform TEI documents always expect a single file. That said, you could
> a) create a wrapper around these tasks (e.g. `for i in *.xml ; do ant $i ; done` in bash or create a transformation scenario in oXygen and apply this to your project files) OR
> b) modify the underlying ANT XSLT task [1] (within `common/teianttasks.xml`) not to use the @in attribute (which allows only a single file) but nested resource collections .
>
> Hope that helps
> Peter
>
> [1] https://ant.apache.org/manual/Tasks/style.html
>
>> Am 11.09.2017 um 16:32 schrieb Hayim Lapin <[hidden email]>:
>>
>> Dear all,
>> This is really an Ant/Oxygen question rather than TEI, but it affects a customization of TEI consortium generated transformation scenarios. If someone can help please feel free to contact me off list.
>>
>> I have generated a customized build file based on the ones that TEI generated that does a two-step xslt transformation of (1) docx files to vanilla TEI and (2) from vanilla TEI to semantic/schema specific TEI.
>> The step I'd like to introduce is do apply that conversion to all the files in a directory.
>>
>> I understand that this is possible but I am having trouble sorting out the details.
>>
>> Many thanks in advance,
>> HL
>> --
>
Reply | Threaded
Open this post in threaded view
|

Re: TEI/Ant question

Hayim Lapin
Thanks Radu! I did some research last night and discovered this capability in Oxygen (although have not had a chance to test it yet. Still resolving errors in the original files). Was planning to test and report to the list in case anyone had the same issue.

On 9/12/2017 1:01 AM, Radu Coravu wrote:
Hi Hayim,

As you mentioned you are using Oxygen, another workaround to making the ANT script work in batch mode (which would probably be the more appropriate solution) would be to go to the Oxygen Project view, add in it the folder which contains the DOCX files, then right click that folder and use the "Transform" submenu to apply a transformation scenario. The scenario will be applied sequentially for each of the DOCX files.
In order for this to work the ANT transformation scenario can define a custom parameter which takes the value "${cf}" (an editor variable that Oxygen will expand to the current file) and the build.xml can read that parameter and use its value as the path to the DOCX which needs to be converted.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 9/11/2017 5:57 PM, Peter Stadler wrote:
Hi Hayim,

afaik the ANT tasks that transform TEI documents always expect a single file. That said, you could
a) create a wrapper around these tasks (e.g. `for i in *.xml ; do ant $i ; done` in bash or create a transformation scenario in oXygen and apply this to your project files) OR
b) modify the underlying ANT XSLT task [1] (within `common/teianttasks.xml`) not to use the @in attribute (which allows only a single file) but nested resource collections .

Hope that helps
Peter

[1] https://ant.apache.org/manual/Tasks/style.html

Am 11.09.2017 um 16:32 schrieb Hayim Lapin [hidden email]:

Dear all,
This is really an Ant/Oxygen question rather than TEI, but it affects a customization of TEI consortium generated transformation scenarios. If someone can help please feel free to contact me off list.

I have generated a customized build file based on the ones that TEI generated that does a two-step xslt transformation of (1) docx files to vanilla TEI and (2) from vanilla TEI to semantic/schema specific TEI.
The step I'd like to introduce is do apply that conversion to all the files in a directory.

I understand that this is possible but I am having trouble sorting out the details.

Many thanks in advance,
HL
--


--

Hayim Lapin
Robert H. Smith Professor of Jewish Studies and
Professor of History
Department of History
University of Maryland
2115 Francis Scott Key Hall
College Park, MD 20742
301 405 4296 | [hidden email]
www.digitalmishnah.org | www.eRabbinica.org

Director
Joseph and Rebecca Meyehoff
Program and Center for Jewish Studies
University of Maryland
4141 Susquehanna Hall
College Park, MD 20742
301 405 4975 | [hidden email]
www.jewishstudies.umd.edu


Reply | Threaded
Open this post in threaded view
|

Re: TEI/Ant question

Elisa Beshero-Bondar
Hayim-- I've run oXygen Project transformations in oXygen, just working with XSLT over a collection of files--It does seem optimized for this use, but working out the custom editor variables oXygen needs for the project transformation is definitely the trickiest part. Once you get it working for your ant task, it would likely be VERY helpful to report back on list to others! 

Here's a set of instructions I helped to draft for undergrad students (again just working with XSLT over a collection of files) that might be a good jumping-off point: Scroll down to the heading "Batch processing multiple XML files with XSLT":  http://dh.obdurodon.org/transformation-scenario.xhtml

I'm looking forward to hearing more about configuring the ant transformation!
Cheers,
Elisa

On Tue, Sep 12, 2017 at 10:48 AM, Hayim Lapin <[hidden email]> wrote:
Thanks Radu! I did some research last night and discovered this capability in Oxygen (although have not had a chance to test it yet. Still resolving errors in the original files). Was planning to test and report to the list in case anyone had the same issue.


On 9/12/2017 1:01 AM, Radu Coravu wrote:
Hi Hayim,

As you mentioned you are using Oxygen, another workaround to making the ANT script work in batch mode (which would probably be the more appropriate solution) would be to go to the Oxygen Project view, add in it the folder which contains the DOCX files, then right click that folder and use the "Transform" submenu to apply a transformation scenario. The scenario will be applied sequentially for each of the DOCX files.
In order for this to work the ANT transformation scenario can define a custom parameter which takes the value "${cf}" (an editor variable that Oxygen will expand to the current file) and the build.xml can read that parameter and use its value as the path to the DOCX which needs to be converted.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 9/11/2017 5:57 PM, Peter Stadler wrote:
Hi Hayim,

afaik the ANT tasks that transform TEI documents always expect a single file. That said, you could
a) create a wrapper around these tasks (e.g. `for i in *.xml ; do ant $i ; done` in bash or create a transformation scenario in oXygen and apply this to your project files) OR
b) modify the underlying ANT XSLT task [1] (within `common/teianttasks.xml`) not to use the @in attribute (which allows only a single file) but nested resource collections .

Hope that helps
Peter

[1] https://ant.apache.org/manual/Tasks/style.html

Am 11.09.2017 um 16:32 schrieb Hayim Lapin [hidden email]:

Dear all,
This is really an Ant/Oxygen question rather than TEI, but it affects a customization of TEI consortium generated transformation scenarios. If someone can help please feel free to contact me off list.

I have generated a customized build file based on the ones that TEI generated that does a two-step xslt transformation of (1) docx files to vanilla TEI and (2) from vanilla TEI to semantic/schema specific TEI.
The step I'd like to introduce is do apply that conversion to all the files in a directory.

I understand that this is possible but I am having trouble sorting out the details.

Many thanks in advance,
HL
--


--

Hayim Lapin
Robert H. Smith Professor of Jewish Studies and
Professor of History
Department of History
University of Maryland
2115 Francis Scott Key Hall
College Park, MD 20742
<a href="tel:(301)%20405-4296" value="+13014054296" target="_blank">301 405 4296 | [hidden email]
www.digitalmishnah.org | www.eRabbinica.org

Director
Joseph and Rebecca Meyehoff
Program and Center for Jewish Studies
University of Maryland
4141 Susquehanna Hall
College Park, MD 20742
<a href="tel:(301)%20405-4975" value="+13014054975" target="_blank">301 405 4975 | [hidden email]
www.jewishstudies.umd.edu





--
Elisa Beshero-Bondar, PhD
Director, Center for the Digital Text | Associate Professor of English
University of Pittsburgh at Greensburg | Humanities Division
150 Finoli Drive
Greensburg, PA  15601  USA
E-mail:[hidden email]
Development site: http://newtfire.org