Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
1 answer
55 views

setXIncludeAware is not supported on JAXP implementation

Could you please help to solve the issue "setXIncludeAware is not supported on this JAXP implementation or earlier: class org.apache.xerces.jaxp.SAXParserFactoryImpl" Java version used in ...
Santanu Singha Roy's user avatar
0 votes
1 answer
100 views

InaccessibleObjectException while doing assertThat isEqualTo in test

Getting this error while running a test to compare 2 XML objects - org.assertj.core.util.introspection.IntrospectionError: Can't find any field or property with name 'orig_second'. Error when ...
curious's user avatar
0 votes
1 answer
138 views

Can you declare / generate xslt params dynamically?

I'm trying to generate an xml with the help of xslt templates and I have a tricky thing to do: I have to generate a certain number of elements that have same tags but with different values inside them....
Priku's user avatar
  • 1
0 votes
1 answer
135 views

JAXP with Xerces with ignores xsi:schemaLocation attribute?

I've tried creating a SAXParser, but any xsi:schemaLocation attributes in the instance document are ignored. Does Xerces not support this feature when using JAXP? import javax.xml.parsers.SAXParser; ...
yas's user avatar
  • 3,610
0 votes
1 answer
109 views

Can XSModel object be obtained from a Schema Object?

Using JAXP I can create a Schema object. e.g. Path schemaPath = ...; StreamSource source = new StreamSource(schemaPath.toFile()); SchemaFactory factory = SchemaFactory....
yas's user avatar
  • 3,610
0 votes
1 answer
558 views

SOAPConnectionFactory.newInstance() returns null in JAX-RS resource

I have a JAX-RS resource, using Jersey, that provides a resource InstallOrder. When there is a POST Request for this resource it shall make a SOAP request and send it to yet another web service. I'm ...
lordzeu's user avatar
  • 31
1 vote
1 answer
250 views

Disable Indent in JAXP when transform XML

I am using JAXP to convert DOM tree to XML. I do not want any intends in my result XML. This is my code: root.normalize(); DOMSource domSource = new DOMSource(root); StreamResult result = ...
TNN's user avatar
  • 436
1 vote
1 answer
971 views

running with invalid JAXP api or implementation axis2 using ant

I'm trying to generate axis2-1.7.9 stub files from wsdl file by calling axis2 classname="org.apache.axis2.tool.ant.AntCodegenTask" but I keep getting the following error: java.lang....
yogev levi's user avatar
0 votes
1 answer
118 views

SAXON - XPath, Resolving Variable with Node and Primitive value

I have a case of evaluation like : $asset eq 100 and $asset/name() eq 'p0:current_asset' which should return true(), variable $asset need to be resolved as primitive and node value in same evaluation,...
Fauzi Achmad's user avatar
0 votes
1 answer
604 views

How to register Saxon/XSLT extension functions such that they accessible in BaseX/XQuery (JAXP APIs)

