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

JDOM2- Don't auto close tags

I am generating a XML file using JDOM . Since I didn't put any content in a element , it auto closes . This is not the behavior I want , because the user is supposed to fill the file. Is it possible to make the element not auto close…
Fabio
  • 343
  • 1
  • 6
  • 17
1
vote
0 answers

JDOM XML Parsing: not entering for loop

I want to parse and print XML tags using jdom2 (not w3c/xml.sax) the root element is getting printed and the debug till before for loop is also there, but after that, there's blank, no syntax error, am I missing something in the for loop? this is…
K. Nik
  • 11
  • 1
1
vote
0 answers

Set multiple namespace with different prefix using jdom

I would like to have this format in xml
1
vote
1 answer

How to parse soap string in java

I have written the below code to parse a string in java but its not printing out a blank message. How can I get specific parts from a SOAP message and get their values? I want to get the error and the message in the request. String xml = "
mulikevs
  • 181
  • 2
  • 17
1
vote
2 answers

remove element by position

I have an xml which has a simple set of data. This data is displayed in a simple table and each row of data is assigned an ID in the table based on the position in the xml ( ). I cant add an id attribute to the…
Finchy70
  • 441
  • 9
  • 25
1
vote
1 answer

JDOM 2 Get position and index of a specific XML element

I have an XML document and I want to add an element in a specific position (index) using the name and attribute of existing element, So I have to find the index of this specific element. Example:
Imii Iik
  • 205
  • 1
  • 4
  • 14
1
vote
1 answer

Create XML Node with attribute xsi:type in JDOM2

I am trying to create the below XML document . I'm using the Java Code as below - package…
1
vote
1 answer

How to solve the IllegalDataException in jdom2 library?

I am using jdom 2.0.6 version and received this IllegalDataException: Error in setText for tokenization: it fails on calling the setText() method. Element text = new Element("Text"); text.setText(doc.getText()); It seems some characters in 'text'…
user697911
  • 10,043
  • 25
  • 95
  • 169
1
vote
1 answer

parsing an android manifest file with JDOM2

hope you're fine. I have to parse an android manifest file to extract data like 'the minSdkVersion' used, after several seraches I found a code using JDOM. Display data related to "uses-sdk" was expected but When running I got a null object. Need…
Rahi
  • 23
  • 6
1
vote
1 answer

Remove Duplicate Namespaces from XML in Java

I have the following soap response as a sample:
Haseeb Khan
  • 795
  • 2
  • 11
  • 22
1
vote
1 answer

Java: JDOM2 write ascii character in xml

i am writing a xml, using JDOM2 the customers wish is, to have a line as follows: 20 but all I can create is: 20 because the ascii is converted by my format encoding…
unknown404
  • 115
  • 9
1
vote
2 answers

Android JDOM2 xml parsing, IOExcetion

I am trying to parse xml from URL with jdom-2.0.6.jar, but i get IOException: IOException: Couldn't open "here is xml link" That what I am doing: import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.JDOMException; import…
viderSelf
  • 41
  • 5
1
vote
2 answers

getting content between two tags XML using jdom

i'm trying to get content between tag as this is xml file : Gambardella, Matthew XML Developer's Guide Computer
kivok94
  • 303
  • 1
  • 4
  • 11
1
vote
0 answers

NoClassDefFoundError jdom2 SAXBuilder

I have the following code which compiles fine: SAXBuilder saxBuilder = new SAXBuilder(); org.jdom2.Document doc = saxBuilder.build(new StringReader(xml)); org.jdom2.Element root = doc.getRootElement(); However when I deploy…
Chris Ner
  • 91
  • 6
1
vote
1 answer

Validate XML file against several XSD and know which one validates the file (jdom2)

I would like to validate XML files against two different XSD, knowing that the XML file does not have to be validated against both of them but only one of them. Then I need to know which XSD file validates the XML file in order to access different…
ahonorat
  • 23
  • 3
1 2
3
10 11