queshaw / dita-ng

Automatically exported from code.google.com/p/dita-ng
Apache License 2.0
1 stars 1 forks source link

Element Type and Attribute list Declarations not being generated #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The code as of rev 78 is generating only parameter entity declarations. It 
needs to also generate element and attribute list declarations for each element 
type. 

For example, given this RNG:

  <define name="mathmlref.content">
    <empty/>
  </define>

  <define name="mathmlref.attributes">
    <ref name="xref.attributes"/>
  </define>

  <define name="mathmlref.element">
    <element name="mathmlref">

      <ref name="mathmlref.attributes"/>
      <ref name="mathmlref.content"/>
    </element>
  </define>

The DTD result should be one parameter entity for mathmlref.content, one for 
mathmlref.attributes, but then an ELEMENT and ATTLIST declaration pair that 
references those entities, e.g.:

<!ENTITY % mathmlref.content 
"..."
>
<!ENTITY % mathmlref.attributes
 "..."
>

<!ELEMENT mathmlref
  %mathmlref.content;
>
<!ATTLIST mathmlref
  %mathmlref.attributes;
>

There is never a parameter entity for the element type itself.

The naming convention on the <define> elements is consistent, so that any 
define with the name "*.element" should never result in a parameter entity. 
Rather, it should result in the ELEMENT/ATTLIST declaration pair as shown. The 
ELEMENT and ATTLIST declarations should only ever have the single parameter 
entity references, so the only information that is needed is the element type 
name: the names of the parameter entities will always follow the patter 
"{typename}.content" and "{type name}.attributes", so there is no need to 
process of the contents of any <define> with a name matching "*.content" unless 
it is to get the element type name from the contained <element> element.

Original issue reported on code.google.com by drmacro@gmail.com on 18 May 2013 at 8:33

GoogleCodeExporter commented 9 years ago
I can not reproduce the problem!
Using r86, I generate element and attlist declarations...
For example, in technicalContent/dtd/task.mod:

<!--  LONG NAME: Prerequisites  -->
<!ENTITY % prereq.content 
"(%section.notitle.cnt; )*" 
>

<!ENTITY % prereq.attributes 
"%univ-atts; 
outputclass
                       CDATA
                             #IMPLIED
" 
>

<!-- 
    doc:The pre-requisite (prereq) section of a task should document things the user needs to know or do before starting the current task. Prerequisite links will be placed in a list after the related-links section; on output the prereq links from the related-links section are added to the prereq section.
    Category: Task elements
   -->
<!ELEMENT  prereq    %prereq.content; >
<!ATTLIST  prereq    %prereq.attributes; >

Could you please re-test your samples with the latest version of the converter ?

Original comment by p.leblan...@gmail.com on 24 May 2013 at 7:17

GoogleCodeExporter commented 9 years ago

Original comment by p.leblan...@gmail.com on 24 May 2013 at 7:19

GoogleCodeExporter commented 9 years ago
Yes, this is looking much better.

I'm not seeing newlines in the output even though there are literal newlines in 
the XSLT (e.g,. "|&#0a;"). Not sure what is going on there--must be something 
about the text serialization mode.

Cheers,

E.

Original comment by drmacro@gmail.com on 25 May 2013 at 12:11