Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Tue, 15 Jul 2008 14:43:12 +0200,    group: microsoft.public.xml        back       


Property "NewParser" still needed in MSXML6?   
Hi,

In MSXML4 there's was a property "NewParser" so you could choose between the 
'old' parser (slow, but with DTD support) or the 'new' parser (faster, but 
without DTD support).

Is this property still needed in MSXML6? According to Microsoft 
(http://msdn.microsoft.com/en-us/library/ms767616(VS.85).aspx), the property 
is supported in MSXML6, but i don't see any difference.

thanks,
- Gerben Abbink
date: Tue, 15 Jul 2008 14:43:12 +0200   author:   Gerben Abbink

Re: Property "NewParser" still needed in MSXML6?   
Gerben Abbink wrote:

> In MSXML4 there's was a property "NewParser" so you could choose between the 
> 'old' parser (slow, but with DTD support) or the 'new' parser (faster, but 
> without DTD support).
> 
> Is this property still needed in MSXML6? According to Microsoft 
> (http://msdn.microsoft.com/en-us/library/ms767616(VS.85).aspx), the property 
> is supported in MSXML6, but i don't see any difference.

Setting the property is possible with MSXML 6.

As for the difference, the following JScript program

var ver = '6.0';
var doc = new ActiveXObject('Msxml2.DOMDocument.' + ver);
doc.setProperty('NewParser', false);
doc.setProperty('ProhibitDTD', false);
doc.loadXML('<!DOCTYPE root [<!ELEMENT root (#PCDATA)>]><roo>foo</roo>');
WScript.Echo(doc.parseError.reason);

outputs

The name of the top most element 'roo' must match the name of the 
DOCTYPE declaration 'root'.

When I change to using the NewParser

var ver = '6.0';
var doc = new ActiveXObject('Msxml2.DOMDocument.' + ver);
doc.setProperty('NewParser', true);
doc.setProperty('ProhibitDTD', false);
doc.loadXML('<!DOCTYPE root [<!ELEMENT root (#PCDATA)>]><roo>foo</roo>');
WScript.Echo(doc.parseError.reason);

the output is

DTD Validation when using the NewParser option or MXXMLWriter to build a 
DOMDocument is not supported.

so the property works as documented. I have not done any tests to check 
whether there is a speed difference.


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
date: Tue, 15 Jul 2008 15:12:56 +0200   author:   Martin Honnen

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us