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

Discussion in 'XML' started by Andy Fish, Nov 19, 2003.

  1. Andy Fish

    Andy Fish Guest

    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
    Andy Fish, Nov 19, 2003
    #1
    1. Advertising

  2. In article <VZKub.4789$>,
    "Andy Fish" <> 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
    Steve W. Jackson, Nov 19, 2003
    #2
    1. Advertising

  3. In article <VZKub.4789$>,
    Andy Fish <> 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!
    Richard Tobin, Nov 19, 2003
    #3
  4. Andy Fish

    Andy Fish Guest

    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" <> wrote in message
    news:-berlin.de...
    > In article <VZKub.4789$>,
    > "Andy Fish" <> 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
    Andy Fish, Nov 19, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Derek Simmons
    Replies:
    1
    Views:
    535
    Derek Simmons
    Mar 31, 2005
  2. Andy Fish
    Replies:
    3
    Views:
    346
    Andy Fish
    Nov 19, 2003
  3. Kevin Simonson
    Replies:
    3
    Views:
    431
    Michael Borgwardt
    Nov 28, 2004
  4. cvissy
    Replies:
    0
    Views:
    600
    cvissy
    Nov 16, 2004
  5. krbyxtrm
    Replies:
    5
    Views:
    528
    krbyxtrm
    Apr 24, 2006
Loading...

Share This Page