Framework conflict

Here should go questions about transforming XML with XSLT and FOP.
mboudreau
Posts: 58
Joined: Sat Jan 07, 2017 1:23 am

Framework conflict

Post by mboudreau » Mon Oct 28, 2019 10:26 pm

I appear to have a conflict between two frameworks I set up, and I don't know how to troubleshoot this.

I have a framework I've been using without problems for over a year, which is configured as follows:
Framework: "Journal Publishing 3.0"
Association rules
- Public ID: -//NLM//DTD Journal Publishing DTD v3.0 20080202//EN

Schema
- Schema URI: ${framework}/dtd/ucp_journalpublishing-3.0/journalpublishing3.dtd

Catalogs
- Catalog URL: ${framework}/dtd/ucp_journalpublishing-3.0/catalog.ucpj.xml
I recently needed to write an XSL transformation for a set of documents using a different DTD, so I created a new framework for them, configured as follows:
Framework: "Archive Article 3.0.5"
Association rules
- Public ID: -//Atypon//DTD Atypon Systems Journal Archiving and Interchange NLM DTD v3.0.5 20110520//EN

Schema
- Schema URI: ${framework}/dtd/atypon_archive-interchange-dtd-3.0.5/atypon-archivearticle3.dtd

Catalogs
- Catalog URL: ${framework}/dtd/atypon_archive-interchange-dtd-3.0.5/catalog-v3.ucpj.xml
After setting up and using the new framework successfully, I opened a file that should have been handled by the old ("Journal Publishing") framework, and got this error message:
Cannot parse document: /Applications/Oxygen 21.1/frameworks/atypon-archive-article-305/dtd/atypon_arhive-interchange-dtd-3.0.5/journalpublishing3.dtd (No such file or directory)
Oxygen appears to be looking for the main DTD file of old framework in the wrong location.

If I disable the new framework, Oxygen opens the file using the old framework, no problem.

Radu
Posts: 7534
Joined: Fri Jul 09, 2004 5:18 pm

Re: Framework conflict

Post by Radu » Tue Oct 29, 2019 11:15 am

Hi,

Most of the frameworks in the Oxygen Preferences->"Document Type Association" page contribute XML catalogs used by Oxygen when validating XML instances. But the contributed XML catalogs are all contributed to a common pool of catalogs, so even if you open an XML instance of the older framework, Oxygen will try to map DTD public and system IDs in the list of XML catalogs, gathered in the order in which the document types are defined. So Oxygen might map the DTD public or system ID for an XML document opened for the older framework through the XML catalog of the newer framework. In such cases indeed selectively disabling document types is the solution.

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

mboudreau
Posts: 58
Joined: Sat Jan 07, 2017 1:23 am

Re: Framework conflict

Post by mboudreau » Mon Nov 04, 2019 5:18 am

Is there any way to avoid this? If I needed to convert an instance of one DTD into an instance of the other DTD, and I couldn't have both frameworks active at the same time, I'd be stuck.

Radu
Posts: 7534
Joined: Fri Jul 09, 2004 5:18 pm

Re: Framework conflict

Post by Radu » Mon Nov 04, 2019 9:44 am

Hi,

Maybe you can share the framework you created with us (support@oxygenxml.com) and I could try to have a look at it.
Your framework somehow has an XML catalog mapping (using probably the "systemSuffix") which seems to direct also references for the older framework's DTDs to the folder where the custom framework is located.

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

mboudreau
Posts: 58
Joined: Sat Jan 07, 2017 1:23 am

Re: Framework conflict

Post by mboudreau » Tue Mar 02, 2021 7:47 pm

Hello again!

I neglected to pursue this issue before the pandemic, but it's come up again, this time in a more annoying way. I have two new frameworks that are apparently in conflict, for document types that I need to convert from one to the other, so temporarily disabling one or the other of the frameworks isn't an option.

One of the frameworks ("UCP JATS 1.2") handles instances of the NLM JATS Journal Publishing ("Blue") 1.2 DTD, to which we have made a handful of customizations. The other framework ("Atypon JATS 1.2") handles instances of the NLM JATS Archiving ("Green") 1.2 DTD, which I believe is unmodified. As you may already know if you're familiar with the JATS DTDs, the "blue" and "green" versions have some files that are unique to each, but they also both draw from a common set of modules. The catalog files for each DTD use the same public identifiers and system filenames for the common files.

Would one possible solution to this be to change all the public IDs and system filenames of one of the two DTDs, so that there was no match between them? E.g., change

