You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Jerome Siour <je...@smtp2.cosmosbay.com> on 2000/07/31 15:25:54 UTC

[Xerces-C] Retrieving DOCTYPE

Hello,

I'm looking for a way to retrieve the DOCTYPE declaration of an XML document.

I tried the two following ways, but none worked:
1. Use of DOM_Document::getDocType() => always returns null.
2. Overriding callback DOMParser::doctypeDecl(...) => never called

Unfortunately, I can not use Xerces C 1.2.0, because I'm under HPUX,
and no stable release 1.2.0 is available for this platform. So, I'm using Xerces C 1.1.0 for HPUX 11.

Does anybody have any ideas on how to retreive the DOCTYPE? (all the characters that are between "<!DOCTYPE" and "]>")

Thanks in advance,

Jerome Siour.




Re: [Xerces-C] Retrieving DOCTYPE

Posted by Dean Roddey <dr...@charmedquark.com>.
If you can't use the DOM stuff, then you can look at the EnumVal demo, which
shows how to poke around in some internal APIs in the validator, which
contains all that information.

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"You young, and you gotcha health. Whatchoo wanna job fer?"


----- Original Message -----
From: "Jerome Siour" <je...@smtp2.cosmosbay.com>
To: "Xerces-C-Dev (Adresse de messagerie)" <xe...@xml.apache.org>
Sent: Monday, July 31, 2000 6:25 AM
Subject: [Xerces-C] Retrieving DOCTYPE


> Hello,
>
> I'm looking for a way to retrieve the DOCTYPE declaration of an XML
document.
>
> I tried the two following ways, but none worked:
> 1. Use of DOM_Document::getDocType() => always returns null.
> 2. Overriding callback DOMParser::doctypeDecl(...) => never called
>
> Unfortunately, I can not use Xerces C 1.2.0, because I'm under HPUX,
> and no stable release 1.2.0 is available for this platform. So, I'm using
Xerces C 1.1.0 for HPUX 11.
>
> Does anybody have any ideas on how to retreive the DOCTYPE? (all the
characters that are between "<!DOCTYPE" and "]>")
>
> Thanks in advance,
>
> Jerome Siour.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>


Re: [Xerces-C] Retrieving DOCTYPE

Posted by Arundhati Bhowmick <ar...@hyperreal.org>.
Create a doctype from DOM_DOMImplementation and use that doctype to create the document from the implementation object.
And set this docuemnt in the parser using setDocument method then call parse. It will atomatically populate the dom tree
with doctype along with its entities and notation data.

Arundhati

Jerome Siour wrote:

> Hello,
>
> I'm looking for a way to retrieve the DOCTYPE declaration of an XML document.
>
> I tried the two following ways, but none worked:
> 1. Use of DOM_Document::getDocType() => always returns null.
> 2. Overriding callback DOMParser::doctypeDecl(...) => never called
>
> Unfortunately, I can not use Xerces C 1.2.0, because I'm under HPUX,
> and no stable release 1.2.0 is available for this platform. So, I'm using Xerces C 1.1.0 for HPUX 11.
>
> Does anybody have any ideas on how to retreive the DOCTYPE? (all the characters that are between "<!DOCTYPE" and "]>")
>
> Thanks in advance,
>
> Jerome Siour.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org

--


Arundhati Bhowmick
IBM -- XML Technology Group (Silicon Valley)