Questions tagged [jdom-2]

JDOM 2 is the Second version of the JDOM XML API See the [Migration Guide][1] for differences over JDOM 1

JDOM 2 is the Second version of the JDOM XML API

See the Migration Guide for differences over JDOM 1

165 questions
1
vote
1 answer

The name "" is not legal for JDOM/XML namespaces

I use JDOM2 to retrieve XML I don't control from remote feeds. For one of them I got this error: The name "" is not legal for JDOM/XML namespaces: Namespace URIs must be non-null and non-empty Strings. Here is a sample of the XML:
LabOctoCat
  • 611
  • 7
  • 17
1
vote
1 answer

Find descendant element with JDOM

Is there a way to find a descendant element with JDOM, like you can with jQuery? I'm trying to get the sequence element out of this XML document:
Jon H
  • 193
  • 3
  • 15
1
vote
1 answer

The same Namespace in Child and Sub Child (JDOM2)

I need set a namespace in a child and in its child too, but, when I attribute the same namespace, the sub child comes with no namespace. I need something like that:
1
vote
1 answer

XPath 2.0 feature in JDOM 2.0

How can I use XPath 2.0 feature like "schema-element" in JDOM 2.0? Is this even possible? If so, how? Are there any alternatives?
1
vote
2 answers

XML parsing error related to char encoding set

I have an valid XML file(valid cause browser can parse it) that I try to parse using JDOM2. The code was running good for other xml files but for this particular xml file it gives me the following exception on builder.build() line : …
vikas_2kx
  • 37
  • 6
1
vote
1 answer

How can i get attribute value with JDOM

I want to get attribute "name" of element "UML:UseCase" from this XMLfile.
1
vote
1 answer

SpringWS2 and JDOM2 Webservice on Weblogic 10.3.5 - Request Element Texts are not bound

After deploying my Spring WS 2 Webservices (using JDOM2 Element as Parameter) on a Weblogic 10.3.5 Server, child Elements of the root Element - wich is the main parameter of my endpoint function - never contain TEXT-content. Example: Request XML (as…
elfwyn
  • 568
  • 2
  • 11
  • 33
1
vote
2 answers

Validate an XML file against an XSD schema using JDOM 2.0

I've been looking for an example on how to validate an XML file against an XSD schema using JDOM 2.0 before parsing it. I've been searching for about an hour but wasn't able to find a solution which would work and allow me to provide the path to…
Dušan Rychnovský
  • 11,699
  • 8
  • 41
  • 65
1
vote
1 answer

When is JDOM XPATH faster than element hunting with getChildren?

Using: Java 1.5 / JDom 1.1.3 / Jaxen 1.1.1 The test I've written was to confirm the belief that using precompiled XPATH in JDOM was faster than iterating through child elements. Instead, what I've found is that XPATH is between 4 and 5 times slower…
JHarnach
  • 3,944
  • 7
  • 43
  • 48
0
votes
1 answer

How can i create a new XML parents for elements which are between two boundary elements

I would like to create a new XML parents at the highest possible levels for elements which are between two boundary elements in the JDOM2 structure. Practically there are no limitations to the placement of the and elements. Simplified…
0
votes
1 answer

Error in XML parser with JDOM2 package in android studio (java)

This code should convert xml to json and i got below error in the first of it. SAXBuilder can't read xml file. I use JDOM2 library in this code. Java code: package com.example.books_xmltojson; import androidx.appcompat.app.AppCompatActivity; import…
Arash
  • 61
  • 1
  • 2
  • 9
0
votes
0 answers

Android Studio JDOMException - feature not supported for SAX Driver

I am having issues using the JDOM2 library within Android Studio. My application compiles and runs, but as soon as a method is used that includes JDOM, I receive this error: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException …
0
votes
2 answers

Java: JDOM.XMLOutputter don't overwrite XML File when looking to make multiple changes in a row

Explanation I'm making program that use a XML file to save some values to use as settings, and only need to read and modify the element values in the XML. The code is written in Java and I'm using JDOM 2.0.6.1 to manage the XML file, followed this…
Cromega08
  • 63
  • 6
0
votes
1 answer

java.lang.NoClassDefFoundError: org/jdom2/Content

I have a small code using jdom that creates a very simple xml, but when I try to run it after compiling the classes, outputs the error in the title java.lang.NoClassDefFoundError: org/jdom2/Content I have the jdom.jar file in the same directory as…
0
votes
1 answer

JDOM2 XMLOutputter wrote empty file to Win10 OS

My Java app stores a set of XML User datafiles at Quit time. It parses them back in at relaunch. A user reported a launch-time failure, and the cause was found to be one of these User datafiles was an empty file (zero text chars). I'm using the…
pbierre
  • 276
  • 1
  • 8