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 E. Stewart" <ja...@openinformatics.com> on 2002/11/13 05:55:57 UTC

why is getScanner() protected?

Hey All,

Some of my Perl tests are failing because getScanner() was made
protected. I'm not the only person that noticed this:

  http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9325

Why did this happen? What is the correct interface to get this
information now?

Cheers,
jas.

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


Re: why is getScanner() protected?

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Tinny Ng" <tn...@ca.ibm.com> writes:

> May we know why you need access to the Scanner?
> 
> The XMLScanner was designed as an internal class, where its API may be
> changed quite OFTEN.   So it is not recommended to use it directly.   May be
> there are some other interfaces that you can call to retrieve the same
> information.   For example the parser has getRootGrammar(),
> getGrammar(XMLCh* namespace), getURIText(unsigned int uriId) ... etc. which
> I believe will definitely help.

Hey Tinny,

These are good points. I would definately prefer not having to access
something as low-level as the Scanner.

Getting the grammar was one issue, so I'm glad there are better API's
for that.

The other thing that I had begun working on was using a SAX parser to
grab the underlying byte offsets for various events, so that I could
cache offsets into a large file and only retrieve data when I needed
it. To get the offsets I was doing something like:

  parser->getScanner->getSrcOffset();

This is not required by any means, but I believed it would be a
powerful technique for handling some of the very large XML files that
we're dealing with (>500Mb).

Cheers,
jas.

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


Re: why is getScanner() protected?

Posted by Tinny Ng <tn...@ca.ibm.com>.
Jason,

May we know why you need access to the Scanner?

The XMLScanner was designed as an internal class, where its API may be
changed quite OFTEN.   So it is not recommended to use it directly.   May be
there are some other interfaces that you can call to retrieve the same
information.   For example the parser has getRootGrammar(),
getGrammar(XMLCh* namespace), getURIText(unsigned int uriId) ... etc. which
I believe will definitely help.

Tinny


----- Original Message -----
From: "Jason E. Stewart" <ja...@openinformatics.com>
To: <xe...@xml.apache.org>
Sent: Tuesday, November 12, 2002 11:55 PM
Subject: why is getScanner() protected?


> Hey All,
>
> Some of my Perl tests are failing because getScanner() was made
> protected. I'm not the only person that noticed this:
>
>   http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9325
>
> Why did this happen? What is the correct interface to get this
> information now?
>
> Cheers,
> jas.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>


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


Re: why is getScanner() protected?

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

> Some of my Perl tests are failing because getScanner() was made
> protected. I'm not the only person that noticed this:
> 
>   http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9325
> 
> Why did this happen? What is the correct interface to get this
> information now?

Unless I hear otherwise, I'm planning on making the changes suggested
in 9325, and making these methods public again.

Cheers,
jas.

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