You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Bobenrieth Guy <gb...@easyweb.jway.lu> on 2000/12/07 09:56:32 UTC

Differences between features : load-dtd and load-external-dtd ?

Hello,
Can somebody explain me the difference between these two features ? 

When I look at definition of "load-dtd", I can see "Ignore the external
DTD completely."

And when I look at load-external-dtd, I can see "feature, so that when
non validating, 
applications can ask the parser not to load the external subset at all " 
 
It sounds like doing the same thing, no ?

Thanks for your help.

Guy Bobenrieth

problem and patch concerning parsing of ignorable white spaces

Posted by Sebastien Ponce <se...@cern.ch>.
It seems that ignorable white spaces are not correctly parsed when appearing
inside an element.
Here is an example of xml file :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE SETUP SYSTEM "setup.dtd">
<SETUP>
    <OPEN_FILES>
        <FILE reference="/home/seb/DDDB/dddb.xml"/>
    </OPEN_FILES>
</SETUP>
Here, the spaces between the SETUP and OPEN_FILES tags are detected as
ignorable but not those between the OPEN_FILES and FILE tags.

The (very simple) patch attached to this mail corrects this behavior but is
maybe breaking something else I don't use.
If someone could try it and maybe and apply it...

Sebastien


Re: Differences between features : load-dtd and load-external-dtd ?

Posted by Arnaud Le Hors <le...@us.ibm.com>.
Bobenrieth Guy wrote:
> 
> Hello,
> Can somebody explain me the difference between these two features ?
> 
> When I look at definition of "load-dtd", I can see "Ignore the external
> DTD completely."
> 
> And when I look at load-external-dtd, I can see "feature, so that when
> non validating,
> applications can ask the parser not to load the external subset at all "
> 
> It sounds like doing the same thing, no ?

load-dtd doesn't actually exist. It's a typo in the doc. The correct
name is load-external-dtd. Sorry for the confusion.
-- 
Arnaud  Le Hors - IBM Cupertino, XML Technology Group

Re: Differences between features : load-dtd and load-external-dtd ?

Posted by Bobenrieth Guy <gb...@easyweb.jway.lu>.
Bobenrieth Guy wrote:
> 
> Hello,
> Can somebody explain me the difference between these two features ?
> 
> When I look at definition of "load-dtd", I can see "Ignore the external
> DTD completely."
> 
> And when I look at load-external-dtd, I can see "feature, so that when
> non validating,
> applications can ask the parser not to load the external subset at all "
> 
> It sounds like doing the same thing, no ?
> 
> Thanks for your help.
> 
> Guy Bobenrieth
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org

Answer to myself,
it seems that only the
"http://apache.org/xml/features/nonvalidating/load-external-dtd" feature
is available inside the XMLParser.java file.

The others features are : 

private static final String RECOGNIZED_FEATURES[] = {
        // SAX2 core
        "http://xml.org/sax/features/validation",
        "http://xml.org/sax/features/external-general-entities",
        "http://xml.org/sax/features/external-parameter-entities",
        "http://xml.org/sax/features/namespaces",
        // Xerces
        "http://apache.org/xml/features/validation/schema",
        "http://apache.org/xml/features/validation/dynamic",
       
"http://apache.org/xml/features/validation/default-attribute-values",
       
"http://apache.org/xml/features/validation/validate-content-models",
        "http://apache.org/xml/features/validation/validate-datatypes",
       
"http://apache.org/xml/features/validation/warn-on-duplicate-attdef",
       
"http://apache.org/xml/features/validation/warn-on-undeclared-elemdef",
        "http://apache.org/xml/features/allow-java-encodings",
        "http://apache.org/xml/features/continue-after-fatal-error",
        "http://apache.org/xml/features/nonvalidating/load-dtd-grammar",
        "http://apache.org/xml/features/nonvalidating/load-external-dtd"
    };

May be the "load-dtd" feature was simply not implemented.

Guy

Parse stand-alone DTD

Posted by Dennis Thrysoe - Netnord A/S <dt...@netnord.dk>.
How difficult would it be to re-use the DTD scanning and parsing code by 
itself? For instance by implementing a parseDTD method somewhere.

-dennis