473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Referencing a second XML within a JAR

Hi

I am using XML to persist Java objects (with XStream). I have a general
leak of knowledge how ENTITY references within a XML can point to
another XML in a JAR. I.e. the following XML would reference a file
called file1.xml in the same directory:

<?xml version='1.0'?>
<!DOCTYPE root [ <!ENTITY file1 SYSTEM "file1.xml"> ]>
<root id="0">
&file1;
...
</root>

But I do not have both files in the same directory. Instead they are
located in different JARs. Do you know how to address an XML in a JAR?
Can I use kind of an absolute link like

<!DOCTYPE root [ <!ENTITY file1 SYSTEM
"/my/package/in/a/jar/file1.xml"> ]>

to point to the jared external XML. Any idea would be highly
appreciated.

Cheers
Daniel Frey

Feb 10 '06 #1
1 1249
Daniel Frey wrote:
Do you know how to address an XML in a JAR?


XML doesn't understand the concept of jarfiles. All it works with is
URIs. So there's no guaranteed portable solution.

Many (not all) XML processors will let you plug in an "entity resolver"
or "uri resolver", which is code you've written to describe where and
how they should try to search when attempting to retrieve additional
information. If you write one that understands which jarfiles you want
to search, and how to do that search and pull the data out of them, that
will do what you want.

*SOME* processors may have this kind of capability built in -- I've seen
a few programs that understand URIs starting with jar: as requests to
retrieve one entry from a jarfile -- but you'd have to check the docs
for your program.

There may be other solutions -- but again, that's going to be a matter
of exactly what your software supports. And if you can't make it work
with your tools, you may have to either change tools or do something
different.
Feb 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Dave Martin | last post by:
I've successfully used CURL to maneuver around and through sites but a new site I've been trying to work with has got me stumped. To retrieve the data I'm trying to get a login is required. If...
11
by: Milind | last post by:
Hi, I was trying to implement a composition relation, somthing of the following type: class A { public: class B {
5
by: Mark Friedman | last post by:
Does anyone know how to reference a subcontrol of a UserControl within client-side script. For example, if I have a TextBox as one of the elements of my UserControl with an id of "MyTextBox", how...
6
by: Mikey_Doc | last post by:
Hi We are running cms 2002, Framework 1.0 with Visual studio 2002. We have just upgraded to Framework 1.1 and visual studio 2003. All of our database connection strings are stored within the...
3
by: Lyners | last post by:
I have a table within a cell of a datagrid. I am doing updates without postback to the server using Javascript. I have everything working, except referencing a table within the datagrid cell. ...
3
by: gary | last post by:
Hi, I am trying to reference an anchor in a user control with a url. This worked in 1.1 but no longer works in 2.0. The ascx control is located in a "/include" folder If you have a...
1
by: Tim F | last post by:
Problem: I'm receiving the error "File or assembly name XXXXX or one of its dependencies, was not found." when trying to execute code in an assmebly that has both a strong-name and has been...
2
by: Andrus | last post by:
I need compile in-memory assembly which references to other in-memory assembly. Compiling second assembly fails with error Line: 0 - Metadata file 'eed7li9m, Version=0.0.0.0, Culture=neutral,...
1
by: Tom | last post by:
My unsigned DLL works in my project that references it as long as I set Copy Local = true. Now I have signed the DLL with the sn.exe generated keys but have not yet moved the DLL into the GAC. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.