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
0 answers

Parsing XML from URL which doesn't have specific styling

I am trying to read the response using Selenium to perform some validations, and when the XML is displayed, There is info on the top of web page: " The XML file appears to have any style information associated with it!" , I am trying to read the xml…
Joe
  • 33
  • 1
  • 5
0
votes
1 answer

JDom How to comment an existing line

I am currently struggling to comment an existing line with JDom, best I would like to comment an entire node. SAXBuilder jdomBuild = new SAXBuilder(); jdomDoc = jdomBuild.build(fileLocation); Element root = jdomDoc.getRootElement(); …
B_PRIEUR
  • 160
  • 1
  • 1
  • 18
0
votes
0 answers

Remove extra new line in XML generated by Jdom2

I used getPrettyFormat() in Jdom2 and it gives me a XML file as below. 2016-05-27 2021-05-27 2016-05-27 2016-05-27 But I need to remove…
Madhawas
  • 371
  • 1
  • 2
  • 15
0
votes
1 answer

Java:How to get Attribute name from xml in Java?(JDOM)

Java: How to get Attribute Name of the node Using JAVA-JDOM? For Example, The Output Should be: id My Java Program: In ______ Needs to get Attribute Name of node which as it is in Source file. This Program…
0
votes
1 answer

error on using xpath in java code

i'm trying to get result of expression of xpath , my xml file is like this : Gambardella, Matthew XML Developer's Guide
kivok94
  • 303
  • 1
  • 4
  • 11
0
votes
1 answer

NullPointerException error when retrieving a string from an XML file

My title is not that great given that I'm not entirely too sure on how to word it, but the issue is that I have created the following method: private static int createItem(Document xml) throws JDOMException, IOException{ Element element =…
0
votes
1 answer

Effectively retrieving BLOB XML from database using Java

I am trying to read XML file details from Sun Identity Manager database using below snippet String xmlTxt=""; ArrayList xmlList = new ArrayList(); BLOB blob=null; OracleConnection…
0
votes
1 answer

JDOM: cannot find symbol getAttribute()

I want to get a list of the names of keys stored in a keystore.xml:
Jans
  • 35
  • 5
0
votes
1 answer

Extend a JDOM Document

For a project at university, I need to parse a GML file. GML files are XML based so I use JDOM2 to parse it. To fit my purposes, I extended org.jdom2.Document like so: package datenbank; import java.io.File; // some more imports public class…
vatbub
  • 2,713
  • 18
  • 41
0
votes
1 answer

Iterator only gets first Element in JavaFX

i am wondering why my Iterator only gets the first Element while getting trough a List from an XML reader My XML File: Horror Action Kinderfilm Komödie
Punching
  • 55
  • 7
0
votes
0 answers

I want to add xml declaration by using JDOM

My code is: import java.io.IOException; import org.jdom2.Document; import org.jdom2.output.Format; import org.jdom2.output.XMLOutputter; public class Test { public static void main(String[] args) { Document doc = new Document(); …
Ravi Kant
  • 1
  • 2
0
votes
1 answer

Java jDom2 get Tag Value DigestValue

I'm using XMLQuire to generate the Patch for get the Patch. But always return null value: The Xpath used: //dft:enviNFe/dft:NFe/Signature/SignedInfo/Reference/DigestValue That one works: //k:enviNFe/k:NFe/k:infNFe/k:ide/k:tpAmb The function…
0
votes
1 answer

Convert jdom2 Document to DOMSource

I have an XML as jdom2 Document delivered by an URIResolver and need to convert it to a DOMSource. But I have no Clue how I could do that. I know that a org.w3c.dom.Node can be used to create a DOMSource but I also have no glue how to convert a…
Sebastian Röher
  • 417
  • 7
  • 20
0
votes
1 answer

JDOM setText() Not Working

I have a method that parses for a specific String and is supposed to change that String using JDOM's setText() method. But when I look at the document after the program finishes, the String is never changed: public void findVirtue(String word,…
ryekayo
  • 2,341
  • 3
  • 23
  • 51
0
votes
1 answer

How to detect an empty tag in xml document using jdom

I'm using JDOM to parse an xml document that could be like this: xyz I'm trying to find out what the correct way to detect an empty tag such as or would be.
hipsandy
  • 982
  • 8
  • 7