You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by "Dantzler, DeWayne C" <de...@boeing.com> on 2009/01/23 00:19:52 UTC

How do you validate against an external DTD

Hello
 
I'm currently using Xerces C++ 2.7.0 DOM Parser. I want to validate
against an external DTD specified by the caller and not the DTD called
out in the XML document. How is this done with the Xerces API? 

Here's what I've done.

 Code snippet:
 ==========================================================
//perform the necessary DOM Parser init and setup ... omitting all the
gory details

//setup the Entity Resolver to redirect the parser to use the external
DTD 
//to resolve external ENTITY's  and not the DTD called out in the XML
file by the DOCTYPE declaration
//The entire XML file will also be validated against the external DTD as
well
		
	csCtkXmlEntityResolver *resolver = new
csCtkXmlEntityResolver(dtd); <<--- caller specified dtd
	_XmlDOMParser->setEntityResolver(resolver);
		
	//Turn on the necessary features to allow validation by an
external DTD	   
	_XmlDOMParser->setValidationScheme(_XmlDOMParser->Val_Always);
	_XmlDOMParser->setDoSchema(false);			
	_XmlDOMParser->setLoadExternalDTD(true);

	//TODO - How do you load an external DTD???
	//Not sure if this routine does it, but I'll give it a try and
it didn't!!

	_XmlDOMParser->loadGrammar(dtd, Grammar::DTDGrammarType, false);
	_XmlDOMParser->setSkipDTDValidation(false);
	_XmlDOMParser->useCachedGrammarInParse(true);

	....
	//attempt to parese the XML and get pages of errors		
	}
==============================================================

 Results: Lots of Parser Errors but several of the elments are defined 
 in the DTD

<?xml version="1.0" encoding="UTF-8"?>
line 2::column 6: <bcme
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

Parser Error Message: Unknown element 'bcme'

<?xml version="1.0" encoding="UTF-8"?>
line 2::column 17: <bcme
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

Parser Error Message: Attribute 'xmlns:xsi' is not declared for element
'bcme'

<?xml version="1.0" encoding="UTF-8"?>
<bcme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
line 3::column 33:
xsi:noNamespaceSchemaLocation="http://www.boeing.com/commercial/cas_xml/
s1000d/3-0BE1-3/schema/bcme.xsd">

Parser Error Message: Attribute 'xsi:noNamespaceSchemaLocation' is not
declared for element 'bcme'

==============================================================
XML Doc Snippet

<?xml version="1.0" encoding="UTF-8"?>
<bcme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 
xsi:noNamespaceSchemaLocation="http://www.mycompany.com/cas_xml/schema/a
cme.xsd">
  <edition>
    <editionid>BCMM-21-21-03-81205_20080301.1207260301</editionid>
    <editionType>New</editionType>
    <editionNumber>1207260301</editionNumber>
  </edition>
==================================================================

Best Regards Dewayne

Re: XML intro 101 Basics

Posted by David Bertoni <db...@apache.org>.
Dantzler, DeWayne C wrote:
>  Hello
> 
> Can someone explain in XML for Dummies terms the difference between a
> public id and system id? I'm trying to understand how to implement an
> entity resolver and I'm getting tangled on these terms.
You should take a look at the XML recommendation first:

http://www.w3.org/TR/REC-xml/#dt-sysid

In short, a aystem ID is a URI reference to a physical entity.  A public 
ID is a intended to be a symbolic ID which is both unique and canonical.

For example, the a copy of the strict XHTML DTD is hosted by the W3C here:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd

and it is identified by the following public ID:

-//W3C//DTD XHTML 1.0 Strict//EN

In the future, please try to limit your postings to Xerces-specific 
questions, rather than general questions about XML.

Dave

XML intro 101 Basics

Posted by "Dantzler, DeWayne C" <de...@boeing.com>.
 Hello

Can someone explain in XML for Dummies terms the difference between a
public id and system id? I'm trying to understand how to implement an
entity resolver and I'm getting tangled on these terms.

Thanks

DeWayne 

Re: Correct Usage of LoadGrammar method for Xerces 2.7.0

Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Hi DeWayne,

