TEI.2 to TEI P5 conversion

Questions about XML that are not covered by the other forums should go here.
vandana
Posts: 3
Joined: Tue Oct 04, 2022 12:01 pm

TEI.2 to TEI P5 conversion

Post by vandana »

I am new to Oxygen editor.
Do Oxygen Editor automatically or by using some stylesheet convert from TEI.2 to TEI P5. I have 338 files in TEI.2 which needs to be converted into TEI P5 format. Can anyone let me know any process by which it can be done fast, please?
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: TEI.2 to TEI P5 conversion

Post by Radu »

Hi,
There is a migration procedure here:
https://tei-c.org/Vault/P4/migrate.html
There is also an XSLT stylesheet which can be applied on a TEI P4 document to convert it to P5, I just added an XML refactoring operation which does this here:
https://github.com/oxygenxml/dita-refac ... 20TEI%20P5

So for example if you download this entire project:
https://github.com/oxygenxml/dita-refac ... master.zip

unzip it, then in the Oxygen "Preferences"->"XML / XML Refactoring" page you add a reference to the folder "42 TEI P4 to TEI P5" then save the preferences, afterwards in the Oxygen main menu "Tools->XML Refactoring" dialog you will find an action named "Convert TEI P4 to P5" which can pe applied on multiple resources, you also have a Preview to double check.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
vandana
Posts: 3
Joined: Tue Oct 04, 2022 12:01 pm

Re: TEI.2 to TEI P5 conversion

Post by vandana »

Thanks it does most of the things. Only one small doubt, I have word like this

Code: Select all

<w rend="assidue" xml:id="C010037129">assidue</w>
and I want to remove

Code: Select all

rend
element and want the tags to look like this

Code: Select all

<w xml:id="C010037129">assidue</w>
can it be done automatically similar to as you suggested earlier
adrian_sorop
Posts: 73
Joined: Wed Jun 22, 2016 2:48 pm

Re: TEI.2 to TEI P5 conversion

Post by adrian_sorop »

Hi,
In order to remove an attribute (or more) from an element you can use XML Refactoring's Delete attribute operation.
The documentation of the operation is here: https://www.oxygenxml.com/doc/versions/ ... zz_bgk_54b
In your case, the values of the Delete attribute operation can be

Code: Select all

Element: //w
Attribute: rend
Regards,
Adrian S.
Adrian Sorop
<oXygen/> XML Editor
http://www.oxygenxml.com
vandana
Posts: 3
Joined: Tue Oct 04, 2022 12:01 pm

Re: TEI.2 to TEI P5 conversion

Post by vandana »

Thanks a lot. It worked out.
Post Reply