I have a few Saxon/XSLT extension functions that I created through the simple interface that I register like this: Processor proc = new Processor(false); proc.registerExtensionFunction(...
Emmanuel Oga's user avatar
0 votes
1 answer
3k views

How I can use com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl on WebSphere instead com.ibm.xtq.xslt.jaxp.TransformerImpl?

I have java application on WebSphere 8.5.5. I use xslt transformer from jdk. When I used console version I could use jdk version of transformer. Now, I switched to WebSphere. When I create a ...
Дарья Смородина's user avatar
1 vote
1 answer
346 views

How do I Ignore Data Contained within XML Comments Using a JAXP SAX Parser?

I have a large XML file containing many key value pairs. The file contains both multi-line comments and actual data. Within the comments section, there are examples of how the data/key-value pairs ...
ice's user avatar
  • 19
1 vote
1 answer
2k views

XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom

My application is giving xpathfactory error on AIX which occurs at this line in the code XPathFactory xpf = XPathFactory.newInstance();.But,It's working fine on windows.I have extracted rt.jar which ...
prathyusha magam's user avatar
0 votes
0 answers
2k views

How to extend com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl and write own DocumentBuilderFactoryI for Weblogic 12C

To prevent XXE attack, I am trying to override default DocumentBuilderFactoryImpl for weblogic 12c and use my own parser. I am trying below code. import javax.xml.parsers.DocumentBuilder; import ...
SubhenduGN's user avatar
0 votes
1 answer
497 views

setOutputProperty(), setParameter() and setURIResolver() methods of javax.xml.transform.Transformer

What is the use of the methods setOutputProperty(), setParameter() and setURIResolver() of the class javax.xml.transform.Transformer? I had went through the official documentation and many other ...
IdiotHub123's user avatar
0 votes
1 answer
1k views

How to use XML transformer with Java object as parameter?

I'm writing a Java application, where the goal is to do XML transformation to generate a PDF document. I'm using an XML file as input, which is first parsed to a java object. After parsing I want to ...
greggor's user avatar
  • 33
1 vote
1 answer
5k views

KryoException with missing no arg constructor

I have been struggling with a problem about Kryo. I have a client server architecture and sending message via JMS using Kryo. In one of my response class I have a class having javax.xml.datatype....
Sami's user avatar
  • 500
0 votes
1 answer
234 views

Classloading problem in multimodule maven application

I have multimodule maven application. Inside the main directory where parent pom resides I have some modules. I am in the process of adding another one on the same level as the other modules. The ...
Andrew's user avatar
  • 57
1 vote
0 answers
8k views

accessExternalSchema is not recognized

I am trying to generate Java classes using Maven from XSDs/WSDLs. I have declared all the XSDs in my POM file and using the XJC plugin. When I try to do a clean install, I see these two error messages ...
hell_storm2004's user avatar
1 vote
1 answer
4k views

"Illegal hex characters in escape (%) pattern" when doing s3.listObjects()

I'm facing a curious problem. I have a Java webapp that uses the AWS sdk My Local setup is Latest Docker Container with Centos7 + tomcat9.0.13 + JDK 1.8.0_161 One of my object key name is ".Test%...
Marco's user avatar
  • 560
0 votes
1 answer
473 views

Error "cvc-elt.1: Cannot find the declaration of element 'xs:schema'." in Eclipse

I have the following XML Schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Movies"> <!-- Other ...
David's user avatar
  • 1
2 votes
1 answer
2k views

Trying to use XInclude with Java and resolving the fragment with xml:id

I've been trying to get XInclude working in my XML document and finally have it working in Oxygen XML, which I'm using to author the XML documents. I then went to my app, written in Java, but it ...
Paul Hunnisett's user avatar
2 votes
0 answers
513 views

XSD Validation with schemaFactory: Cannot resolve the name 'ext:UBLExtensions' to a(n) 'element declaration' component

Im trying to validate UBL invoice XML with the UBL invoice XSD file which imports some other XSD files. I read the docs and various SO questions that had the same problems. I however still have not ...
Eksit's user avatar
  • 72
6 votes
1 answer
7k views

Are there any disadvantages to setNamespaceAware(true)?

I was parsing an XML document, in Java, using the following code: DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Element el = db....
Adrian Smith's user avatar
  • 17.5k
1 vote
1 answer
2k views

JAXP parse error on valid XML

I am trying to run some XPath Queries on XML in Java and apparently the recommended way to do so is to construct a document first. Here is the standard JAXP code sample that I was using: import org....
Robert Jack Will's user avatar
0 votes
1 answer
190 views

missing resource bundle exception in java using weblogic

I have a requirement that I need to convert xsd file to POJO files. While using tomcat I didnot face any issue but when I am using weblogic I am getting error Can't find resource for bundle java....
Sunny Mittal's user avatar
0 votes
0 answers
3k views

"java.lang.ClassCastException: weblogic.xml.jaxp.RegistrySAXParserFactory cannot be cast to javax.xml.parsers.SAXParserFactory

I work with Spring MVC, weblogic 10.3.6. I have a jsp. The taglib declarations are <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib prefix="spring" uri="http://...
Carlota's user avatar
  • 1,237
3 votes
1 answer
721 views

XSL caching in java - dependent xsl files

I am using the following code to cache the xsl (same across all requests) so that the file is not read from the disk every single time. My question is if the xsl refers to 100 other xsl files(<...
Arun Ramadoss's user avatar
2 votes
2 answers
559 views

Websphere Liberty seems to override System Property TransformerFactory set via jvm.options

I am trying to migrate a legacy app that is using camel/cxf (offers some web services that include transformations) to Websphere Liberty 16.0.0.03 (IBM JRE 1.8). Tests are failing because the app uses ...
user3170555's user avatar
1 vote
2 answers
300 views

WebSphere NoClassDefFoundError for Oracle Java class

I'm getting a NoClassDefFoundError for a class that exists in Oracle's rt.jar, but doesn't seem to exist in WebSphere's rt.jar. java.lang.NoClassDefFoundError: com/sun/org/apache/xpath/internal/...
Corey's user avatar
  • 60
0 votes
1 answer
993 views

JAXP saxon-he : XMLfile StreamSource doesn't release file access after parsing error

I'm using JAXP specification API combined with Saxon-HE API, the main purpose was to develop an application which transform XML files using configurable XSLT stylesheets, able to override generated ...
PacDroid's user avatar
  • 541
15 votes
2 answers
3k views

jboss-deployment-structure.xml add JAXP exclusion

I am implementing XML validation which prevents XXE (External XML Entity) Injection. I borrowed some code from OWASP XXE Prevention Cheat Sheet. My code looks like this - SchemaFactory ...
Ankit Rustagi's user avatar
1 vote
1 answer
2k views

NullPointer exception converting SOAP string message to SoapMessage

I'm converting an XML string to a SOAPMessage. However, I end up getting a NullPointerException when attempting to invoke the service. When stepping through the code, I could tell it was trying to ...
user994165's user avatar
  • 9,394
0 votes
1 answer
579 views

Xerces dependency and JRE

Due to some classpath issues, I'm removing the Maven dependency to Xerces from my application. As I understand it, that is no longer needed as it is in the JRE. However, when compiling a junit that ...
user994165's user avatar
  • 9,394
-1 votes
1 answer
62 views

Which xml technology to extract fields from an xml file should I use

I work with Java. I have a bunch of long XML files. I have to filter the documents by several fields, then I have to extract other fields and then create an java object based on these fields. How ...
Fireworx's user avatar
1 vote
1 answer
579 views

Avoiding namespace prefixes with Saxon XPath against XHTML

Using Saxon HE 9.6 as a JAXP implementation Have an HTML document with the XHTML namespace //*:title returns the expected value, but //title doesn't I'd really like to just use //title. How can ...
Neil McGuigan's user avatar
0 votes
1 answer
837 views

StAX NullPointerException at xmlns=""

Objective To get suggestion for the cause of this issue and solution/workaround. Problem NullPointerException when running almost the same program in Stackoverflow Split 1GB Xml file using Java to ...
mon's user avatar
  • 21.6k
1 vote
1 answer
50 views

Why does something get installed when I run my code?

I followed the tutorial here: and my classes are one.java and oneWriter.java When I run one.java, my jar gets installed for some reason:
Div R's user avatar
  • 27
0 votes
2 answers
87 views

What layer stood behind JAXP plugging capabilities?

So lets asume that we want to make XSLT transformation and we want to use. TransformerFactory transFact = TransformerFactory.newInstance(); (1) So newInstance() create object from abstract class ...
Xelian's user avatar
  • 17.1k
3 votes
1 answer
1k views

Most pain-free way to add XPath 3.0 to a codebase using dom4j

From what I understand, SAXON is the only library which supports XPath 3.0 in Java. Its JAXP implementation only supports XPath 2.0. Its XPath 3.0 implementation should be called this way and requires ...
user291699's user avatar
3 votes
1 answer
10k views

java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory

I'm trying to deploy the PrimeFaces 5.3 showcase WAR on JBoss AS 6.1.0.Final. http://repository.primefaces.org/org/primefaces/showcase/5.3/showcase-5.3.war I can deploy it on JBoss AS 7.1.1.Final by ...
user1810292's user avatar
4 votes
0 answers
1k views

How to disable XML external entity (XXE) processing in JAXP 1.1/Java 1.4?

I'm working on making sure some code isn't vulnerable to XXE attacks. For stuff being compiled and run on Java 7 and Java 8 I've had success with OWASP's recommendations -- see the Java section of ...
QuantumMechanic's user avatar
2 votes
1 answer
3k views

XML Validation does not validate features

I want to validate XML file against an external XSD description. Here is the Schema obejct created from my XSD private static Schema xmlSchema; try { SchemaFactory factory ...
ikken's user avatar
  • 563
11 votes
2 answers
4k views

What is the advantage of using JAXP instead of DOM / SAX directly in Java?

Being new to XML parsing I'm trying to understand the different technologies. There is a confusing amount of different technologies for different needs: W3C-DOM XOM jDom JAXP JAXB DOM SAX StAX TrAX ...
hamena314's user avatar
  • 3,089
0 votes
2 answers
80 views

adding attribute to an existing node

i need to add an attribute initial-page-number to a tag fo:sequence tha tag is <fo:page-sequence master-reference="alternating" initial-page-number="1"><fo:page-sequence> .. ... </fo:...
robyp7's user avatar
  • 493
2 votes
0 answers
75 views

Why Does Java Stax Xml Parser Block

This works but next() function waits for 3-4 mins before parsing only a few lines. What's the reason? XMLInputFactory xmlFact = XMLInputFactory.newInstance(); XMLStreamReader xmlReader = xmlFact....
Insignificant Person's user avatar
9 votes
2 answers
10k views

How to let Java.xml.Transformer output a xml without any useless space or line break?

My Code Now: import org.w3c.dom.Node; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform....
Sayakiss's user avatar
  • 7,006
1 vote
1 answer
784 views

Zipping XML into GZIPOutputStream

I am trying to use the StaX API to create some XML, save it in a FileOutputStream and put that stream inside a GZIPOutPutStream. Clearly I am doing something wrong however because the following code ...
user2725919's user avatar
0 votes
1 answer
112 views

Generate JAXP DOM document with element order based on schema

I'm dynamically generating a document that needs to be validated against a schema at runtime. The problem I'm running into is that the structure of the document is correct, but the sequence of ...
Stephen Brown's user avatar
0 votes
1 answer
308 views

jaxp_feature_not_supported exception on docx4j

I am trying to use docx4j on my project. (I'm quite a newbies on it.) I just try to run the sample code from this link. http://www.smartjava.org/content/create-complex-word-docx-documents-...
Doppellon's user avatar

1
2 3 4 5