You are viewing a plain text version of this content. The canonical link for it is here.
Posted to p-dev@xerces.apache.org by "Jason E. Stewart" <ja...@openinformatics.com> on 2001/03/08 00:29:58 UTC

SWIG 1.3 in CVS

Hey All,

So I made a branch of the CVS tree to play around with getting SWIG
1.3 to work. It turns out that most of the issues were hard-coded
namespace assumptions in postModule.pl. Once I fixed those I got some
of the tests working. 

The following pass:
  FileInputSource.t
  MemoryInputSource.t
  StdInInputSource.t
  URLInputSource.t

The following fail:
   LocalFileInputSource.t
   MemBufInputSource.t
   actualCast.t
   domTest.t
   perlErrorHandler.t

MemBufInputSource.t fails due to the following:
t/MemBufInputSource.Usage: new_MemBufInputSource(srcDocBytes,byteCount,bufId,adoptBuffer); at blib/lib/Xerces.pm line 2426.

All the rest fail because of LocalFileInputSource:
t/actualCast........Type error in argument 1 of new_LocalFileInputSource. Expected _p_q_const__XMLCh at blib/lib/Xerces.pm line 2396.

It seems that we're passing it an normal perl string and it wants an
XMLCh*

If any of you hardy souls want to check out the branch, here's how:

1) You want this in a different place than your 1.1 version, so cd
   into some other directory
2) cvs -d :pserver:anoncvs@xml.apache.org:/home/cvspublic co -r Rel-1_3-SWIG-1_3 xml-xerces/perl

the '-r' flag to checkout tells it to use a tag to extract a specific
snapshot. And 'Rel-1_3-SWIG-1_3' is the tag I gave to my branch. 

TODO:
=====
1) Fix remaining problems so that all tests compile
2) Switch to XML::Xerces namespace
3) Port sample applications to new interface

jas.



Re: SWIG 1.3 in CVS (please, no!)

Posted by "Harmon S. Nine" <hn...@netarx.com>.
Jason --

I just downloaded SWIG 1.3 for linux.  It looks like it's got some great 
new features.
It's also *really* alpha.  It built fine, but I had to mung some of the 
code to get "make check"
to work.

As for its interaction with the Xerces-perl build, it appears to totally 
ignore the typemaps in
Xerces.i, e.g. the one that converts perl-strings to DOMStrings.  Thus 
when strings are
passed to functions like "createElement," the module complains that 
they're not
DOMStrings, which accounts for one of the errors below.

Also, granted SWIG 1.3 is ignoring the typemaps, it does not pass 
arguments into the
perlErrorHandler properly, accounting for the segmentation faults.

Incorporating SWIG 1.3 into a xerces-perl build at the current time 
looks like a major
headache.  IMHO, a build of xerces-perl for SWIG 1.3 should be shelved 
until it is more
stable and there are docs that specify how to get it to use the 
typemaps, etc.

In the mean time, I'll take a crack at munging 
postSource.pl/postModule.pl to get them to
change the package name to XML::Xerces.

-- Harmon


Jason E. Stewart wrote:

> "Jason E. Stewart" <ja...@openinformatics.com> writes:
> 
> 
>> The following fail:
>>    LocalFileInputSource.t
>>    MemBufInputSource.t
>>    actualCast.t
>>    domTest.t
>>    perlErrorHandler.t
>> 
>> MemBufInputSource.t fails due to the following:
>> t/MemBufInputSource.Usage: new_MemBufInputSource(srcDocBytes,byteCount,bufId,adoptBuffer); at blib/lib/Xerces.pm line 2426.
>> 
>> All the rest fail because of LocalFileInputSource:
>> t/actualCast........Type error in argument 1 of new_LocalFileInputSource. Expected _p_q_const__XMLCh at blib/lib/Xerces.pm line 2396.
> 
> So part of the problem were the typemaps in Xerces.i, they didn't
> handle const pointers, so I modified the ones for LocalFileInputSource
> and MemBufInputSource. 
> 
> Now LocalFileInputSource.t works, but MemBufInputSource.t still
> fails...
> 
> actualCast now fails for a different reason:
> 
> t/actualCast........Type error in argument 2 of DOM_Document_getElementsByTagName. Expected Xerces::DOMString at blib/lib/Xerces.pm line 846.
> 
> as does domTest:
> 
> t/domTest...........Can't locate object method "createXMLDecl" via package "DOM_Document::createDocument" at testscript.pl line 32.
> 
> perlErrorHandler.t is a bit scary, because it segfaults on the call to
> $dom->parse() due to the error in the XML, if I fix the error the test
> runs fine. That means the C code is crapping out in the error handling
> routines.
> 
> jas.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-p-dev-help@xml.apache.org
> 
> 




Re: SWIG 1.3 in CVS

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Jason E. Stewart" <ja...@openinformatics.com> writes:

> "Jason E. Stewart" <ja...@openinformatics.com> writes:
> 
> > The following fail:
> >    LocalFileInputSource.t
> >    MemBufInputSource.t
> >    actualCast.t
> >    domTest.t

domTest.t now runs successfully. Turns out it was a namespace typo. 3 left...

jas.

Re: SWIG 1.3 in CVS

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Harmon S. Nine" <hn...@netarx.com> writes:

> How are you getting the SWIG 1.3 typemaps to work?  I tried them on Linux,
> and it seemed to totally ignore them.  Could you send me your latest 
> Xerces.i?

Hmmm... I didn't have to do anything special. I think the real problem
was that SWIG started handling const properly, and so all the typemaps
were set up for 'DOMString *' and not 'const DOMString *'. As soon as
I changed that it worked fine. Likewise for the 'XMLCh *'
typemaps. 

