[gdome]doctype.entities problem
- From: Uwe Fechner <uwe fechner 4commerce de>
- To: gdome <gdome gnome org>
- Subject: [gdome]doctype.entities problem
- Date: Wed, 14 Nov 2001 13:58:07 +0100
Hello,
the method doctype.entites doesn't work for me:
I wrote the following test-program:
Procedure Native2;
// An Example Programm for the direct use of gdome
// (without the xmldom.pas interface)
// Testing doctype
var domimpl: PGdomeDOMImplementation;
doc: PGdomeDocument;
exc:GdomeException;
filename:string;
doctype:PGdomeDocumentType;
entities:PGdomeNamedNodeMap;
begin
filename:='..\data\test-dtd.xml';
domimpl:=gdome_di_mkref; // create a domreference
doc:=gdome_di_validateFile(domimpl,pchar(filename),@exc);
if doc<>nil then outLog('Parsed file ok!');
doctype:=gdome_doc_docType(doc, @exc);
if doctype<>nil then outLog('Found doctype!');
entities:=gdome_dt_entities(doctype,@exc);
if entities<>nil then outLog('Found entities!');
outlog('entities.length: '+inttostr(gdome_nnm_length(entities, @exc)));
gdome_di_freeDoc (domimpl, doc, @exc);
gdome_di_unref(domimpl, @exc); // free the dom reference
end;
Here is the DTD:
<!ELEMENT TEST-DTD (#PCDATA)>
<!NOTATION type0 SYSTEM "program0">
<!NOTATION type1 SYSTEM "program1">
<!NOTATION type2 SYSTEM "program2">
<!NOTATION type3 SYSTEM "program3">
<!NOTATION type4 SYSTEM "program4">
<!ENTITY FOO0 "bar0">
<!ENTITY FOO1 "bar1">
<!ENTITY FOO2 SYSTEM "file.type2" NDATA type2>
<!ENTITY FOO3 "bar3">
<!ENTITY FOO4 "bar4">
Here is the xml-file:
<?xml version="1.0"?>
<!DOCTYPE TEST-DTD SYSTEM "test-dtd.dtd">
<TEST-DTD>
&FOO1;
</TEST-DTD>
The files test-dtd.dtd and test-dtd.xml are in the same directory.
The output of the program is:
Parsed file ok!
Found doctype!
Found entities!
entities.length: 0
This can't be correct.
entities.length must have the value 5.
Any idea?
(The function gdome_nnm_length does work on different NamedNodeMaps!).
Best regards:
Uwe Fechner
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]