Dantzler, DeWayne C <de...@boeing.com> writes:

> Ok, If I understand your comments correctly, loading a grammar does not
> override the reference specified in an XML instance. So, if the instance
> has an outdated DTD reference and I want to parse against a later
> version, using loadGrammar will cause the Parser to parse against both
> DTD's instead of only against the one loaded via loadGrammar. If this is
> correct, then how can I specify a specific DTD to parse against rather
> than the one specified in the XML instance?

I don't think you can (or want) to do this for the internal subset
(DTD that is embedded into the XML instance itself). For the external
subset, I believe you can do setLoadExternalDTD(false).

Boris

-- 
Boris Kolpackov, Code Synthesis Tools   http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

RE: Correct Usage of LoadGrammar method for Xerces 2.7.0

Posted by "Dantzler, DeWayne C" <de...@boeing.com>.
Ok, If I understand your comments correctly, loading a grammar does not
override the reference specified in an XML instance. So, if the instance
has an outdated DTD reference and I want to parse against a later
version, using loadGrammar will cause the Parser to parse against both
DTD's instead of only against the one loaded via loadGrammar. If this is
correct, then how can I specify a specific DTD to parse against rather
than the one specified in the XML instance?

Thanks 

DeWayne 


-----Original Message-----
From: Boris Kolpackov [mailto:boris@codesynthesis.com] 
Sent: Tuesday, February 03, 2009 12:20 AM
To: c-users@xerces.apache.org
Subject: Re: Correct Usage of LoadGrammar method for Xerces 2.7.0

Hi DeWayne,

Dantzler, DeWayne C <de...@boeing.com> writes:

> I thought that calling the methods loadGrammar and 
> usedCachedGrammarInParse would force the parser to use the grammar 
> just loaded instead of loading the grammar specified by the instance 
> document. I tried the following below and it appears that the parser 
> attempted to use the DTD specified in the XML file rather than the one

> I loaded and cached.

Unlike XML Schema which has a target namespace as a grammar identifier,
for DTD there is no way for the parser to know that the grammar in cache
is the same as the one referenced from XML instance. So, in your case,
the parser will use both grammars. One way to change this might be to do
setLoadExternalDTD(false).

Boris

-- 
Boris Kolpackov, Code Synthesis Tools
http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:
http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing:
http://codesynthesis.com/products/xsde

Re: Correct Usage of LoadGrammar method for Xerces 2.7.0

Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Hi DeWayne,

Dantzler, DeWayne C <de...@boeing.com> writes:

> I thought that calling the methods loadGrammar and
> usedCachedGrammarInParse would force the parser to use the grammar just
> loaded instead of loading the grammar specified by the instance
> document. I tried the following below and it appears that the parser
> attempted to use the DTD specified in the XML file rather than the one I
> loaded and cached.

Unlike XML Schema which has a target namespace as a grammar identifier,
for DTD there is no way for the parser to know that the grammar in cache
is the same as the one referenced from XML instance. So, in your case,
the parser will use both grammars. One way to change this might be to
do setLoadExternalDTD(false).

Boris

-- 
Boris Kolpackov, Code Synthesis Tools   http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

Correct Usage of LoadGrammar method for Xerces 2.7.0

Posted by "Dantzler, DeWayne C" <de...@boeing.com>.
Hello

I thought that calling the methods loadGrammar and
usedCachedGrammarInParse would force the parser to use the grammar just
loaded instead of loading the grammar specified by the instance
document. I tried the following below and it appears that the parser
attempted to use the DTD specified in the XML file rather than the one I
loaded and cached. What am I missing here? Using Xerces 2.7.0 DOM Impl.

Code snippet
================================
	_XmlDOMParser->setValidationScheme(_XmlDOMParser->Val_Always);
	_XmlDOMParser->setDoSchema(false);
		
	//load grammar and cache it
	_XmlDOMParser->setLoadExternalDTD(true);
	_XmlDOMParser->loadGrammar(dtd, Grammar::DTDGrammarType, true);
	_XmlDOMParser->setSkipDTDValidation(false);
	_XmlDOMParser->useCachedGrammarInParse(true);
	_XmlDOMParser->parse(xmlDoc2Parse);
	
..... The attempt to parse and validate got the error below:

The following error occurred during the XML validation

XML Parser Fatal Error in file
"/net/sinai/home/d/dcd9420/labs/bcmeXmlLab/boldMetaData-PP-777-D633W101-
EAD-51-20070905.xml"

<?xml version="1.0" encoding="UTF-8"?>
Line 2::Column 92	<!DOCTYPE DOCUMENT SYSTEM
"http//web/dtd/ddps_mmm_meta_3.dtd">

Parser Error Message: An exception occurred! Type:NetAccessorException,
Message:Could not read from the socket for URL
'http//web/dtd/ddps_mmm_meta_3.dtd'	

!!! ATTENTION - DON'T WANT TO USE THE DTD SPECIFIED IN THE DOCUMENT
SINCE I CAN'T ACCESS IT
===================================

Snippet of XML file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE DOCUMENT SYSTEM http//web/dtd/ddps_mmm_meta_3.dtd">
<DOCUMENT>
  <APPLICATION VERSION="2.0.3.0507">TECHNICAL DOCUMENTS</APPLICATION>
  <PRODUCT_NUMBER>D633W101-EAD</PRODUCT_NUMBER>


RE: How do you validate against an external DTD

Posted by "Dantzler, DeWayne C" <de...@boeing.com>.
Dave 

Given your explaination on how to use methods loadGrammar and
useCachedCrammarInParse, I tried the following below and it appears that
the parser attempted to use the DTD specified in the XML file rather
than the one I loaded and cached using the loadGrammar method. I thought
this would force the parser to use the dtd specified in the loadGrammar
method call. What am I missing here? Using Xerces 2.7.0 DOM Impl.

Code snippet
================================
	_XmlDOMParser->setValidationScheme(_XmlDOMParser->Val_Always);
	_XmlDOMParser->setDoSchema(false);
		
	//load grammar and cache it
	_XmlDOMParser->setLoadExternalDTD(true);
	_XmlDOMParser->loadGrammar(dtd, Grammar::DTDGrammarType, true);
	_XmlDOMParser->setSkipDTDValidation(false);
	_XmlDOMParser->useCachedGrammarInParse(true);
	_XmlDOMParser->parse(xmlDoc2Parse);
	
..... The attempt to parse and validate got the error below:

The following error occurred during the XML validation

XML Parser Fatal Error in file
"/net/sinai/home/d/dcd9420/labs/bcmeXmlLab/boldMetaData-PP-777-D633W101-
EAD-51-20070905.xml"

<?xml version="1.0" encoding="UTF-8"?>
Line 2::Column 92	<!DOCTYPE DOCUMENT SYSTEM
"http//web/dtd/ddps_mmm_meta_3.dtd">

Parser Error Message: An exception occurred! Type:NetAccessorException,
Message:Could not read from the socket for URL
'http//web/dtd/ddps_mmm_meta_3.dtd'	
===================================

Snippet of XML file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE DOCUMENT SYSTEM http//web/dtd/ddps_mmm_meta_3.dtd">
<DOCUMENT>
  <APPLICATION VERSION="2.0.3.0507">TECHNICAL DOCUMENTS</APPLICATION>
  <PRODUCT_NUMBER>D633W101-EAD</PRODUCT_NUMBER>

====================================
Dantzler, DeWayne C wrote:
> Ok, can someone explain to me what the method 'loadGrammar' actually 
> does and when and why I would use it? Likewise, the same questions for

> the method 'useCachedGrammarInParse'. Hopefully, this will help me to 
> understand how the Parsers validates against a DTD. What is the 
> meaning of 'grammar' in this context and how does the parser generate 
> and use it?
It means "load a grammar from an external resource and return a pointer
to the resulting object."  You can use this object for parsing and
validating instance documents.

You would mostly want to do this if you want to share a grammar between
parsers, or you are interesting in just the grammar object itself.  For
example, it's possible to load a schema grammar, then query the grammar
for interesting information about the types the schema defines.

The flag 'usedCachedGrammarInParse' tells to parser to use any cached
grammar instead of loading the grammar specified by the instance
document.  Consider an instance document with schema location hints. 
Those hints might point to a different schema than the one in the
parser's cache.  If the parser were to always use the cached grammar,
there might be cases where that would not be the right one.  On the
other hand, there might be cases where you would want to force the
parser to use a specific grammar.

"Grammar" in this context means either a DTD or schema, which can be
thought of as grammars for validating particular kinds of XML documents.

> 
> BTW... I read the header files docs on these methods, but could not 
> make sense of what is meant by 'Preparse' schema/dtd grammar. See
below.
> Thanks
"Preparse" simply means the parser reads the grammar and build the
appropriate objects it uses for validating XML instance documents.

The 'toCache' flag instructs the parser to put the grammar object in its
internal cache.

The 'useCachedGrammarInParse' property instructs the parser to always
prefer cached grammars over those specified by the instance document.

Dave

Re: How do you validate against an external DTD

Posted by David Bertoni <db...@apache.org>.
Dantzler, DeWayne C wrote:
> Ok, can someone explain to me what the method 'loadGrammar' actually
> does and when and why I would use it? Likewise, the same questions for
> the method 'useCachedGrammarInParse'. Hopefully, this will help me to
> understand how the Parsers validates against a DTD. What is the meaning
> of 'grammar' in this context and how does the parser generate and use
> it?
It means "load a grammar from an external resource and return a pointer 
to the resulting object."  You can use this object for parsing and 
validating instance documents.

You would mostly want to do this if you want to share a grammar between 
parsers, or you are interesting in just the grammar object itself.  For 
example, it's possible to load a schema grammar, then query the grammar 
for interesting information about the types the schema defines.

The flag 'usedCachedGrammarInParse' tells to parser to use any cached 
grammar instead of loading the grammar specified by the instance 
document.  Consider an instance document with schema location hints. 
Those hints might point to a different schema than the one in the 
parser's cache.  If the parser were to always use the cached grammar, 
there might be cases where that would not be the right one.  On the 
other hand, there might be cases where you would want to force the 
parser to use a specific grammar.

"Grammar" in this context means either a DTD or schema, which can be 
thought of as grammars for validating particular kinds of XML documents.

> 
> BTW... I read the header files docs on these methods, but could not make
> sense of what is meant by 'Preparse' schema/dtd grammar. See below.
> Thanks 
"Preparse" simply means the parser reads the grammar and build the 
appropriate objects it uses for validating XML instance documents.

The 'toCache' flag instructs the parser to put the grammar object in its 
internal cache.

The 'useCachedGrammarInParse' property instructs the parser to always 
prefer cached grammars over those specified by the instance document.

Dave

RE: How do you validate against an external DTD

Posted by "Dantzler, DeWayne C" <de...@boeing.com>.
Ok, can someone explain to me what the method 'loadGrammar' actually
does and when and why I would use it? Likewise, the same questions for
the method 'useCachedGrammarInParse'. Hopefully, this will help me to
understand how the Parsers validates against a DTD. What is the meaning
of 'grammar' in this context and how does the parser generate and use
it?

BTW... I read the header files docs on these methods, but could not make
sense of what is meant by 'Preparse' schema/dtd grammar. See below.
Thanks 

/**
      * Preparse schema grammar (XML Schema, DTD, etc.) via a file path
or URL
      *
      * This method invokes the preparsing process on a schema grammar
XML
      * file specified by the file path parameter. If the 'toCache' flag
      * is enabled, the parser will cache the grammars for re-use. If a
grammar
      * key is found in the pool, no caching of any grammar will take
place.
      *
      * <p><b>"Experimental - subject to change"</b></p>
      *
      * @param systemId A const char pointer to a native string which
contains
      *                 the path to the XML grammar file to be
preparsed.
      * @param grammarType The grammar type (Schema or DTD).
      * @param toCache If <code>true</code>, we cache the preparsed
grammar,
      *                otherwise, no chaching. Default is
<code>false</code>.
      * @return The preparsed schema grammar object (SchemaGrammar or
      *         DTDGrammar). That grammar object is owned by the parser.
      *
      * @exception SAXException Any SAX exception, possibly
      *            wrapping another exception.
      * @exception XMLException An exception from the parser or client
      *            handler code.
      * @exception DOMException A DOM exception as per DOM spec.
      */
    
	Grammar* loadGrammar(const char* const systemId,
                         const short grammarType,
                         const bool toCache = false);

 /** Set the 'Use cached grammar' flag
      *
      * This method allows users to enable or disable the use of cached
      * grammars.  When set to true, the parser will use the cached
grammar,
      * instead of building the grammar from scratch, to validate XML
      * documents.
	
	void useCachedGrammarInParse(const bool newState);

DeWayne Dantlzer
206-544-3658


-----Original Message-----
From: David Bertoni [mailto:dbertoni@apache.org] 
Sent: Friday, January 23, 2009 2:06 PM
To: c-users@xerces.apache.org
Subject: Re: How do you validate against an external DTD

Dantzler, DeWayne C wrote:
> Hello
>  
> I'm currently using Xerces C++ 2.7.0 DOM Parser. I want to validate 
> against an external DTD specified by the caller and not the DTD called

> out in the XML document. How is this done with the Xerces API?
The easiest way is with an EntityResolver or a DOMLSResourceResolver,
depending on which parsing interface you're using.

> 
> Here's what I've done.
> 
>  Code snippet:
>  ==========================================================
> //perform the necessary DOM Parser init and setup ... omitting all the

> gory details
> 
> //setup the Entity Resolver to redirect the parser to use the external

> DTD //to resolve external ENTITY's  and not the DTD called out in the 
> XML file by the DOCTYPE declaration //The entire XML file will also be

> validated against the external DTD as well
> 		
> 	csCtkXmlEntityResolver *resolver = new
csCtkXmlEntityResolver(dtd); 
> <<--- caller specified dtd
> 	_XmlDOMParser->setEntityResolver(resolver);
> 		
> 	//Turn on the necessary features to allow validation by an
> external DTD	   
> 	_XmlDOMParser->setValidationScheme(_XmlDOMParser->Val_Always);
> 	_XmlDOMParser->setDoSchema(false);			
> 	_XmlDOMParser->setLoadExternalDTD(true);
This value is true by default.

> 
> 	//TODO - How do you load an external DTD???
> 	//Not sure if this routine does it, but I'll give it a try and
it 
> didn't!!
> 
> 	_XmlDOMParser->loadGrammar(dtd, Grammar::DTDGrammarType, false);
You've loaded the grammar, but told the parser not to cache it, so it
knows nothing about it.  Please pass 'true' as the last parameter.

> 	_XmlDOMParser->setSkipDTDValidation(false);
> 	_XmlDOMParser->useCachedGrammarInParse(true);
> 
> 	....
> 	//attempt to parese the XML and get pages of errors		
> 	}
> ==============================================================
> 
>  Results: Lots of Parser Errors but several of the elments are defined

> in the DTD
> 
> <?xml version="1.0" encoding="UTF-8"?> line 2::column 6: <bcme 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 
> Parser Error Message: Unknown element 'bcme'
> 
> <?xml version="1.0" encoding="UTF-8"?> line 2::column 17: <bcme 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 
> Parser Error Message: Attribute 'xmlns:xsi' is not declared for 
> element 'bcme'
> 
> <?xml version="1.0" encoding="UTF-8"?> <bcme 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> line 3::column 33:
> xsi:noNamespaceSchemaLocation="http://www.boeing.com/commercial/cas_xm
> l/
> s1000d/3-0BE1-3/schema/bcme.xsd">
> 
> Parser Error Message: Attribute 'xsi:noNamespaceSchemaLocation' is not

> declared for element 'bcme'
> 
> ==============================================================
> XML Doc Snippet
> 
> <?xml version="1.0" encoding="UTF-8"?> <bcme 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  
> xsi:noNamespaceSchemaLocation="http://www.mycompany.com/cas_xml/schema
> /a
> cme.xsd">
>   <edition>
>     <editionid>BCMM-21-21-03-81205_20080301.1207260301</editionid>
>     <editionType>New</editionType>
>     <editionNumber>1207260301</editionNumber>
>   </edition>
> ==================================================================
This document looks like it uses a schema for validation, not a DTD.  In
general, documents that are structured to use XML schema for validation
can be difficult to validate using a DTD.  You might still get some
validation errors, depending on the instance document, and how flexible
the DTD is.

Dave

Re: How do you validate against an external DTD

Posted by David Bertoni <db...@apache.org>.
Dantzler, DeWayne C wrote:
> Hello
>  
> I'm currently using Xerces C++ 2.7.0 DOM Parser. I want to validate
> against an external DTD specified by the caller and not the DTD called
> out in the XML document. How is this done with the Xerces API? 
The easiest way is with an EntityResolver or a DOMLSResourceResolver, 
depending on which parsing interface you're using.

> 
> Here's what I've done.
> 
>  Code snippet:
>  ==========================================================
> //perform the necessary DOM Parser init and setup ... omitting all the
> gory details
> 
> //setup the Entity Resolver to redirect the parser to use the external
> DTD 
> //to resolve external ENTITY's  and not the DTD called out in the XML
> file by the DOCTYPE declaration
> //The entire XML file will also be validated against the external DTD as
> well
> 		
> 	csCtkXmlEntityResolver *resolver = new
> csCtkXmlEntityResolver(dtd); <<--- caller specified dtd
> 	_XmlDOMParser->setEntityResolver(resolver);
> 		
> 	//Turn on the necessary features to allow validation by an
> external DTD	   
> 	_XmlDOMParser->setValidationScheme(_XmlDOMParser->Val_Always);
> 	_XmlDOMParser->setDoSchema(false);			
> 	_XmlDOMParser->setLoadExternalDTD(true);
This value is true by default.

> 
> 	//TODO - How do you load an external DTD???
> 	//Not sure if this routine does it, but I'll give it a try and
> it didn't!!
> 
> 	_XmlDOMParser->loadGrammar(dtd, Grammar::DTDGrammarType, false);
You've loaded the grammar, but told the parser not to cache it, so it 
knows nothing about it.  Please pass 'true' as the last parameter.

> 	_XmlDOMParser->setSkipDTDValidation(false);
> 	_XmlDOMParser->useCachedGrammarInParse(true);
> 
> 	....
> 	//attempt to parese the XML and get pages of errors		
> 	}
> ==============================================================
> 
>  Results: Lots of Parser Errors but several of the elments are defined 
>  in the DTD
> 
> <?xml version="1.0" encoding="UTF-8"?>
> line 2::column 6: <bcme
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 
> Parser Error Message: Unknown element 'bcme'
> 
> <?xml version="1.0" encoding="UTF-8"?>
> line 2::column 17: <bcme
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 
> Parser Error Message: Attribute 'xmlns:xsi' is not declared for element
> 'bcme'
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <bcme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> line 3::column 33:
> xsi:noNamespaceSchemaLocation="http://www.boeing.com/commercial/cas_xml/
> s1000d/3-0BE1-3/schema/bcme.xsd">
> 
> Parser Error Message: Attribute 'xsi:noNamespaceSchemaLocation' is not
> declared for element 'bcme'
> 
> ==============================================================
> XML Doc Snippet
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <bcme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  
> xsi:noNamespaceSchemaLocation="http://www.mycompany.com/cas_xml/schema/a
> cme.xsd">
>   <edition>
>     <editionid>BCMM-21-21-03-81205_20080301.1207260301</editionid>
>     <editionType>New</editionType>
>     <editionNumber>1207260301</editionNumber>
>   </edition>
> ==================================================================
This document looks like it uses a schema for validation, not a DTD.  In 
general, documents that are structured to use XML schema for validation 
can be difficult to validate using a DTD.  You might still get some 
validation errors, depending on the instance document, and how flexible 
the DTD is.

Dave