Results 1 to 2 of 2

Thread: Issue with inclusion/exclusion lists

  1. #1

    Default Issue with inclusion/exclusion lists

    So I'm having an issue with an inclusion list. The list does not seem to flow down to descendants of the element it is declared in.

    Here is my example.

    The dtd :
    Code:
    <!ELEMENT doc - o (element) +(inc1) >
    <!ELEMENT element - o (sub-element) >
    <!ELEMENT sub-element  - o (sub-sub-element) >
    <!ELEMENT sub-sub-element  - o EMPTY >
    <!ELEMENT inc1  - o EMPTY >
    The sgml before saving :
    Code:
    <!DOCTYPE doc SYSTEM "C:\sgml\sgmldtd.dtd" []>
    <doc>
       <element>
         <sub-element>
           <inc1>
           <sub-sub-element>
         </sub-element>
      </element>
    </doc>
    The xml after loading into an XmlDocument and saving :
    Code:
    <doc>
      <element>
        <sub-element>
        </sub-element>
      </element>
      <inc1 />
      <sub-sub-element />
    </doc>
    Because <inc1> is not included as per the <doc> inclusion list, it is not recognized and so it auto-closes all the elements and is no longer valid. Is this the expected behavior?

    EDIT : I used a 1 instead of an L for <inc1>, which is confusing I know, but I was consistent.
    Last edited by parks; 02-13-2012 at 10:09 PM.

  2. #2
    Join Date
    Jul 2006
    Location
    San Diego, CA
    Posts
    5,450

    Default

    SgmlReader's support for DTD is very limited. The original author just made it understand enough to be able to read the HTML DTD. So your mileage will vary based on how sophisticated your DTD is.
    Steve G. Bjorg - Chief Architect
    Did you check the MindTouch FAQ?
    Found a bug? Report it.
    Follow me on Twitter
    Find us on IRC: irc.freenode.net #mindtouch

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts