xerces

ArrayIndexOutOfBoundsException in XMLEntityScanner.peekChar reading XML from HttpRequest

I'm reading XML data from the HttpServletRequest in my servlets doPost() and passing the Reader from req.getReader() to a JAXB unmarshaller. I've tried a couple of different input XMLs but I always get this exception. SEVERE: Servlet.service() for servlet RESTPhotoAdmin threw exception java.lang.ArrayIndexOutOfBoundsException: 8192 ...

Repairing wrong encoding in XML files

One of our providers are sometimes sending XML feeds that are tagged as UTF-8 encoded documents but includes characters that are not included in the UTF-8 charset. This causes the parser to throw an exception and stop building the DOM object when these characters are encountered: DocumentBuilder.parse(ByteArrayInputStream bais) throws...

How to create an empty DOMElement

I am using Xerces-c in my project, and would like to create a single DOMElement without having to create a whole new DOMDocument. Is such a thing possible? ...

é is not correctly parsed

My application will read xml from urlconnection. The xml encoding is ISO-8859-1, it contains é character. I use xerces saxparser to parse received xml content. However, é can not be parsed correctly while running application under lunix OS. Everything works fine in Windows. Could you guys please give me some hints? Thanks a lot ...

How do I include a DTD in an XML file that will be loaded using getResourceAsStream()?

I have an xml file ('videofaq.xml') that defines a DTD using the following DOCTYPE <!DOCTYPE video-faq SYSTEM "videofaq.dtd"> I am loading the file from the classpath (from a JAR actually) at Servlet initialization time using: getClass().getResourceAsStream("videofaq.xml") The XML is found correctly, but for the DTD in the same pac...

Why does Grails need Xerces?

We had in a grails-project problems with different XML-libraries clashing. The solution was to delete xercesImpl.jar from $GRAILS_HOME/lib. Grails does work well without it. So my question is, why was the xerces-library in the grails-distribution in the first place? ...

How do I handle xslt script code samples?

I'm getting fatal error http://www.w3.org/2006/xqt-errors#XPTY0004 in XSLT scripts I've created using Notepad, UltraEdit or Help text published to the web. These tools show nothing no strange characters, but the script breaks unless I manually edit the input so it is all on one line (usually need tor recreate every blank character). Tedi...

Is it possible to get the current line number when parsing an XML document with Xerces ?

I have a java program that parses an XML document using xerces API. My parsing class extends org.apache.xerces.parsers.XMLDocumentParser, overloading the startElement, endElement, characters methods. Since it's a complicated XML document that is written by hand (mainly some kind of configuration elements), classic validation by xsd or ...

How can I view DOMString (from apache xerces library) in MS visual studio debugger?

I am working on code (legacy code) which uses Apache Xerces-C library. I am trying to view the value of DOMString (and other related DOM objects) in Microsoft Visual Studio Debugger but in vain. I have tried the following 1) I Added the following in the autoexp.dat file: ;---------------------------------------------------------------...

Xerces/Xalan: UNC path as argument for document function?

I'm transforming an XML document by using Xerces-C 2.5 and Xalan-C 1.8. The XSL contains a "document" function, that references a file on the network. Unfortunately I cannot access this file by HTTP. I've only got the UNC path. Xerces refuses to parse the referenced document, because WinSockNetAccessor::makeNew is called in Xerces as th...

XML Serialization of DOM Portions with Xerces C++

I've been struggling quite a bit with Xerces C++ and my unfamiliarity with all that is XML, but I need to use XML for a project I'm working on. My question is how do I serialize portions of a DOM tree that I have already parsed and created of out of a XML instance document (validated against a schema I wrote) so that I can create many n...

getting XML data from Xerces (c++)

I am a latecomer to XML - have to parse an XML file. Our company is using xerces already so I managed to cobble together a sample app (SAX) that displays all the data in a file. However, after parsing is complete I was expecting to be able to call the parser or some other entity that had an internal representation of the file and itera...

JAXP XIncludes with xpointer() scheme

Is there a way to use the xpointer() scheme with JAXP? The Xcerces FAQ states that only element() is supported (http://xerces.apache.org/xerces2-j/faq-xinclude.html). But i need to resolve those XIncludes because i have to deal with "legacy" documents. ...

StackOverflowError on Solaris but not on Linux/Windows

I have a Java application that parses a large xml schema (.xsd) using Xerces that runs fine on Linux and Windows but gives a StackOverflowError on Solaris, with exactly the same inputs and configuration. I know that Xerces uses recursion to validate xml schemas but since it didn't give any problems on Windows and Linux I was pretty confi...

Delphi "DOMVendor" Open XML and Xerces: known limitations?

Is it safe to use Open XML instead of MSXML as the DOM Vendor with Delphi's IXMLDocument interface? Are there known limitations in basic functionality which I should be aware of? And how do the Open XML and Xerces implementations differ? (Xerces needs additional libraries, while Open XML seems to be included in the executable iirc) ...

Xerces: How to merge duplicate nodes?

My question is this: If I have the following XML: <root> <alpha one="start"> <in>1</in> </alpha> </root> and then I'll add the following path: <root><alpha one="start"><out>2</out></alpha></root> which results in <root> <alpha one="start"> <in>1</in> </alpha> </root> <root> <alpha one="start"> <out>2</out> ...

org.apache.xerces.jaxp.SAXParserFactoryImpl not found when importing Gears API in GWT

I've created a GWT project using Eclipse which was working perfectly (I was able to run it in both Hosted Mode and on Google App Engine) until I tried to import the Gears API for Google Web Toolkit. After adding the following line to my java source file: import com.google.gwt.gears.client.geolocation.Geolocation; I get the following ...

Sub-elements and namespaces in XSD

I've been trying to figure out how to use an XML Schema to validate XML files as I load them into an application. I've got that part working, but I can't seem to get the schema to recognise anything other than the root element as valid. For instance, I have the following XML file: <fun xmlns="http://ttdi.us/I/am/having/fun" xmlns...

Secure XML Parsers

In typical Java applications, the XML parsers is XALAN/XERCES but they were not written with security in mind. I am curious to know if there are parsers that are more robust when it comes to security. ...

In java, how do I create my own xml subclassed elements in a DOM returned by 3rd party tools.

So I'm using HTMLCleaner which returns a org.w3c.dom compatible DOM. Now, I want to insert my own subclassed Elements (which implement additional functionality outside the dom) into this dom tree. Is this possible? If you use the Document.createElement(), you can't say that you want it to create your implementation of an element. Ideall...