This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 8 - Pages: 1 - Last Post: 2 Jan 26, 11:57 Last Post By: davidekholm
wiener30

Posts: 22
Registered: 8-Sep-2009
What is the simplest way to parse xml-file?
Posted: 27 Dec 25, 15:20
 
  Click to reply to this thread Reply
It seems the groovy libraries
groovy.xml.XmlParser
groovy.xml.XmlSlurper

are missing in jAlbum.
RobM

Posts: 3,952
Registered: 4-Aug-2006
Re: What is the simplest way to parse xml-file?
Posted: 27 Dec 25, 21:37   in response to: wiener30 in response to: wiener30
 
  Click to reply to this thread Reply
I don't recall the Groovy XML parser being included previously. You could use javax xml parsers to parse an xml file. Or wait to see what David has to say about incorporating the Groovy XML Parser (import groovy.xml.XmlParser)
davidekholm

Posts: 3,939
Registered: 18-Oct-2002
Re: What is the simplest way to parse xml-file?
Posted: 29 Dec 25, 20:12   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
We're never included the Groovy xml parser. Is it superior to the ordinary xml parser?
RobM

Posts: 3,952
Registered: 4-Aug-2006
Re: What is the simplest way to parse xml-file?
Posted: 29 Dec 25, 20:23   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
We're never included the Groovy xml parser. Is it superior to the ordinary xml parser?
I’ve only used the Java XML parser and then only for relatively simple things. All I’ve read about it is in Groovy 5 it is no longer in the util module. Maybe the OP can give a reason for needing the Groovy parser.
wiener30

Posts: 22
Registered: 8-Sep-2009
Re: What is the simplest way to parse xml-file?
Posted: 30 Dec 25, 13:00   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Now I am using Java xml-parser, but it is quite complex, requires multiple libraries and multiple declarations.

I have seen examples on web of using groovy libraries, these looked to me much more simple. Because jAlbum uses extensively xml-files, I thought may be there are more simple solutions.
davidekholm

Posts: 3,939
Registered: 18-Oct-2002
Re: What is the simplest way to parse xml-file?
Posted: 30 Dec 25, 13:55   in response to: wiener30 in response to: wiener30
 
  Click to reply to this thread Reply
wiener30 wrote:
Now I am using Java xml-parser, but it is quite complex, requires multiple libraries and multiple declarations.

I have seen examples on web of using groovy libraries, these looked to me much more simple. Because jAlbum uses extensively xml-files, I thought may be there are more simple solutions.


Can I ask what XML you're planning on parsing? jAlbum's XML files (.info) files are better handled via jAlbum's APIs. jAlbum also uses .json these days, and the classic .properties format.
wiener30

Posts: 22
Registered: 8-Sep-2009
Re: What is the simplest way to parse xml-file?
Posted: 30 Dec 25, 21:01   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
I am deliberating to parse
<image>.jpg.info

files in order to extract coordinates of the text entered on the image.
If succeeded, I would use html/css to create a hotspot to dynamically display additional information on the image.
But this is only an idea at the moment.
RobM

Posts: 3,952
Registered: 4-Aug-2006
Re: What is the simplest way to parse xml-file?
Posted: 30 Dec 25, 21:47   in response to: wiener30 in response to: wiener30
 
  Click to reply to this thread Reply
wiener30 wrote:
I am deliberating to parse
<image>.jpg.info

files in order to extract coordinates of the text entered on the image.
If succeeded, I would use html/css to create a hotspot to dynamically display additional information on the image.
But this is only an idea at the moment.
Is there a reason for not using face/area tags to create the hotspot?
davidekholm

Posts: 3,939
Registered: 18-Oct-2002
Re: What is the simplest way to parse xml-file?
Posted: 2 Jan 26, 11:57   in response to: wiener30 in response to: wiener30
 
  Click to reply to this thread Reply
Any reason you don't want to use the jAlbum AlbumObjectProperties to access this metadata?
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums