XML schema location

Discussion in 'XML' started by Tobias.Bischof@gmail.com, Feb 28, 2006.

  1. Guest

    Hi,

    i'm using xerces2 to deal with XML files my JAVA app stores data in.
    Now i have my schema located in %program-path%/resources but want to be
    free to store my XML files wherever i want and also don't want to
    hard-code %program-path%/resources into the XML file.

    I think Xerces looks in the Java-Classpath for the schema but this
    didn't work..

    Is there any way to tell Xerces where to look for the schema at
    runtime?

    Thanks alot!
    , Feb 28, 2006
    #1
    1. Advertising

  2. George Bina Guest

    Hi,

    The best solution is to use a catalog to map from the schema locations
    from your file to actual locak schema documents. Xerces supports XML
    Catalogs, see http://xerces.apache.org/xerces2-j/faq-xcatalogs.html
    Another possibility is to set your own entity resolver and resolve the
    document locations to the actual documents.

    Best Regards,
    George
    ---------------------------------------------------------------------
    George Cristian Bina
    <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
    http://www.oxygenxml.com
    George Bina, Feb 28, 2006
    #2
    1. Advertising

  3. To specify your own search algorithm, write and plug in an Entity
    Resolver. (I believe that's used for schemas as well.) See the Xerces
    docs for details.

    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
    Joe Kesselman, Feb 28, 2006
    #3
  4. .... Or URI Resolver. (I've forgotten whether both are supported or if
    there was a namechange in that interface; should be easy to check.)

    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
    Joe Kesselman, Feb 28, 2006
    #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. Markus
    Replies:
    1
    Views:
    1,530
    Markus
    Nov 23, 2005
  2. Fred Smith
    Replies:
    1
    Views:
    943
    Martin Honnen
    Feb 5, 2004
  3. Hari Om
    Replies:
    1
    Views:
    461
    Martin SChukrazy
    Mar 2, 2004
  4. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,251
    Stanimir Stamenkov
    Apr 25, 2005
  5. Replies:
    3
    Views:
    2,835
Loading...

Share This Page