Ok,
so using the new stuff that is in CVS and that got me to my next bug, of
course!
here is the updated version:
#!/usr/bin/perl -w
use strict;
use XML::Xerces;
use Getopt::Long;
use vars qw($opt_v $opt_n);
my $USAGE = <<EOU;
USAGE: $0 xmlfilename
EOU
my $VERSION = q[$Id: SEnumVal.pl,v 1.1 2002/02/16 12:12:12 johnu Exp $ ];
die $USAGE unless scalar @ARGV;
my $xmlfile = $ARGV[0];
-f $xmlfile or die "File '$xmlfile' doesnt exist!\n";
my $saxParser = XML::Xerces::SAXParser->new();
my $handler = XML::Xerces::PerlErrorHandler->new();
$saxParser->setValidationScheme($XML::Xerces::SAXParser::Val_Always);
$saxParser->setDoSchema(1);
$saxParser->setDoNamespaces(1);
$saxParser->setErrorHandler($handler);
$saxParser->parse(XML::Xerces::LocalFileInputSource->new($xmlfile));
die "Errors Occurred\n" if($saxParser->getErrorCount());
die "Non schema Doc, no output available\n"
if(!$saxParser->getValidator()->handlesSchema());
die "Non schema grammar, no output available\n"
if( $saxParser->getValidator()->getGrammar()->getGrammarType() !=
$XML::Xerces::Grammar::SchemaGrammarType );
my $grammar = $saxParser->getValidator()->getGrammar();
print "GRAMMAR: $grammar\n";
my $elemEnum = $grammar->getElemEnumerator();
here is the error:
bash-2.04$ ./SEnumval.pl
../../Compile/XML-Xerces-1.6.0_0/samples/personal-schema.xml
GRAMMAR: XML::Xerces::Grammar=HASH(0x8103790)
Can't locate auto/XML/Xerces/Grammar/getElemEnum.al in @INC (@INC
contains: /usr/local/lib/perl5/5.6.1/i686-linux /usr/local/lib/perl5/5.6.1
/usr/local/lib/perl5/site_perl/5.6.1/i686-linux
/usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl .) at
./SEnumval.pl line 43
so, i went to work flexing my SWIG muscles. I grepped for the
implementation of getElemEnumerator and found 2 of them, one for Schema
and one for DTD's. So i included them both at the top and the bottom:
#include "validators/DTD/DTDGrammar.hpp"
#include "validators/schema/SchemaGrammar.hpp"
<....>
// support schema content model parsing
%include "validators/DTD/DTDGrammar.hpp"
%include "validators/schema/SchemaGrammar.hpp"
and then i installed the latest version of swig via perl -e -MCPAN
and i set XERCES_DEVEL in my environment;
but i can build anything because it now wants preSwig.pl
bash-2.04$ make
preSwig.pl --directory ./Xerces_headers
/usr/local/include/xerces/framework/StdInInputSource.hpp
make: preSwig.pl: Command not found
make: *** [Xerces_headers/framework/StdInInputSource.hpp] Error 127
so, whither preSwig.pl?
On 21 Feb 2002, (Jason E. Stewart) wrote:
> "John Utz" <[EMAIL PROTECTED]> writes:
>
> > i think that the deal is that the first one will be hard and you'll
> > need to talk me thru it, but after that it should make sense.
> >
> > i noted with interest the speed in which you fixed the issue when i raised
> > it yesterday....
>
> I'll be happy to do that. Plus if we have the conversation on the
> list, it's archived and other folks can do it as well...
>
> > ps: now, what's *really* gonna suck is getting this ported to win32.
> >
> > that is where i have to ultimately run this thing. i am pretty concerned
> > about that because i cant get any answer from the guy that was allegedly
> > porting xerces-c to cygwin.
>
> Ilya Sterin has been working on a straight win32 port using VC++. He's
> the one to bug.
>
> jas.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]