Tricky Java/XML problem

  • Thread starter Stephen Marjoribanks
  • Start date
S

Stephen Marjoribanks

I have written a Java application which opens an XML file and displays
the data within it in a GUI. For a couple of the elements in my XML
files it is necessary to use XLink attributes so as to specifiy
whereabouts the data was obtained from (ie. another XML file but within
the same local directory). You can think of it as a sort of audit trail,
whereby an 'interpreted' data value must have a link back to the 'raw'
data value it was obtained from. For example a single number in the
'interpreted' file might be obtained by averaging 5 numbers in the 'raw'
XML file. It is necessary to use XPointers so that a user can easily
see where the averaged value was obtained from.

So, in my Java application I have extracted all the data from the
interpreted data file and now want to be able to allow the user to
choose to open the raw data file to view where the interpretations have
been made using the XLink provided in the raw data file. This is the bit
I am stuck on!
If the files are accessed from over the web then I thought I could
relatively easily open a file from the URI part of the XPointer
expression. The maybe I could use Jaxen or similar to navigate my way to
the correct part of the file using Jaxen or similar, how realistic do
you think this is (bearing in mind im a relative newbie!). If both files
are within the same directory on a users hard drive then presumably I
can locate the raw data file by setting a systemID on the file opened by
the user and then using relative paths to locate the desired file?

Sorry this is a bit of a rambling question, but I'm still trying to
figure out exactly what it is I need to do and the best way to go about it.
Basically my question boils down to: What is the best way to process an
XPointer statement from an XML document within Java so the target
element of the XPointer, within another file, can be opened and viewed
by the user? Is this possible, are there any obvious ways of doing it,
and will it take me ages?!

Many thanks, sorry again for the vague-ish question!

Steve
 
S

Stephen Marjoribanks

Stephen said:
I have written a Java application which opens an XML file and displays
the data within it in a GUI. For a couple of the elements in my XML
files it is necessary to use XLink attributes so as to specifiy
whereabouts the data was obtained from (ie. another XML file but within
the same local directory). You can think of it as a sort of audit trail,
whereby an 'interpreted' data value must have a link back to the 'raw'
data value it was obtained from. For example a single number in the
'interpreted' file might be obtained by averaging 5 numbers in the 'raw'
XML file. It is necessary to use XPointers so that a user can easily
see where the averaged value was obtained from.

So, in my Java application I have extracted all the data from the
interpreted data file and now want to be able to allow the user to
choose to open the raw data file to view where the interpretations have
been made using the XLink provided in the raw data file. This is the bit
I am stuck on!
If the files are accessed from over the web then I thought I could
relatively easily open a file from the URI part of the XPointer
expression. The maybe I could use Jaxen or similar to navigate my way to
the correct part of the file using Jaxen or similar, how realistic do
you think this is (bearing in mind im a relative newbie!). If both files
are within the same directory on a users hard drive then presumably I
can locate the raw data file by setting a systemID on the file opened by
the user and then using relative paths to locate the desired file?

Sorry this is a bit of a rambling question, but I'm still trying to
figure out exactly what it is I need to do and the best way to go about it.
Basically my question boils down to: What is the best way to process an
XPointer statement from an XML document within Java so the target
element of the XPointer, within another file, can be opened and viewed
by the user? Is this possible, are there any obvious ways of doing it,
and will it take me ages?!

Many thanks, sorry again for the vague-ish question!

Steve

No-one?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,001
Messages
2,570,254
Members
46,850
Latest member
VMRKlaus8

Latest Threads

Top