Call this, maybe:
private String zapSpace(String stringIn){
int length = stringIn.length();
int iChar = 0;
StringBuffer temp = new StringBuffer("");
while(iChar < length){
switch(stringIn.charAt(iChar)){
case ' ' : break;
default : temp.append(stringIn.charAt(iChar));
break;
}
iChar++;
}
return temp.toString();
}
"Heathcote, Guy" <[EMAIL PROTECTED]> on 07/19/2001 08:59:24 AM
Please respond to [EMAIL PROTECTED]
To: "'[EMAIL PROTECTED]'"
<[EMAIL PROTECTED]>
cc: (bcc: Barry Nobel/IN/FIS)
Subject: RE: My SAX character() Callback is introducing
spaces...
Barry,
Thanks. I started out using trim(), as you suggest. However, it wasn't
having the desired effect, as the extra spaces were in the middle of the
returned string, rather that at the beginning or end. I eventually moved
the trim() to elsewhere in the code, just to prove to myself that it wasn't,
itself, introducing the error.
Guy Heathcote
Ordnance Survey
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: 19 July 2001 13:49
To: [EMAIL PROTECTED]
Subject: RE: My SAX character() Callback is introducing spaces...
try (new String(ch,start,length).trim());
"Heathcote, Guy" <[EMAIL PROTECTED]> on 07/19/2001 05:58:02 AM
Please respond to [EMAIL PROTECTED]
To: "'[EMAIL PROTECTED]'"
<[EMAIL PROTECTED]>
cc: (bcc: Barry Nobel/IN/FIS)
Subject: RE: My SAX character() Callback is introducing
spaces...
Thanks Ian,
Sorry. The "length" parameter was indeed in a bad way - partly due to
initial confusion about the value returned (thus the name) and partly due to
some experimentation yesterday...
However, I've now changed the code back to it's usual state (as below) and
am still getting exactly the same problem.
public void characters(char[] ch, int start, int length) throws
SAXException
{
String thisText = new String(ch, start, length);
Guy Heathcote
Ordnance Survey
-----Original Message-----
From: Ian Roberts [mailto:[EMAIL PROTECTED]
Sent: 19 July 2001 10:08
To: [EMAIL PROTECTED]
Subject: Re: My SAX character() Callback is introducing spaces...
On Thu, 19 Jul 2001, Heathcote, Guy wrote:
> Code in the characters() callback is just:
>
> public void characters(char[] ch, int start, int end) throws
> SAXException
I think this is your problem - the parameters to characters are the
character array, the starting index, and the *length* of the chunk, not
the end index.
Ian
--
Ian Roberts, Software Engineer DecisionSoft Ltd.
Telephone: +44-1865-203192 http://www.decisionsoft.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
***************************************************************
This email/attachment(s) has been virus checked upon
receipt at the OS and is free of all known viruses.
***************************************************************
***************************************************************
For more information on Ordnance Survey products and services,
visit our web site at http://www.ordnancesurvey.co.uk
***************************************************************
---------------------------------------------------------------------
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]
***************************************************************
This email/attachment(s) has been virus checked upon
receipt at the OS and is free of all known viruses.
***************************************************************
***************************************************************
For more information on Ordnance Survey products and services,
visit our web site at http://www.ordnancesurvey.co.uk
***************************************************************
---------------------------------------------------------------------
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]