DTD for Templates in the New Wizard

<oXygen/> general issues.
SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

DTD for Templates in the New Wizard

Post by SSC » Wed Mar 27, 2013 5:05 pm

Hello,

we´ve got a custom Document Type Association for PI-Mod and I just created some templates and defined them in our pi-mod.framework file.

PI-Mod itself has several topic types and each of them got a different DTD.
When I try to use a template the dtd, which is defined in the head of the XML template, is not found in that folder, where the user stores the new XML document.
Is it somehow possible to also deliver those DTDs, when a new XML file is created by chosing a template?

Maybe in the properties file, where the icons for the templates are defined?

Or am I forced to create several Document Type Associations, where only the schema is diffrent?

Best regards,

Simon
Simon Scholz
vogella GmbH
http://www.vogella.com

SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Re: DTD for Templates in the New Wizard

Post by SSC » Wed Mar 27, 2013 5:08 pm

Or can I define a schema folder for the document type, so that the schemas, which are defined in the XML document, can be looked up there?
Simon Scholz
vogella GmbH
http://www.vogella.com

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

Re: DTD for Templates in the New Wizard

Post by Radu » Wed Mar 27, 2013 5:18 pm

Hi Simon,

I do not know if I fully understood the problem but here we go:

If your XML templates look like this:

Code: Select all

<!DOCTYPE root SYSTEM "schema.dtd">
<root>
......
</root>
You could create an XML catalog catalog.xml file with content like:

Code: Select all

<!DOCTYPE catalog PUBLIC "-//OASIS//DTD XML Catalogs V1.1//EN" "http://www.oasis-open.org/committees/entity/release/1.1/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<systemSuffix systemIdSuffix="schema.dtd" uri="dtds/schema.dtd"/>
</catalog>
That catalog file can be saved in your framework's directory.
Then you edit the document type and add the catalog in the "Catalogs" tab.

When the XML is validated, Oxygen will pass the "schema.dtd" reference through the catalogs and resolve it to a location relative to the XML catalog you have defined (so you need a folder "dtds" in your framework containing all the DTDs).

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

SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Re: DTD for Templates in the New Wizard

Post by SSC » Thu Mar 28, 2013 11:02 am

Hello Radu,

thank you, that was exactly what I wanted. :)

Best regards,

Simon
Simon Scholz
vogella GmbH
http://www.vogella.com

Post Reply