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 Colin Paul Adams <co...@colina.demon.co.uk> on 2003/07/11 15:13:25 UTC

Implementing DOMParser

>>>>> "Gareth" == Gareth Reakes <ga...@decisionsoft.com> writes:

    Gareth> Give us a shout if you need any help.

A few clarifications please:

First, the near-trivia:

I use Emacs for editing. I immediately notice the the indentation used
by default in Emacs C++ mode is not the same as that used in the
current sources. Can you (or anyone else) tell me what I should do to
get Emacs to use the same style (alternatively, if there is not a
fixed style, as they are all new files, I could just use the default
Emacs style).

More substantially:

With the Last Call draft, there are no longer methods to get and set
the ErrorHandler and EntityResolver directly. Rather you call
get/setParameter methods on the DOMConfiguration.

In the case of the error handler, I figure that all I need to do is to
get the DOMErrorHandler from the DOMConfiguration (which I initially
set just by calling the default DOMConfigurationImpl constructor) from
within the error method DOMParserImpl::error, and then everything else
will work unchanged. As I understand it (am I right?), the
AbstractDOMParser will call this method when an error occurs.

I haven't looked into the entity resolver business yet, but I guess it
will be something similar. 
-- 
Colin Paul Adams
Preston Lancashire

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Implementing DOMParser

Posted by Colin Paul Adams <co...@colina.demon.co.uk>.
>>>>> "Colin" == Colin Paul Adams <co...@colina.demon.co.uk> writes:

    Colin> I haven't looked into the entity resolver business yet, but
    Colin> I guess it will be something similar. 

Well, no.

I don't think much of the Last Call working draft - it mentions:

 DOMResourceResolver provides a way for applications to redirect references to external resources.

Applications needing to implement custom handling for external
resources can implement this interface and register their
implementation by setting the resourceResolver attribute of the
DOMParser

But the DOMParser interface makes no mention of a resourceResolver
attribute. However DOM 3.0 Core Last Call draft mentions a
"resource-resolver" parameter.

Since the two drafts are at minor odds with each other, I don't know
what to do. I shall send comments to the public list, and see what
answers come up.
-- 
Colin Paul Adams
Preston Lancashire

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Implementing DOMParser

Posted by Gareth Reakes <ga...@decisionsoft.com>.
Hi Colin,


On 11 Jul 2003, Colin Paul Adams wrote:
> 
> I use Emacs for editing. I immediately notice the the indentation used


(defconst xerces-style
  '("java"
    (c-basic-offset . 4)
    (tab-width . 4)											
    (c-hanging-comment-ender-p . nil)
    (indent-tabs-mode . nil)))

(add-hook 'c-mode-common-hook 
	  (lambda ()
	    (c-add-style "xerces" xerces-style)))

(add-hook 'c++-mode-hook
	  (lambda ()
	    (c-set-style "xerces")))


in your .emacs file.

> 
> More substantially:
> 
> With the Last Call draft, there are no longer methods to get and set
> the ErrorHandler and EntityResolver directly. Rather you call
> get/setParameter methods on the DOMConfiguration.

That is correct, although those methods still exist in the impl.

> 
> In the case of the error handler, I figure that all I need to do is to
> get the DOMErrorHandler from the DOMConfiguration (which I initially
> set just by calling the default DOMConfigurationImpl constructor) from
> within the error method DOMParserImpl::error, and then everything else
> will work unchanged. As I understand it (am I right?), the
> AbstractDOMParser will call this method when an error occurs.

Sounds right to me.



Gareth

-- 
Gareth Reakes, Head of Product Development  +44-1865-203192
DecisionSoft Limited                        http://www.decisionsoft.com
XML Development and Services




---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org