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 Jason Stewart <ja...@gmail.com> on 2006/10/14 06:59:28 UTC

DOMLSParserFilter::acceptNode

Hey all,

I'm implementing perl proxy classes for the different DOM NodeFilter
classes. I ran into an odd interface problem. Why does
DOMLSParserFilter not inherit from DOMNodeFilter? It implements it's
own acceptNode() method with a different signature.

short
DOMLSParserFilter::acceptNode (DOMNode* node);

versus

short
DOMNodeFilter::acceptNode (const DOMNode* node) const;

Why is the DOMLSParserFilter not a const method, and why is the node not
a const pointer? Is this in the spec?

It doesn't cause any bugs - but it just looked odd.

Cheers, jas.

Hi all,

I've looked at DOMLSSerializer::setNewLine() and by the spec there are
only four supported values - but the value is not being checked in the
implementation class, any value is accepted. Shouldn't we be checking
the value and throwing and exception if a bogus value is specified?

Cheers, jas.

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


Re: DOMLSParserFilter::acceptNode

Posted by Alberto Massari <am...@datadirect.com>.
At 14.57 26/10/2006 +0530, Jason Stewart wrote:
>Hey Alberto,
>
>On 10/26/06, Alberto Massari <am...@datadirect.com> wrote:
>>
>>Sure! Do you have a place where I can upload, or should I attach it
>>to a (personal) e-mail?
>
>I would just upload it to apache. I store the binaries in:
>
>  /www/www.apache.org/dist/xml/xerces-p/binaries/

It looks I cannot write in that folder... can you move it there from 
~amassari/xerces-p_3.0.0.zip?

Thanks,
Alberto 


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


Re: DOMLSParserFilter::acceptNode

Posted by Jason Stewart <ja...@gmail.com>.
Hey Alberto,

On 10/26/06, Alberto Massari <am...@datadirect.com> wrote:
>
> Sure! Do you have a place where I can upload, or should I attach it
> to a (personal) e-mail?
>

I would just upload it to apache. I store the binaries in:

  /www/www.apache.org/dist/xml/xerces-p/binaries/

Cheers, jas.

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


Re: DOMLSParserFilter::acceptNode

Posted by Alberto Massari <am...@datadirect.com>.
Hi Jason,

At 16.13 25/10/2006 +0530, Jason Stewart wrote:
>[...]
>Cool. Thanks for all the help Alberto!
>
>So am I correct in assuming that you have a working version of
>Xerces-P that compiles for MSVC++? That's cool! It would be super to
>release a binary for people to try.

Sure! Do you have a place where I can upload, or should I attach it 
to a (personal) e-mail?

Alberto 


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


Re: DOMLSParserFilter::acceptNode

Posted by Jason Stewart <ja...@gmail.com>.
Hey Alberto,

On 10/19/06, Alberto Massari <am...@datadirect.com> wrote:

> They are:
> - make-xml-exception.i I added a 'static' keyword to the method
> definition (but probably is not needed; I got the error 'multiple
> implementation of method' when I was still trying to build a
> singleton DLL, before realizing that Perl needed 4 of them)

ok - should be fine

> - includes.i and unicode.i now read PSVIUni.hpp from the Xerces
> sources, instead of the samples folder

Ah, cool. I hadn't updated my xercesc sources in a while - I didn't
realize that it had moved...

> - shadow.i was missing a new line at the end
>
> I also changed the Perl scripts as ActivePerl 5.8 complained (scope
> of variable declarations, /dev/null instead of NUL, removal of
> several 'use blib' declarations).
>

Cool. Thanks for all the help Alberto!

So am I correct in assuming that you have a working version of
Xerces-P that compiles for MSVC++? That's cool! It would be super to
release a binary for people to try.

Cheers, jas.

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


Re: DOMLSParserFilter::acceptNode

Posted by Alberto Massari <am...@datadirect.com>.
At 22.12 18/10/2006 +0530, Jason Stewart wrote:
>Hey Alberto,
>
>On 10/18/06, Alberto Massari <am...@datadirect.com> wrote:
>>Jason,
>>I recently made some changes to the SWIG files, but I haven't
>>regenerated the stub files because I am using the last official build
>>(1.3.29) instead of 1.3.30 that you are using. Could you refresh and
>>commit them?
>
>Sure. what changes did you make?

They are:
- make-xml-exception.i I added a 'static' keyword to the method 
definition (but probably is not needed; I got the error 'multiple 
implementation of method' when I was still trying to build a 
singleton DLL, before realizing that Perl needed 4 of them)
- includes.i and unicode.i now read PSVIUni.hpp from the Xerces 
sources, instead of the samples folder
- shadow.i was missing a new line at the end

I also changed the Perl scripts as ActivePerl 5.8 complained (scope 
of variable declarations, /dev/null instead of NUL, removal of 
several 'use blib' declarations).

Thanks,
Alberto 


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


Re: DOMLSParserFilter::acceptNode

Posted by Jason Stewart <ja...@gmail.com>.
Hey Alberto,

On 10/18/06, Alberto Massari <am...@datadirect.com> wrote:
> Jason,
> I recently made some changes to the SWIG files, but I haven't
> regenerated the stub files because I am using the last official build
> (1.3.29) instead of 1.3.30 that you are using. Could you refresh and
> commit them?
>

Sure. what changes did you make?

Cheers, jas.

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


Re: DOMLSParserFilter::acceptNode

Posted by Alberto Massari <am...@datadirect.com>.
Jason,
I recently made some changes to the SWIG files, but I haven't 
regenerated the stub files because I am using the last official build 
(1.3.29) instead of 1.3.30 that you are using. Could you refresh and 
commit them?

Thanks,
Alberto

At 14.05 18/10/2006 +0530, Jason Stewart wrote:
>Hey Alberto,
>
>On 10/16/06, Alberto Massari <am...@datadirect.com> wrote:
>
>>Yes; DOMLSParserFilter is allowed to change the node that has been
>>just created ("LSParserFilters provide applications the ability to
>>examine nodes as they are being constructed while parsing. As each
>>node is examined, it may be modified or removed, or the entire parse
>>may be terminated early"), while LSSerializerFilter is not.
>>Also, the specs explicitly say that LSSerializerFilter derives from
>>NodeFilter, but LSParserFilter has no parent class.
>
>ok. Thanks for making that clear.
>
>Cheers, jas.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
>For additional commands, e-mail: c-dev-help@xerces.apache.org


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


Re: DOMLSParserFilter::acceptNode

Posted by Jason Stewart <ja...@gmail.com>.
Hey Alberto,

On 10/16/06, Alberto Massari <am...@datadirect.com> wrote:

> Yes; DOMLSParserFilter is allowed to change the node that has been
> just created ("LSParserFilters provide applications the ability to
> examine nodes as they are being constructed while parsing. As each
> node is examined, it may be modified or removed, or the entire parse
> may be terminated early"), while LSSerializerFilter is not.
> Also, the specs explicitly say that LSSerializerFilter derives from
> NodeFilter, but LSParserFilter has no parent class.
>

ok. Thanks for making that clear.

Cheers, jas.

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


Re: DOMLSParserFilter::acceptNode

Posted by Alberto Massari <am...@datadirect.com>.
Hi Jason,

At 10.29 14/10/2006 +0530, Jason Stewart wrote:
>Hey all,
>
>I'm implementing perl proxy classes for the different DOM NodeFilter
>classes. I ran into an odd interface problem. Why does
>DOMLSParserFilter not inherit from DOMNodeFilter? It implements it's
>own acceptNode() method with a different signature.
>
>short
>DOMLSParserFilter::acceptNode (DOMNode* node);
>
>versus
>
>short
>DOMNodeFilter::acceptNode (const DOMNode* node) const;
>
>Why is the DOMLSParserFilter not a const method, and why is the node not
>a const pointer? Is this in the spec?

Yes; DOMLSParserFilter is allowed to change the node that has been 
just created ("LSParserFilters provide applications the ability to 
examine nodes as they are being constructed while parsing. As each 
node is examined, it may be modified or removed, or the entire parse 
may be terminated early"), while LSSerializerFilter is not.
Also, the specs explicitly say that LSSerializerFilter derives from 
NodeFilter, but LSParserFilter has no parent class.


>It doesn't cause any bugs - but it just looked odd.
>
>Cheers, jas.
>
>Hi all,
>
>I've looked at DOMLSSerializer::setNewLine() and by the spec there are
>only four supported values - but the value is not being checked in the
>implementation class, any value is accepted. Shouldn't we be checking
>the value and throwing and exception if a bogus value is specified?

This is what the spec say about LSSerializer::newLine: "The 
end-of-line sequence of characters to be used in the XML being 
written out. Any string is supported, but XML treats only a certain 
set of characters sequence as end-of-line (See section 2.11, 
"End-of-Line Handling" in [XML 1.0], if the serialized content is XML 
1.0 or section 2.11, "End-of-Line Handling" in [XML 1.1], if the 
serialized content is XML 1.1). Using other character sequences than 
the recommended ones can result in a document that is either not 
serializable or not well-formed)"
So, even if there are 4 combitations of \r and \n, the user is 
allowed to type in whatever she likes.

Ciao,
Alberto 


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