xerces

Problem with NetBeans Web Service Client when xercesImpl.jar is on classpath

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 09:55:03
问题 I am unable to create a Web Service Client in my NetBeans Web Application when xercesImpl.jar is included as a library. Using NetBeans 6.9 and GlassFish 3.0.1: 1.) Create new Web Application 2.) Create a new Web Service 3.) Add a new operation to the created web service (just let it return null - the implementation isn't important) 4.) Deploy web service to GlassFish (works fine) 5.) Add xercesImpl.jar (I'm using version 2.9.1) as a library to the web service (I need xerces for a third-party

WARNING: unrecognized options: --disable-netaccessor-libcurl

情到浓时终转凉″ 提交于 2019-12-23 02:57:24
问题 I am trying to install Xerces-C to my Shibboleth 2 SP following this guide: https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPLinuxSourceBuild But when i run: ./configure --prefix=/opt/shibboleth-sp --disable-netaccessor-libcurl i get this warning: WARNING: unrecognized options: --disable-netaccessor-libcurl [...] config.status: creating src/xercesc/util/Xerces_autoconf_config.hpp config.status: src/xercesc/util/Xerces_autoconf_config.hpp is unchanged config.status: executing

ElementNSImpl to String

血红的双手。 提交于 2019-12-22 06:45:06
问题 I have a client that calls a web-service and I'm getting back an ElementNSImpl object. Would it be possible to transform this object to String? For a org.w3c.dom.Document object I've used such code: protected static String documentToString(final Document doc) { // outputs a DOM structure to plain String try { StringWriter sw = new StringWriter(); TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer = tf.newTransformer(); transformer.setOutputProperty(OutputKeys

Repairing wrong encoding in XML files

↘锁芯ラ 提交于 2019-12-21 19:42:27
问题 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 the following exception: org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8 sequence. Is there a way to "capture" these problems early and avoid the

Workaround for XMLSchema not supporting maxOccurs larger than 5000

大憨熊 提交于 2019-12-21 12:59:02
问题 My problem is with parsing an XSD Schema that has elements with maxOccurs larger than 5000 (but not unbounded ). This is actually a know issue in either Xerces (which I'm using, version 2.9.1) or JAXP, as described here: http://bugs.sun.com/view_bug.do;jsessionid=85335466c2c1fc52f0245d20b2e?bug_id=4990915 I already know that if I changed the maxOccurs numbers in my XSD from numbers larger than 5000 to unbounded all works well. Sadly, this is not an option in my case (I cannot meddle with the

How do I turn off validation when parsing well-formed XML using DocumentBuilder.parse?

我的未来我决定 提交于 2019-12-21 11:30:22
问题 I'm using Java 6. I want to parse XHTML that I know is well-formed. As such, I don't want to do any validation against DTD's or other schemas referenced in the doc. However, I'm having trouble figuring out how to turn that validation off. I have DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(false); final DocumentBuilder b = factory.newDocumentBuilder(); final InputSource s = new InputSource(new StringReader(str)); org.w3c.dom.Document result = b

writing XML with Xerces 3.0.1 and C++ on windows

狂风中的少年 提交于 2019-12-18 18:04:36
问题 i have the following function i wrote to create an XML file using Xerces 3.0.1, if i call this function with a filePath of "foo.xml" or "../foo.xml" it works great, but if i pass in "c:/foo.xml" then i get an exception on this line XMLFormatTarget *formatTarget = new LocalFileFormatTarget(targetPath); can someone explain why my code works for relative paths, but not absolute paths please? many thanks. const int ABSOLUTE_PATH_FILENAME_PREFIX_SIZE = 9; void OutputXML(xercesc::DOMDocument*

Serialize DOM to FileOutputStream using Xerces

雨燕双飞 提交于 2019-12-18 04:45:10
问题 I am using this link to generate XML file using DOM. It says that "Xerces parser is bundled with the JDK 1.5 distribution.So you need not download the parser separately." However, when I write the following line in my Eclipse Helios it gives compile-time error even though I have Java 1.6 in my system. import org.apache.xml.serialize.XMLSerializer; Why is it so? 回答1: Xerces is indeed bundled with the JDK but you should use it with the JAXP API under javax.xml.parsers . Check the output of the

How to prevent xalan.jar that has META-INF\services\javax.xml.transform.TransformerFactory from taking over JDK 1.6 built in Xalan implementation?

耗尽温柔 提交于 2019-12-17 19:53:35
问题 Consider this code (based entirely on flying saucer's "getting started" code, their rights reserved): package flyingsaucerpdf; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStream; import org.xhtmlrenderer.pdf.ITextRenderer; public class PDFMaker { public static void main(String[] args) throws Exception { new PDFMaker().go(); } public void go() throws Exception { String inputFile = "sample.html"; String url = new File(inputFile).toURI().toURL().toString(); String

why org.apache.xerces.parsers.SAXParser does not skip BOM in utf8 encoded xml?

放肆的年华 提交于 2019-12-17 16:58:07
问题 I have an xml with utf8 encoding. And this file contains BOM a beginning of the file. So during parsing I am facing with org.xml.sax.SAXParseException: Content is not allowed in prolog. I can not remove those 3 bytes from the files. I can not load file into memory and remove them here (files are big). So for performance reasons I'm using SAX parser and want just to skip those 3 bytes if they are present before "" tag. Should I inherit InputStreamReader for this? I'm new in java - show me the