I'll include the .i file in the email, or you can checkout the branch
I created for SWIG 1.3 directly.

To check out the SWIG-1_3 stuff from CVS, you just need to checkout
the branch that I created for it. Currently the main branch is your
code using SWIG 1.1, and I added a branch so that I (and others) could
get things working with SWIG 1.3 without disturbing your working
code. 

Dealing with branches in CVS are pretty straight-forward, you just let
CVS know when you do a checkout that you want a particular branch and
not the main branch by using the '-r' flag to checkout:

If you want to access it via anonymous CVS, first login (you only need
to do this once, as CVS stores the password local on your hard drive):

cvs -d :pserver:anoncvs@xml.apache.org:/home/cvspublic login
(Logging in to anoncvs@xml.apache.org)
CVS password: anoncvs

and then to checkout the branch:

cvs -d :pserver:anoncvs@xml.apache.org:/home/cvspublic co -r Rel-1_3-SWIG-1_3 xml-xerces/perl

<private note to harmon>
Harmon, since you've got commit access, you don't need to use the
:pserver:, you can just access CVS via your account at apache:

cvs -d hnine@locus.apache.org:/home/cvs co -r Rel-1_3-SWIG-1_3 xml-xerces/perl

It will prompt you for a password if you haven't set up RSA key
authentication. That way you can checkin any modifications you
make. Or you can just use anoncvs and send patch files, and I can
commit the changes.
</private note to harmon>

jas.



Re: SWIG 1.3 in CVS

Posted by "Harmon S. Nine" <hn...@netarx.com>.
Jason --

How are you getting the SWIG 1.3 typemaps to work?  I tried them on Linux,
and it seemed to totally ignore them.  Could you send me your latest 
Xerces.i?

-- Harmon


Jason E. Stewart wrote:

> "Jason E. Stewart" <ja...@openinformatics.com> writes:
> 
> 
>> "Jason E. Stewart" <ja...@openinformatics.com> writes:
>> 
>> 
>>> The following fail:
>>>    LocalFileInputSource.t
>>>    MemBufInputSource.t
>>>    actualCast.t
>>>    domTest.t
>>>    perlErrorHandler.t
>>> 
>>> MemBufInputSource.t fails due to the following:
>>> t/MemBufInputSource.Usage: new_MemBufInputSource(srcDocBytes,byteCount,bufId,adoptBuffer); at blib/lib/Xerces.pm line 2426.
>>> 
>>> All the rest fail because of LocalFileInputSource:
>>> t/actualCast........Type error in argument 1 of new_LocalFileInputSource. Expected _p_q_const__XMLCh at blib/lib/Xerces.pm line 2396.
>> 
>> So part of the problem were the typemaps in Xerces.i, they didn't
>> handle const pointers, so I modified the ones for LocalFileInputSource
>> and MemBufInputSource. 
> 
> Found another typemap problem, this time for 'const DOMString&'. 
> Changed it to mimic the DOMString*. Unfortunately, this didn't fix any
> tests...
> 
> jas.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-p-dev-help@xml.apache.org
> 
> 




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


Re: SWIG 1.3 in CVS

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Jason E. Stewart" <ja...@openinformatics.com> writes:

> "Jason E. Stewart" <ja...@openinformatics.com> writes:
> 
> > The following fail:
> >    LocalFileInputSource.t
> >    MemBufInputSource.t
> >    actualCast.t
> >    domTest.t
> >    perlErrorHandler.t
> > 
> > MemBufInputSource.t fails due to the following:
> > t/MemBufInputSource.Usage: new_MemBufInputSource(srcDocBytes,byteCount,bufId,adoptBuffer); at blib/lib/Xerces.pm line 2426.
> > 
> > All the rest fail because of LocalFileInputSource:
> > t/actualCast........Type error in argument 1 of new_LocalFileInputSource. Expected _p_q_const__XMLCh at blib/lib/Xerces.pm line 2396.
> 
> So part of the problem were the typemaps in Xerces.i, they didn't
> handle const pointers, so I modified the ones for LocalFileInputSource
> and MemBufInputSource. 

Found another typemap problem, this time for 'const DOMString&'. 
Changed it to mimic the DOMString*. Unfortunately, this didn't fix any
tests...

jas.

Re: SWIG 1.3 in CVS

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Jason E. Stewart" <ja...@openinformatics.com> writes:

> The following fail:
>    LocalFileInputSource.t
>    MemBufInputSource.t
>    actualCast.t
>    domTest.t
>    perlErrorHandler.t
> 
> MemBufInputSource.t fails due to the following:
> t/MemBufInputSource.Usage: new_MemBufInputSource(srcDocBytes,byteCount,bufId,adoptBuffer); at blib/lib/Xerces.pm line 2426.
> 
> All the rest fail because of LocalFileInputSource:
> t/actualCast........Type error in argument 1 of new_LocalFileInputSource. Expected _p_q_const__XMLCh at blib/lib/Xerces.pm line 2396.

So part of the problem were the typemaps in Xerces.i, they didn't
handle const pointers, so I modified the ones for LocalFileInputSource
and MemBufInputSource. 

Now LocalFileInputSource.t works, but MemBufInputSource.t still
fails...

actualCast now fails for a different reason:

t/actualCast........Type error in argument 2 of DOM_Document_getElementsByTagName. Expected Xerces::DOMString at blib/lib/Xerces.pm line 846.

as does domTest:

t/domTest...........Can't locate object method "createXMLDecl" via package "DOM_Document::createDocument" at testscript.pl line 32.

perlErrorHandler.t is a bit scary, because it segfaults on the call to
$dom->parse() due to the error in the XML, if I fix the error the test
runs fine. That means the C code is crapping out in the error handling
routines.

jas.