Questions tagged [xom]

XOM™ is a new XML object model. It is an open source (LGPL), tree-based API for processing XML with Java that strives for correctness, simplicity, and performance.

XOM™ is a new XML object model. It is an open source (LGPL), tree-based API for processing XML with Java that strives for correctness, simplicity, and performance.

XOM is designed to be easy to learn and easy to use. It works very straight-forwardly, and has a very shallow learning curve. Assuming you're already familiar with XML, you should be able to get up and running with XOM very quickly.

References:

91 questions
2
votes
3 answers

XOM analogue for Scala?

Is there an XML processing library for Scala "that strives for correctness, simplicity, and performance, in that order" like does XOM for Java? (Scala XML API is not an option)
BorisOkunskiy
  • 1,830
  • 1
  • 19
  • 24
2
votes
2 answers

Nodes with case-insensitive content using XOM

I want to query nodes from a XOM document which contains certain value but case insensitive. Something like this: doc.query('/root/book[contains(.,"case-insentive-string")]') But it contains is case sensitive. I tried to use regexes, but it…
millebii
  • 1,277
  • 2
  • 17
  • 27
2
votes
2 answers

Time and memory efficient java XPath parser

What I need is a java implementation of XPath parser that will be more intuitive to use and comparable in memory and time efficiency to VTD-XML. What is more, I need it to perform nested Xpath expressions for some additional performance gains.In my…
Edmund K
  • 39
  • 6
2
votes
4 answers

How to set namespace only on first tag with XOM?

I am using XOM to build XML documents in Java. I have created a simple XML document, and I want an XML namespace. But when I set the namespace on the first tag, an empty namespace is set on the childs like xmlns="", how can I get rid of this…
Jonas
  • 121,568
  • 97
  • 310
  • 388
2
votes
1 answer

Easy way to convert an org.apache.xmlbeansXmlObject to nu.xom.Element

I have used the scomp tool from XMLBeans to generate java classes and then populated the fields in an XmlObject (I wrote this code some time ago). I now need to convert this object into the Element class used by the XOM library. Is there an easier…
Catchwa
  • 5,845
  • 4
  • 31
  • 57
2
votes
1 answer

Setting a custom XOM EntityResolver

I need to not validate against a doctype, so I'd like to set a custom EntityResolver that accepts everything. I'm getting data back from tagsoup, so I know my data is well-formed and correct. Furthermore, I need to rapidly hit a number of documents,…
Stefan Kendall
  • 66,414
  • 68
  • 253
  • 406
2
votes
0 answers

Get Unescaped text from Xom.NU XML file

I've been using the xom.nu library to save and parse XML files for an application. Unfortunately, I just realized that it's been XML-encoding my special characters, but it hasn't been decoding them when I call toString(). Example: Element element =…
ahjohnston25
  • 1,915
  • 15
  • 36
2
votes
1 answer

Tagsoup and XOM on android

Can i use Tagsoup and XOM on android 1.6 without any performance problems ?
Kristof
  • 557
  • 6
  • 14
2
votes
2 answers

XML Parsing performance DOM vs XOM

I wrote the same XML parsing algorithm in Java using different parser Parser X (XOM) and Parser Y (DOM). I embedded the code inside a 2 million times loop to imitate the numbers of operations I need to carry and used a Java profiler to monitor…
mowienay
  • 1,264
  • 4
  • 19
  • 32
2
votes
2 answers

premature end of file while parsing an xml file on android

I'm trying to read an xml file on from an android app using XOM as the XML library. I'm trying this: Builder parser = new Builder(); Document doc = parser.build(context.openFileInput(XML_FILE_LOCATION)); But I'm getting nu.xom.ParsingException:…
Darth Plagueis
  • 910
  • 3
  • 21
  • 39
2
votes
3 answers

XOM canonicalization takes too long

I have an XML file that can be as big as 1GB. I am using XOM to avoid OutOfMemory Exceptions. I need to canonicalize the entire document, but the canonicalization takes a long time, even for a 1.5 MB file. Here is what I have done: I have this…
artsince
  • 1,022
  • 20
  • 36
2
votes
1 answer

Set timeout when loading xml from a URL?

Is it possible to set a timeout when loading an xml directly from a URL? Builder parser = new Builder(); Document doc = parser.build("http://somehost"); This may take sometimes minutes, and would be really handy to be able to time this out directly…
D_K
  • 1,410
  • 12
  • 35
1
vote
1 answer

Insert additional parent XML element using XOM

With the following XML: Stuff Stuff Using XPath I query the child elements, and based on some conditions I want to append an extra parent level above some of them:
Matt Swain
  • 3,827
  • 4
  • 25
  • 36
1
vote
1 answer

Query Node in XOM

I am querying document in XOM, getting a Node, and then querying this Node for another Node. However, querying Node behaves like it's querying whole document, not only this node. XML is like this:
amorfis
  • 15,390
  • 15
  • 77
  • 125
1
vote
2 answers

Having Element.toXML() properly indented instead of showing the resulting string just as a single line?

The default behavior of Element.toXML() seems to be showing up the result as a single line. Is it possible to have it show the result in multiple lines, in a hierarchical way? Example: This is what I'd like to get
devoured elysium
  • 101,373
  • 131
  • 340
  • 557