Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old February 28th, 2006, 08:45 AM
Tobias.Bischof@gmail.com
Guest
 
Posts: n/a
Default XML schema location

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!

  #2  
Old February 28th, 2006, 08:55 AM
George Bina
Guest
 
Posts: n/a
Default Re: XML schema location

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

  #3  
Old February 28th, 2006, 01:25 PM
Joe Kesselman
Guest
 
Posts: n/a
Default Re: XML schema location

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
  #4  
Old February 28th, 2006, 01:25 PM
Joe Kesselman
Guest
 
Posts: n/a
Default Re: XML schema location

.... 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
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles