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 Content already has an existing parent when use Comparator to sort

I use jdom2 to get a Element list from xml string. and want to sort it by getChildText. This is my Comparator: public class ComparatorFunc implements Comparator { public int compare(Object arg0, Object arg1) { Element e1 = (Element)…
chanjianyi
  • 607
  • 4
  • 15
  • 35
1
vote
1 answer

How to use XPATH functions(concat, string-join) in JDOM2?

Here I have a simple project. pom.xml
Jimmy
  • 1,699
  • 2
  • 16
  • 17
1
vote
1 answer

Java jdom2 problems with creating xml

I want to create Element for android permission I try something like this: Element el = new Element("uses-permission", "android:name",…
1
vote
3 answers

Get a specific child name in an XML file

I have an xml file like this:
1
vote
1 answer

Building an .XML file containing my FIX orders, in Java using JDOM

I've written a simple method to send FIX orders. I have a little problem, the first ClOrdID stored is 1, the next 11, and then 21 and so on so forth. I was looking to have the first element 0 or 1, and then 2,3 etc... What's wrong with my…
1
vote
1 answer

spring-ws jdom wrong response

I'm struggling with Spring-WS, used with JDOM. Code: @Endpoint @Namespace(uri = "http://example.pl/gb/schemas", prefix = "gb") public class PdfCheckStatusEndPoint { private static final String NAMESPACE_URI =…
meliniak
  • 762
  • 1
  • 9
  • 16
1
vote
2 answers

Error with Jdom 2.0.5 and java during my compilation

I try to compil with jdom, my directory look like that : jdom-2.0.5.jar, ParseurXml.java, XMLEnt.xml i've already try to export my classpath, but It still not woking at all. My ParseurXML.java contain only tree import, and write that in my stderr…
1
vote
1 answer

Creating XML file with nested elements using JDOM

I created an XML file (from Object) using JDOM and it works, but I can't get one nested element (Teachers) to work properly. Here is the method that creates the file: public void writeFileUsingJDOM(List activityList, String fileName)…
just_a_girl
  • 643
  • 4
  • 13
  • 28
1
vote
1 answer

Unclear results with jdom2 XPath query

I have problem with jdom2 XPath: test.xhtml code:
d3im
  • 323
  • 2
  • 4
  • 18
1
vote
2 answers

How to remove child element from XML in java?

This is my XML file
vijayk
  • 2,633
  • 14
  • 38
  • 59
1
vote
2 answers

Why I can't take the content of a tag using XPath in a Java method?

I am very new in XPath and I have the following problem: I have a Java method that receives data from a webservices and these data are in a XML document, so I have to use XPath to take a specific value inside this XML result document. In particular…
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596
1
vote
0 answers

Parsing Many-to-Many XML in Android

I am trying to parse an XML file in android and then save contents to a SQLite Database. I am currently using JDOM2 for ease in reading the code. As far as memory concerns I don't believe JDOM will be an issue as the parsing happens fairly quickly…
Rufflez
  • 214
  • 2
  • 9
1
vote
2 answers

Parsing a XML file with JDOM2 under Android

I've got a problem to parse a XML file in an Android application with the library JDOM2 (2.0.5 to be exact). In a Java project, it works fine but in an Android application project, I've got the following message : "Couldn't open…
1
vote
2 answers

Java jdom xml parsing

it's my first day with java and I try to build a little xml parser for my websites, so I can have a clean look on my sitemaps.xml . The code I use is like that import java.io.IOException; import java.io.InputStream; import…
Johnny000
  • 2,058
  • 5
  • 30
  • 59
1
vote
1 answer

How to get JDOM2 Element text as a list if its content separated by its inner Elements?

I want to build up a String from an XML-file in Java, using JDOM2. The XML-file snippet what I want to process looks like the following: ... usefuldatapart1 <span profile="id1"> optionaldata1 </span> <span profile="id2"> optionaldata2…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/java" class="post-tag grid--cell" title="show questions tagged 'java'" rel="tag">java</a> <a href="../../questions/tagged/xml-parsing" class="post-tag grid--cell" title="show questions tagged 'xml-parsing'" rel="tag">xml-parsing</a> <a href="../../questions/tagged/jdom-2" class="post-tag grid--cell" title="show questions tagged 'jdom-2'" rel="tag">jdom-2</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Apr 30 '13 at 13:58">asked Apr 30 '13 at 13:58</time> <a href="../../users/2335239/syry" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/2335239.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Syry" /> </a> <div class="s-user-card--info"> <a href="../../users/2335239/syry" class="s-user-card--link">Syry</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">13</li> <li class="s-award-bling s-award-bling__bronze" title="4 bronze badges">4</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="s-pagination pager fr"> <a class="s-pagination--item" href="../../questions/tagged/jdom-2_page=4" rel="prev" title="Go to page 4">Prev </a> <a class="s-pagination--item" href="../../questions/tagged/jdom-2_page=1" rel="" title="Go to page 1">1</a> <a class="s-pagination--item" href="../../questions/tagged/jdom-2_page=2" rel="" title="Go to page 2">2</a> <a class="s-pagination--item" href="../../questions/tagged/jdom-2_page=3" rel="" title="Go to page 3">3</a> <div class="s-pagination--item s-pagination--item__clear">…</div> <a class="s-pagination--item" href="../../questions/tagged/jdom-2_page=10" rel="" title="Go to page 10">10</a> <a class="s-pagination--item" href="../../questions/tagged/jdom-2_page=11" rel="" title="Go to page 11">11</a> <a class="s-pagination--item" href="../../questions/tagged/jdom-2_page=6" rel="next" title="Go to page 6"> Next</a> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script src="../../static/js/fromnow.js"></script> </body> </html>