Re: [xml] Validity Checking headache :-(



On Wednesday 16 May 2001 16:52, you wrote:

  No there is no DTD for stylesheets, or just try but don't complain...

I'll make treasure of this suggestion. :-)

  Misunderstood.
  Please reread the spec, sections 16 on output to XML/HTML/text.
xsltSaveResultToXXX() will output text too, there is test cases from day
5 for this.

Sorry sorry sorry I made a very silly question again. :-((

This time I'd like to ask you about a problem I'm having with validation:

- I have setup the parser with the following: 

        xmlSubstituteEntitiesDefault(1);

        xmlDoValidityCheckingDefaultValue = 1;
        xmlLoadExtDtdDefaultValue = 1;

        xmlInitParser();

- I have created the parser context with the following: 

        if ((ctxt = xmlCreateMemoryParserCtxt(response_body, response_len)) == NULL)
        {
                /* error */
        }

- I have parsed the document

        if (xmlParseDocument(ctxt) < 0)
        {
                /* error */
        }


This is the document (characters.xml from libxslt's tests/docs directory)

<?xml version="1.0" encoding="ISO-8859-1"?>
<character>
  <skills>
    <skill name="Balance" base="dex" ranks="2" total="5" mod="3"/>
    <skill name="Bluff" base="cha" ranks="3" total="4" mod="1"/>
    <skill name="Climb" base="str" ranks="6" total="5" mod="-1"/>
    <skill name="Diplomacy" base="cha" ranks="2" total="3" mod="1"/>
    <skill name="Escape artist" base="dex" ranks="2" total="5" mod="3"/>
    <skill name="Gather info" base="cha" ranks="2" total="3" mod="1"/>
    <skill name="Hide" base="dex" ranks="2" total="5" mod="3"/>
    <skill name="Jump" base="str" ranks="4" total="3" mod="-1"/>
    <skill name="Listen" base="wis" ranks="2" total="3" mod="1"/>
    <skill name="Move silently" base="dex" ranks="2" total="5" mod="3"/>
    <skill name="Perform" base="cha" ranks="4" total="5" mod="1"/>
    <skill name="Ride" base="dex" ranks="4" total="7" mod="3"/>
    <skill name="Search" base="int" ranks="2" total="3" mod="1"/>
    <skill name="Sense motive" base="wis" ranks="2" total="3" mod="1"/>
    <skill name="Spot" base="wis" ranks="2" total="3" mod="1"/>
    <skill name="Swim" base="str" ranks="4" total="3" mod="-1"/>
    <skill name="Tumble" base="dex" ranks="3" total="6" mod="3"/>
    <skill name="Use rope" base="dex" ranks="2" total="5" mod="3"/>
  </skills>
</character>

After the parsing, which returns 0, in ctxt I have the following fields:

- valid: 1
- validate: 0

But note that I also have the following output from xmlParseDocument:

Entity: line 2: validity error: Validation failed: no DTD found !
<character>
          ^

Why is valid still equal to 1 ?

TIA

Daniel

--
Bye,
        Fabrizio




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