Code: Select all

<public publicId="-//NLM//DTD JATS (Z39.96) Journal Publishing DTD Customize Mixes Module v1.2 20190208//EN" uri="JATS-journalpubcustom-mixes1.ent"/>
to

Code: Select all

<public publicId="-//NLM//DTD MODIFIED JATS (Z39.96) Journal Publishing DTD Customize Mixes Module v1.2 20190208//EN" uri="modified-JATS-journalpubcustom-mixes1.ent"/>
Or would changing just one or the other--either the public identifier or the filename--suffice? Or is there a better solution?

I'm also happy to send you the frameworks (one or the other or both?) if that would be clearer.

Radu
Posts: 7534
Joined: Fri Jul 09, 2004 5:18 pm

Re: Framework conflict

Post by Radu » Wed Mar 03, 2021 3:14 pm

Hi,

We do not use JATS much but I think I understand. You can probably change the public IDs just in one of those frameworks.

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

mboudreau
Posts: 58
Joined: Sat Jan 07, 2017 1:23 am

Re: Framework conflict

Post by mboudreau » Wed Mar 03, 2021 11:42 pm

You can probably change the public IDs just in one of those frameworks.
I tried this, but the conflict persists. I then tried changing the names of all the DTD component files (adding an extra filename extension), and still no luck.

mboudreau
Posts: 58
Joined: Sat Jan 07, 2017 1:23 am

Re: Framework conflict

Post by mboudreau » Thu Mar 04, 2021 5:40 am

Another thought has occurred to me. Am I right in assuming that if one of the two frameworks used a DTD that was contained in a single file, no catalog file would be necessary and there would be no conflict?

Radu
Posts: 7534
Joined: Fri Jul 09, 2004 5:18 pm

Re: Framework conflict

Post by Radu » Thu Mar 04, 2021 10:06 am

Hi,

I am not sure what you mean by "used a DTD". Usually the XML document has a DOCTYPE declaration with public and system IDs which are mapped through all the XML catalogs provided by the frameworks in the order in which they appear in the "Document Type Associations" preferences page. If DTDs have in turn references to submodules using public and system IDs, the same procedure is done for those references. The first XML catalog which can map the public ID to a DTD location wins.
In the Oxygen Preferences->"XML / XML Catalog" you can also switch the verbosity to "All messages", maybe you can use those logging messages reported by Oxygen during validation to get a better idea about how the public IDs are mapped.

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

mboudreau
Posts: 58
Joined: Sat Jan 07, 2017 1:23 am

Re: Framework conflict

Post by mboudreau » Fri Mar 05, 2021 12:17 am

Hi Radu,

I think I've finally got it.

For the framework (UCP JATS 1.2) associated with the DTD that we customized (JATS Journal Publishing 1.2, "blue"), I changed all the public identifiers in the catalog file and in the DTD component files to include the string "UCP", and I changed all the corresponding filenames to include 'ucp' before the filename extension (e.g., mathml3.dtd => mathml3.ucp.dtd).

Before that, I had changed only the public identifiers (on the assumption that the public IDs are the unique keys in the mapping table that Oxygen builds--is that correct?), and the problem persisted. However, it's possible I missed something the first time and was simply more thorough when I changed the filenames as well.

So now I have both frameworks active and instances of both document types open at the same time with the expected display in Author View and no errors.

In my previous comment, by "used a DTD" I was referring to the association between a framework and the schema (in our case, a DTD) the framework is configured to use. My "UCP JATS 1.2" framework is configured to validate files against our customized version of JATS Journal Publishing 1.2, and my "Atypon JATS 1.2" framework is configured to validate files against the JATS Archiving 1.2 DTD (I retrieved my copy from our platform vendor Atypon, though I don't think they modified this one as they have done in the past). All versions of the JATS DTDs are distributed as a set of files. But I wondered if merging all the component files for one DTD version into a single file would have simplified the problem by eliminating the need for all but one of the public identifiers (the one corresponding to the main DTD file). Does Oxygen have a tool for saving a modular DTD as a single file?

--Michael Boudreau

Radu
Posts: 7534
Joined: Fri Jul 09, 2004 5:18 pm

Re: Framework conflict

Post by Radu » Fri Mar 05, 2021 9:03 am

Hi Michael,

I'm glad this works for you now. Unfortunately we do not have a tool to merge DTDs which are split in multiple files to a single DTD, it would probably not be very difficult to implement but we have not had many requests for it.

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

Post Reply