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
0
votes
1 answer

JDOM2 Outputter inserting 4 errant bytes at start of XML file

I'm using Java 8 and JDOM 2.0.6 (Mac-Yosemite + Eclipse) to generate an XML file. The prolog of the file comes out with these bytes preceding
pbierre
  • 276
  • 1
  • 8
0
votes
0 answers

Java JDOM2 XML add Element to existing child

I am trying to insert a new child at a certain position in an existing XML document. To do this, I have first parsed the existing XML document and now want to edit and save it. In the imports i use import javax.xml.parsers.DocumentBuilder; import…
DeadApe
  • 416
  • 1
  • 3
  • 10
0
votes
2 answers

Check for attribute existence in jdom2 for a given xml in Java

I am trying to find XML node's which has an attributed called "CommunityOwnedDate" in an XML node in java. I am using jdom2. Some node doesn't have that node and i am trying to find that using jdom2. Is there any other straightforward way to do…
Hamed Sanaei
  • 121
  • 13
0
votes
1 answer

Move XML child element up without changing text flow

I have xml files which look like: blah blah bleep something different bloop bleh bleh and would like to move the elements up one level, without changing the text flow : in other…
Joel in Gö
  • 7,460
  • 9
  • 47
  • 77
0
votes
1 answer

Escaping double quote is not working properly Jdom2

I am writing a parser in Java where I am writing a string in XML dom. my problem is a String "test" should come as "test" but it is coming as "test" Here is my code Element elment1 = new Element("string"); elment1.addContent("test"); i…
Fadi
  • 23
  • 5
0
votes
1 answer

Parsing response string to xml with jdom2

I want to parse my StringBuffer with Jdom2 after a SOAP call. But I didn't find a solution anywhere. I saw a few solutions with w3.jdom, but they asked me to do with jdom2. HttpResponse response = client.execute(httppost); BufferedReader rd = new…
Bezkup
  • 1
  • 3
0
votes
1 answer

Check if a class element exists depending the class attribute using Xpath

I need to get the ratings(stars) of a particular company using Xpath .Below is the block of div element from which I need to decide if its a 5 star , 4 star , 3 star etc depending the class attribute div class="star-rating star-rating-4…
user8618585
  • 81
  • 1
  • 10
0
votes
2 answers

IllegalArgument Exception : Unable to compile

I am getting IlleagalArgument Exception while retreiving Xpath for a particular node I need to retrieve the below webpage link which follows the title WebPages ,I tried using the below expression but it is not able compile (Please see the comment…
user8618585
  • 81
  • 1
  • 10
0
votes
1 answer

I want to generate an XML file that does not need to be escaped if there are special characters

Using JDOM to generate an XML file, what is the best way to avoid escaping characters enter image description here I tried. I can't find a way public class JDomCreateXml { public static void main(String[] args) throws IOException { …
Eagle
  • 3
  • 3
0
votes
1 answer

jdom2 Encoding Problem in XML UTF-8 Output

I try to update some attribute values an existing XML file using jdom2. I'm getting the utf8 encoding problem when I create the xml file. The attribute value is "1 student Noun". But the value I see in the output is : 1 student Noun The…
user1368271
0
votes
1 answer

Extracting information from XML-Files by URL-Source takes a lot of time

I would like to extract specific information from 108 Xml files. The general source is also a XML-File with further URLs as resources. XML-Source The static method getURL() extracts the URLs in order to set them as URL-paths within a for loop in…
Laroux89
  • 45
  • 5
0
votes
1 answer

Jdom2 parser with empty xml document

I am trying to parse a string representation of a xml document with jdom2. I expect the xml string to be a valid xml document. But when I run this simple code snippet: import java.io.IOException; import…
Eaton Emmerich
  • 452
  • 4
  • 17
0
votes
1 answer

JDOM2, xmlns (xsd) c'ant change or remove from XML document

I dont have the xsd file of an xml document, so I must change to default xmlns "http://www.w3.org/2001/XMLSchema-instance" to pars the XML elements but there is a problem to do it, when I change xmlns attribute of root element (myroot) another…
Imii Iik
  • 205
  • 1
  • 4
  • 14
0
votes
1 answer

How can create a loop to count an specific "Child" in a list of "Children"?

Consider the following XML file:
Saffa Seraj
  • 77
  • 1
  • 8
0
votes
0 answers

Get Max Value Attribut Using XPATH JDom

I have a XML file like Roberval Roberval Roberval