Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #30513 > unrolled thread

Simplest (not fastest) Java XML API for small files?

Started by"Qu0ll" <Qu0llSixFour@gmail.com>
First post2014-12-09 08:38 +1100
Last post2015-01-22 09:10 -0800
Articles 6 — 5 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Simplest (not fastest) Java XML API for small files? "Qu0ll" <Qu0llSixFour@gmail.com> - 2014-12-09 08:38 +1100
    Re: Simplest (not fastest) Java XML API for small files? Jeff Higgins <jeff@invalid.invalid> - 2014-12-08 18:03 -0500
      Re: Simplest (not fastest) Java XML API for small files? Jeff Higgins <jeff@invalid.invalid> - 2015-01-21 10:06 -0500
    Re: Simplest (not fastest) Java XML API for small files? Arne Vajhøj <arne@vajhoej.dk> - 2014-12-08 18:12 -0500
    Re: Simplest (not fastest) Java XML API for small files? Aroh Sunday <asmelitus@gmail.com> - 2014-12-23 05:24 -0800
    Re: Simplest (not fastest) Java XML API for small files? kimball.robinson@gmail.com - 2015-01-22 09:10 -0800

#30513 — Simplest (not fastest) Java XML API for small files?

From"Qu0ll" <Qu0llSixFour@gmail.com>
Date2014-12-09 08:38 +1100
SubjectSimplest (not fastest) Java XML API for small files?
Message-ID<m655s3$m2e$1@speranza.aioe.org>
I have to say I am a little overwhelmed with the number of different XML 
APIs available for Java; some built-in to the Java platform and of course 
multiple 3rd-party options.

What I am trying to do now is find the simplest XML API that allows me to 
load small XML documents, edit them (i.e. change a few attributes etc.) and 
then save them again.  That's all.  The XML files are just configuration 
files and will be no larger than a few KB at most.

The key for me is simplicity of use of the API.  I have seen some APIs where 
you have to go searching through nodes, sub-nodes and attributes and 
ignoring nulls or irrelevant attributes etc. when what I really want to be 
able to do is given node 'A', give me the value of attribute 'abc' and then 
let me traverse the document down through the children of 'A'.  Then when I 
have finished, just save the whole XML document.

Any suggestions?  I'd prefer to keep in the JDK if possible just to avoid 
any further dependencies but that is not critical.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@gmail.com
[Replace the "SixFour" with numbers to email me] 

[toc] | [next] | [standalone]


#30515

FromJeff Higgins <jeff@invalid.invalid>
Date2014-12-08 18:03 -0500
Message-ID<m65aq6$9mf$1@dont-email.me>
In reply to#30513
On 12/08/2014 04:38 PM, Qu0ll wrote:
> I have to say I am a little overwhelmed with the number of different XML
> APIs available for Java; some built-in to the Java platform and of
> course multiple 3rd-party options.
>
> What I am trying to do now is find the simplest XML API that allows me
> to load small XML documents, edit them (i.e. change a few attributes
> etc.) and then save them again.  That's all.  The XML files are just
> configuration files and will be no larger than a few KB at most.
>
> The key for me is simplicity of use of the API.  I have seen some APIs
> where you have to go searching through nodes, sub-nodes and attributes
> and ignoring nulls or irrelevant attributes etc. when what I really want
> to be able to do is given node 'A', give me the value of attribute 'abc'
> and then let me traverse the document down through the children of 'A'.
> Then when I have finished, just save the whole XML document.
>
> Any suggestions?  I'd prefer to keep in the JDK if possible just to
> avoid any further dependencies but that is not critical.
>
In the jdk what do you have dom, sax, stax, jaxb ???
A search for java configuration file parser library brings up
some stuff Commons Configuration among them.
StAX seems simplest to me. Depends on what you want to do.


[toc] | [prev] | [next] | [standalone]


#30766

