Problems with specialization DTD

Here should go questions about transforming XML with XSLT and FOP.
d_croft
Posts: 20
Joined: Fri Feb 20, 2015 10:25 am

Problems with specialization DTD

Post by d_croft »

Hi there,

I'm having some problems with a custom DTD I'm developing. Specifically, the following errors are bugging me:

Code: Select all

System ID: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Main validation file: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Engine name: Xerces
Severity: error
Description: The entity "titlealts" was referenced, but not declared.
Start location: 107:1
Length: 38

System ID: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Main validation file: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Engine name: Xerces
Severity: error
Description: The entity "abstract" was referenced, but not declared.
Start location: 108:1
Length: 37

System ID: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Main validation file: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Engine name: Xerces
Severity: error
Description: The entity "shortdesc" was referenced, but not declared.
Start location: 109:1
Length: 38

System ID: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Main validation file: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Engine name: Xerces
Severity: error
Description: The entity "prolog" was referenced, but not declared.
Start location: 110:1
Length: 35

System ID: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Main validation file: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Engine name: Xerces
Severity: error
Description: The entity "related-links" was referenced, but not declared.
Start location: 112:1
Length: 42

System ID: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Main validation file: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Engine name: Xerces
Severity: error
Description: The entity "conref-atts" was referenced, but not declared.
Start location: 119:1
Length: 28

System ID: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Main validation file: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Engine name: Xerces
Severity: error
Description: The entity "select-atts" was referenced, but not declared.
Start location: 120:1
Length: 28

System ID: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Main validation file: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Engine name: Xerces
Severity: error
Description: The entity "localization-atts" was referenced, but not declared.
Start location: 121:1
Length: 34

System ID: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Main validation file: /Applications/oxygen/frameworks/dita/DITA-OT2.x/plugins/org.mycashflow.xhtml.docs/dtd/faq-question.mod
Engine name: Xerces
Severity: fatal
Description: A '(' character or an element type is required in the declaration of element type "faq-question".
Start location: 128:1
Length: 46
These errors are produced by the following element declarations/references in the .mod file mentioned above:

Code: Select all

<!ENTITY % faq-question.content
"((%faq-question-statement;),
(%titlealts;)?,
(%abstract; |
%shortdesc;)?,
(%prolog;)?,
(%faq-answer;)?,
(%related-links;)?,
(%faq-question-info-types;)* )"
>
<!ENTITY % faq-question.attributes
"id
ID
#REQUIRED
%conref-atts;
%select-atts;
%localization-atts;
outputclass
CDATA
#IMPLIED"
>

<!ELEMENT faq-question %faq-question.content;>
<!ATTLIST faq-question
%faq-question.attributes;
%arch-atts;
domains
CDATA
"&included-domains;">
This is a specialization of the DITA concept module. The `The entity ELEMENT was referenced, but not declared.` errors seem to only concern elements that are declared in the concept module and not in my specialization.

However, the concept .dtd and .mod files are included in my specialization's .dtd file, and the code I pasted above is the only part, where these references cause a problem. For instance, later on in the same .mod file there are these references that don't cause the same problem:

Code: Select all

<!ENTITY % faq-answer.content
"((%body.cnt;)*,
(%section; |
%example; |
%conbodydiv;)* )"
>
<!ENTITY % faq-answer.attributes
"%id-atts;
%localization-atts;
base
CDATA
#IMPLIED
%base-attribute-extensions;
outputclass
CDATA
#IMPLIED"
>

<!ELEMENT faq-answer %faq-answer.content;>
<!ATTLIST faq-answer %faq-answer.attributes;>
Also, the last error is one I have no idea about: "A '(' character or an element type is required in the declaration of element type "faq-question"."

These errors were not present all the time during the development of this specialization. I managed to transform a test file that was written according to this DTD without any errors. It just seemed to come out of nowhere, as I was editing the XSLT files for my plugin. The XSLT shouldn't have anything to do with this, right?

I'm using Oxygen XML 17.1 and the DITA OT 2.x for transformation. The same errors occurred when using the earlier version of DITA OT.

Does anyone have an idea, what's going on here, because I can't wrap my head around this?
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: Problems with specialization DTD

Post by Radu »

Hi,

DTD validation errors are hard to debug because due to the nature of DTDs they are not precisely reported at the precise line and column where they occur.
At the same time you should expect that a DTD module may have problems. What's important is that the top level DTD which assembles all modules is valid.
It's hard to help just by looking at a few snippets of code.
If you want you can share with us the entire DTD specialization plugin (support@oxygenxml.com) and we could try to find some time to look into this.
For such problems which are not directly related to Oxygen you can also try to register on the Yahoo Groups DITA Users List and ask there, the list has lots of DITA experts registered on it so they may have better advice than I do.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
d_croft
Posts: 20
Joined: Fri Feb 20, 2015 10:25 am

Re: Problems with specialization DTD

Post by d_croft »

Thanks a lot, I emailed you the plugin. I would really appreciate it if you could find the time to look at it. I don't think this is a very complicated issue – I'm just not very proficient with plugin development yet :)

Might post this on the DITA Yahoo Group as well.
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: Problems with specialization DTD

Post by Radu »

Hi,

Just to update this thread, the specialization was OK but the sample topic pointed with its public ID to the specialization ".mod" file instead of pointing to the main ".dtd" shell.

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