[xml] DTD's and xmllint



Hi,
        I'm working on creating an XML DTD, for the KDE usability project, as it 
happens, that I'd like to use validate documents using xmllint.

I'm having problems with CDATA elements.

When I run:
 xmllint --noout --valid embedded_ark_usability_test.xml

where embedded_ark_usability_test.xml looks like this:
--------------------------------------------------------------------------------------------------------------------------
<report date="2003-01-02">
  <author name="Eric Ellsworth" email="whalesuit softhome net"/>
  <application name="Konqueror" version="3.0.5-2"/>
  <os name="Linux" version="2.4.18"/>
  <interface name="KDE" version="3.0.5-1"/>
  <issue severity="medium">
    <description>Several sentences of severity text in this element.
        Sentences have whitespace of carriage returns and tabs between them
    </description>
    <reproduction>
      <step>A step goes here</step>
      <step>Another step in reproducing the problem goes here</step>
      <step>Yet another step</step>
    </reproduction>

    <solution>  The solution may also have similar whitespaces. 
                It too shows errors I don't understand.
      <rationale>
        The rationale field is CDATA inside an element.  Could this be a problem?       
      </rationale>
      </solution>
  </issue>
</report>
--------------------------------------------------------------------------------------------------------------------------
I get this kind of error many times:

embedded_ark_usability_test.xml:9: validity error: Element description content 
does not follow the DTD
Expecting (CDATA), got (CDATA)
    </description>
                       ^

embedded_ark_usability_test.xml:19: validity error: Element step content does 
not follow the DTD
Expecting (CDATA), got (CDATA)
<step>A step goes here</ste
                                         ^

I'm sure my question has a simple answer, but I can't figure out where to 
look.  Searches to this list didn't net me anything.  Any ideas or help would 
be much appreciated.

Thanks,

Eric

DTD follows.
--------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" ?>
<!ELEMENT report (author,application,os,interface,issue+)>
<!ATTLIST report date CDATA #IMPLIED>
<!ELEMENT author EMPTY>
<!ATTLIST author name CDATA #REQUIRED>
<!ATTLIST author email CDATA #REQUIRED>
<!ELEMENT application EMPTY>
<!ATTLIST application name CDATA #REQUIRED>
<!ATTLIST application version CDATA #REQUIRED>
<!ELEMENT os EMPTY>
<!ATTLIST os name CDATA #REQUIRED>
<!ATTLIST os version CDATA #IMPLIED>
<!ELEMENT interface EMPTY>
<!ATTLIST interface name CDATA #FIXED "KDE">
<!ATTLIST interface version CDATA #IMPLIED>

<!ELEMENT issue (description, reproduction?, solution+)>
<!ATTLIST issue severity (low|medium|high) "medium">
<!ATTLIST issue bug_reference_no CDATA #IMPLIED>

<!ELEMENT description (CDATA)>
<!ELEMENT reproduction (step+)>
<!ELEMENT step (CDATA)>
<!ELEMENT solution (CDATA|rationale)*>
<!ELEMENT rationale (CDATA)>
--------------------------------------------------------------------------------------------------------------------------



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]