FromJeff Higgins <jeff@invalid.invalid>
Date2015-01-21 10:06 -0500
Message-ID<m9ofe3$d4t$1@dont-email.me>
In reply to#30515
On 12/08/2014 06:03 PM, Jeff Higgins wrote:
> On 12/08/2014 04:38 PM, Qu0ll wrote:
>> I have to say I am a little overwhelmed with the number of different XML
>> APIs available for Java; some built-in to the Java platform and of
>> course multiple 3rd-party options.
>>
>> What I am trying to do now is find the simplest XML API that allows me
>> to load small XML documents, edit them (i.e. change a few attributes
>> etc.) and then save them again.  That's all.  The XML files are just
>> configuration files and will be no larger than a few KB at most.
>>
>> The key for me is simplicity of use of the API.  I have seen some APIs
>> where you have to go searching through nodes, sub-nodes and attributes
>> and ignoring nulls or irrelevant attributes etc. when what I really want
>> to be able to do is given node 'A', give me the value of attribute 'abc'
>> and then let me traverse the document down through the children of 'A'.
>> Then when I have finished, just save the whole XML document.
>>
>> Any suggestions?  I'd prefer to keep in the JDK if possible just to
>> avoid any further dependencies but that is not critical.
>>
> In the jdk what do you have dom, sax, stax, jaxb ???
> A search for java configuration file parser library brings up
> some stuff Commons Configuration among them.
> StAX seems simplest to me. Depends on what you want to do.
>
>
>
I just ran across this configuration management tool.
I think it looks very sensible.
I will attempt to replace configuration management
in a current project with this.

OWNER Java™ properties reinvented.
<http://owner.aeonbits.org/>
Get rid of the boilerplate code in properties based configuration.
Simple Powerful Flexible

I am not associated with the OWNER project.

[toc] | [prev] | [next] | [standalone]


#30516

FromArne Vajhøj <arne@vajhoej.dk>
Date2014-12-08 18:12 -0500
Message-ID<54863064$0$291$14726298@news.sunsite.dk>
In reply to#30513
On 12/8/2014 4:38 PM, Qu0ll wrote:
> I have to say I am a little overwhelmed with the number of different XML
> APIs available for Java; some built-in to the Java platform and of
> course multiple 3rd-party options.
>
> What I am trying to do now is find the simplest XML API that allows me
> to load small XML documents, edit them (i.e. change a few attributes
> etc.) and then save them again.  That's all.  The XML files are just
> configuration files and will be no larger than a few KB at most.
>
> The key for me is simplicity of use of the API.  I have seen some APIs
> where you have to go searching through nodes, sub-nodes and attributes
> and ignoring nulls or irrelevant attributes etc. when what I really want
> to be able to do is given node 'A', give me the value of attribute 'abc'
> and then let me traverse the document down through the children of 'A'.
> Then when I have finished, just save the whole XML document.
>
> Any suggestions?  I'd prefer to keep in the JDK if possible just to
> avoid any further dependencies but that is not critical.

In my experience DOM and XPath is the easiest way to read XML in
most cases.

Maybe wrap JDOM around W3C DOM if you prefer that.

Arne


[toc] | [prev] | [next] | [standalone]


#30611

FromAroh Sunday <asmelitus@gmail.com>
Date2014-12-23 05:24 -0800
Message-ID<ec5f9f7a-dedc-4d6d-a054-ad9352239d8b@googlegroups.com>
In reply to#30513
 
Sir,i'm working on an enterprise JEE application that makes use of dtree javascrpit API.the menu and menuitems that represent the parent and chlid node are stored as a table in sql server database.i found it difficult to load jsp pages whenever i clicked the child node.please I need your help.i  appreciate.thanks

[toc] | [prev] | [next] | [standalone]


#30803

Fromkimball.robinson@gmail.com
Date2015-01-22 09:10 -0800
Message-ID<6c30102a-17c5-4c8e-aba6-ff7784e4b0ab@googlegroups.com>
In reply to#30513
It depends on what you are familiar with, and what you want to do.  I have used JSOUP to parse xml files, even though it's aimed primarily at HTML.  I have to jump through some hoops to make it work, but it gives me the freedom to use css-like selectors a la jquery to find xml elements and attributes, and then traverse the tree.  It does seem to have a couple quirks and bugs, but I feel like it simplifies DOM tree navigation and modification enough to make it worthwhile. 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web