Questions tagged [jaxp]

The Java API for XML Processing (JAXP) enables applications to parse, transform, validate and query XML documents using an API that is independent of a particular XML processor implementation.

The Java API for XML Processing (JAXP) enables applications to parse, transform, validate and query XML documents using an API that is independent of a particular XML processor implementation.

JAXP provides a pluggability layer to enable vendors to provide their own implementations without introducing dependencies in application code. Using this software, application and tool developers can build fully-functional XML-enabled Java applications for e-commerce, application integration, and web publishing.

JAXP is a standard component in the Java platform. An implementation of the JAXP 1.3 is included in J2SE 5.0 and an implementation of JAXP 1.4 is in Java SE 6.0 and OpenJDK7. JAXP 1.4 is a maintenance release of JAXP 1.3 with support for the Streaming API for XML (StAX).

External links:

215 questions
1
vote
4 answers

Java: Iterate over HTML files in a directory

I'm taking HTML file and one XSLT file as input and generating HTML output but in my folder there are multiple HTML files and I've to take each of them as input and generate the corresponding output file while XSLT input file remains same every…
RahulD
  • 709
  • 2
  • 16
  • 39
1
vote
2 answers

Resolving which version of an XML Schema to use for XML documents with a version attribute

I have to write some code to handle reading and validating XML documents that use a version attribute in their root element to declare a version number, like this:
Nathan Hughes
  • 94,330
  • 19
  • 181
  • 276
1
vote
2 answers

Java(JAXP) and XSLT: Overwriting the XML file

I'm generating XML file by taking XML/HTML file (temp.xml) and XSLT(temp.xsl) as input and my output is generated as a separate file with the new name(temp_copy.xml) but I want to overwrite the input XML file instead of creating a new file. I tried…
RahulD
  • 709
  • 2
  • 16
  • 39
1
vote
3 answers

Setting current node for XPath evaluation

Given a node list and a current node within that list, is there a way to use javax.xml.xpath (or org.apache.xpath perhaps) to evaluate position dependent XPath expressions, for example: position()=last()-1 javax.xml.xpath contains: evaluate(String…
JasonPlutext
  • 15,352
  • 4
  • 44
  • 84
1
vote
1 answer

JAXP whether for XML parsing or XML binding?

I know JAXP is for XML parsing but is it possible to achieve xml binding with the help of JAXP?
rogue lad
  • 2,413
  • 2
  • 29
  • 32
0
votes
1 answer

XML parsing on a web application deployed on Glassfish error

I'm working on something to transform an xml file into ICML so I parse the XML file using an XSL file. Using javax.xml.transform.Transformer transformer. File xmlSourceFile = new File("f:/xmlSource.html"); javax.xml.transform.Source…
Sabry Shawally
  • 603
  • 2
  • 11
  • 24
0
votes
1 answer

Castor Generated Classes (XML Marshalling) - XSD Unavailable

I recently moved to a project where I noticed there have a specific requirement to store some data as XML. The prior team used Castor generated classes to Marshall and Unmarshall the data. I have a new requirement now that requires me to add some…
Y123
  • 915
  • 13
  • 30
0
votes
3 answers

XML parser Jar confusion

I need to know which jar contains the following class com.ibm.xml.jaxp.datatype.XMLGregorianCalendar kindly help me
MozenRath
  • 9,652
  • 13
  • 61
  • 104
0
votes
3 answers

Best way to close a stream an SAX parser is reading during the parsing process?

Let's get straight to my question: I have a socket and all input coming via this socket / stream is parsed by my SAX parser. Now, upon a certain parsing event I'd like to close the socket / stream from within my SAX event handler. Also, I want to…
balu
  • 3,500
  • 4
  • 34
  • 35
0
votes
1 answer

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. Example of xslt stylesheet:
Priku
  • 1
0
votes
1 answer

Querying JAXP XPath failing to find node on second call in WebSphere (JUnit works fine)

I'm checking for an element with an xml element, and will be defaulting a value if not present. This is coming in from a web service call into JAXWS on Websphere 7 as a org.apache.xerces.dom.ElementNSImpl. // instantiate xpath XPathFactory…
WellieeGee
  • 312
  • 1
  • 4
  • 13
0
votes
1 answer

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; import…
yas
  • 3,520
  • 4
  • 25
  • 38
0
votes
1 answer

Is there a way of binding a Java object in JAXP or Xalan XSLT scope?

Xalan-J lets us create and manipulate java objects using it's extension mechanism. What I want to do is to pass an already created object from Java (from the JVM that invokes Xalan) and then manipulate this object from xslt. For example, I would…
Tahir Akhtar
  • 11,385
  • 7
  • 42
  • 69
0
votes
1 answer

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.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); …
yas
  • 3,520
  • 4
  • 25
  • 38
0
votes
1 answer

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 using the jakarta.xml.soap-api 1.4.2 library for…
lordzeu
  • 31
  • 5