Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xerces parser won't open file with brace in the name

Reply
Thread Tools

xerces parser won't open file with brace in the name

 
 
Andy Fish
Guest
Posts: n/a
 
      11-19-2003
Hi,

I am trying to parse a file using Xerces' DOMParser.parse(String systemId)

I have come across a problem where it refuses to open a file with curly
braces "{" or "}" in the file name. I just get a SAXException saying the
file does not exist

is it trying to do some kind of parameter substitution into the filename?

Andy


 
Reply With Quote
 
 
 
 
Steve W. Jackson
Guest
Posts: n/a
 
      11-19-2003
In article <VZKub.4789$(E-Mail Removed)>,
"Andy Fish" <(E-Mail Removed)> wrote:

>:Hi,
>:
>:I am trying to parse a file using Xerces' DOMParser.parse(String systemId)
>:
>:I have come across a problem where it refuses to open a file with curly
>:braces "{" or "}" in the file name. I just get a SAXException saying the
>:file does not exist
>:
>:is it trying to do some kind of parameter substitution into the filename?
>:
>:Andy
>:
>:


This isn't an issue with the parser. Try simply reading that same file
as a stream of bytes, for instance, and you should find that it's
something else. Solve it there and you'll be able to parse it. How
it's solved probably depends on language, OS, filesystem, etc.

= Steve =
--
Steve W. Jackson
Montgomery, Alabama
 
Reply With Quote
 
 
 
 
Richard Tobin
Guest
Posts: n/a
 
      11-19-2003
In article <VZKub.4789$(E-Mail Removed)>,
Andy Fish <(E-Mail Removed)> wrote:

>I have come across a problem where it refuses to open a file with curly
>braces "{" or "}" in the file name. I just get a SAXException saying the
>file does not exist


System identifiers are URIs, and "{" and "}" are among the characters
that have to be escaped when used in URIs. The parser *ought* to do
this for you, but I wouldn't be surprised if it doesn't. Try using
%7B instead of { and %7D instead of } to see if that's the problem.

-- Richard
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

FreeBSD rules!
 
Reply With Quote
 
Andy Fish
Guest
Posts: n/a
 
      11-19-2003
not so, I'm afraid. This works fine:

parser.parse (new InputSource(new FileInputStream(filename)));

but these do not:

parser.parse (new InputSource(filename));
parser.parse (filename);

Anyway, thanks for the idea. At least I have my workaround now

Andy

"Steve W. Jackson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)-berlin.de...
> In article <VZKub.4789$(E-Mail Removed)>,
> "Andy Fish" <(E-Mail Removed)> wrote:
>
> >:Hi,
> >:
> >:I am trying to parse a file using Xerces' DOMParser.parse(String

systemId)
> >:
> >:I have come across a problem where it refuses to open a file with curly
> >:braces "{" or "}" in the file name. I just get a SAXException saying the
> >:file does not exist
> >:
> >:is it trying to do some kind of parameter substitution into the

filename?
> >:
> >:Andy
> >:
> >:

>
> This isn't an issue with the parser. Try simply reading that same file
> as a stream of bytes, for instance, and you should find that it's
> something else. Solve it there and you'll be able to parse it. How
> it's solved probably depends on language, OS, filesystem, etc.
>
> = Steve =
> --
> Steve W. Jackson
> Montgomery, Alabama



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Functions inside Macro Curly brace krbyxtrm C++ 5 04-24-2006 11:49 AM
Searching for Kevin Brace (Graphic chip research information) Derek Simmons VHDL 1 03-31-2005 01:51 AM
why can't I pass a squiggly brace expression into a method call? Kevin Simonson Java 3 11-28-2004 12:07 PM
Upgrade of Xalan 1.2.2 and Xerces 1.4.4 to Xalan 2.6 and Xerces 2.6.2 cvissy XML 0 11-16-2004 07:06 AM
xerces parser won't open file with brace in the name Andy Fish Java 3 11-19-2003 08:21 PM



Advertisments