[xml] embedded comments in DTD



Hi,

I'm trying to parse an XML file with an associated DTD file.

I get an error that looks like this:
parser error : ContentDecl : Name or '(' expected
               instances_chop*, <!-- chop_enum with an atrribute for which insta



The problem appears to be an comment embedded in a !ELEMENT

<!ELEMENT xyz (instances_chop*, <!-- chop_enum with an atrribute for which instance is removed -->
                          group,
                          .... more stuff


looking in the code, the problem appears to be in the function: xmlParseElementChildrenContentDecl
which uses the define SKIP_BLANKS which in turn does not filter out comments.

So I guess the question is: is my DTD really invalid? Comments are allowed in other parts of the DTD (like between elements)

Seems it'd be easy to make the change required to allow these comments, but I'm surprised it's not already supported.

thanks for your time.
Miles


PS this is approximately the code I'm using to parse:
Something like this:
xmlParserCtxt *ctxt = xmlNewParserCtxt();
int options = XML_PARSE_DTDVALID;
m_doc = xmlCtxtReadFile(ctxt, filename.c_str(), NULL, options);



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