216
questions
-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 ...
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 ...
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....
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;
...
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....
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 ...
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 = ...
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....
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,...
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(...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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....
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 ...
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 ...
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%...
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 ...
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 ...
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 ...
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....
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....
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....
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://...
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(<...
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 ...
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/...
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 ...
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 ...
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 ...
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 ...
-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 ...
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 ...
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 ...
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:
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 ...
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 ...
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 ...
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 ...
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 ...
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
...
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:...
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....
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....
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 ...
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 ...
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-...