Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #34255
| Path | csiph.com!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | Arne Vajhøj <arne@vajhoej.dk> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: XQuery with Java resources |
| Date | Thu, 5 May 2016 10:47:09 -0400 |
| Organization | Aioe.org NNTP Server |
| Lines | 89 |
| Message-ID | <ngfmde$la3$1@gioia.aioe.org> (permalink) |
| References | <a9e71a9c-58d7-4f39-9ed1-a0d60b9b1772@googlegroups.com> <ng3h09$sts$1@dont-email.me> <ng8l7l$icp$1@dont-email.me> <ngcqob$4dm$2@gioia.aioe.org> <ngd07q$vnm$1@dont-email.me> <7f023e94-584a-404f-902d-644e9e53c559@googlegroups.com> <nge2o6$7uq$1@gioia.aioe.org> <e9e5daad-8552-45fb-929c-a60650b5471d@googlegroups.com> |
| NNTP-Posting-Host | ANasIS7Js9OyLQwgloeBLQ.user.gioia.aioe.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Complaints-To | abuse@aioe.org |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 |
| X-Notice | Filtered by postfilter v. 0.8.2 |
| Xref | csiph.com comp.lang.java.programmer:34255 |
Show key headers only | View raw
On 5/5/2016 9:06 AM, Eric Douglas wrote:
> On Wednesday, May 4, 2016 at 8:05:38 PM UTC-4, Arne Vajhøj wrote:
>> You will not benefit from an XML database for that.
>>
>> Your choices must be:
>>
>> you want to map between objects and XML files => use JAXB
>>
>> you just want to write and read XML files => use JAXP (DOM or SAX)
>> or StAX
>
> Right? Our application currently stores all data in flat mkeyed
> files
> (http://documentation.basis.com/BASISHelp/WebHelp/usr/mkeyed_files.htm).
>
> We have an in house tool outside the application which is only used
> by developers, but we want the data to be edited independently and
> shared by multiple developers (merge changes using SourceTree), so
> I'm thinking of moving the data for that tool, currently also in
> mkeyed format, to an XML format (so it appears as plain text for
> merge tools).
A merge tool would need to be XML aware to merge XML files.
But you certainly have a lot of tools to choose from when going XML.
> So I wanted to find the simplest, most logical way to access that
> file/record/field type data in XML. First is the question of do we
> simply store everything as tag data:
> <record><field1>value</field1></record> or is there a pratical reason
> for tag attributes: <record
> key="0001"><field1>value</field1></record> or is there anything else
> we should know about the data syntax to put in from the start so we
> don't have to rewrite a bunch of files?
The discussion about elements vs attributes is a classic discussion.
There are some objective guidance like:
- elements allow complex data aka sub elements, attributes do not
- elements allow repeats, attributes do not
- attributes takes much less space than elements
But then there is the more "what is the rigth way" aspects.
I would suggest:
- use elements for core data
- use attributes for auxiliary data
Example:
<address status="verified">
<street>bla bla bla</street>
<city>bla</city>
<zip>bla</zip>
</address>
Street, city and zip are the core of address.
That the address has been verified is just some second level additional
information about the address.
> Then there's the question do we need binding?
> https://docs.oracle.com/javase/tutorial/jaxb/intro/ os just the basic
> XML API? https://docs.oracle.com/javase/tutorial/jaxp/
As already stated then JAXB or not must depend on whether you
want to use object to XML file mapping or not.
> Then do we choose a model (SAX, DOM, or StAX?) or (can we have / do
> we want) multiple methods accessing the same XML data using different
> models for different reasons?
You can use different methods for different purposes. But it will
require your developers to be familiar with multiple methods.
I would tend to say:
* avoid SAX unless you need to parse large files very fast
* use StAX for very basic reading and writing
* use DOM in case you need advanced processing of XML
* consider one of the third party DOM's on top of standard W3C DOM
as they are often easier to use
> Getting back to the thread topic, would our use of XML for text data
> files for local application benefit from XQuery?
> https://docs.oracle.com/database/121/ADXDK/adx_j_xqj.htm#ADXDK99930
DOM and XPath should do it.
Arne
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
XQuery with Java resources Priya Mohan <mmpriya66@gmail.com> - 2016-04-30 08:28 -0700
Re: XQuery with Java resources Jeff Higgins <jeff@invalid.invalid> - 2016-05-01 00:01 +0000
Re: XQuery with Java resources Jeff Higgins <jeff@invalid.invalid> - 2016-05-01 19:50 +0000
Re: XQuery with Java resources Jeff Higgins <jeff@invalid.invalid> - 2016-05-02 22:44 +0000
Re: XQuery with Java resources Arne Vajhøj <arne@vajhoej.dk> - 2016-05-04 08:42 -0400
Re: XQuery with Java resources Jeff Higgins <jeff@invalid.invalid> - 2016-05-04 14:16 +0000
Re: XQuery with Java resources Eric Douglas <e.d.programmer@gmail.com> - 2016-05-04 07:31 -0700
Re: XQuery with Java resources Jeff Higgins <jeff@invalid.invalid> - 2016-05-04 17:34 +0000
Re: XQuery with Java resources Arne Vajhøj <arne@vajhoej.dk> - 2016-05-04 20:05 -0400
Re: XQuery with Java resources Eric Douglas <e.d.programmer@gmail.com> - 2016-05-05 06:06 -0700
Re: XQuery with Java resources Arne Vajhøj <arne@vajhoej.dk> - 2016-05-05 10:47 -0400
Re: XQuery with Java resources Arne Vajhøj <arne@vajhoej.dk> - 2016-05-04 20:01 -0400
Re: XQuery with Java resources Jeff Higgins <jeff@invalid.invalid> - 2016-05-05 21:08 +0000
Re: XQuery with Java resources Martin Gregorie <martin@address-in-sig.invalid> - 2016-05-05 10:50 +0000
csiph-web