xerces

XML validation against XSD 1.1 with Xerces in Java

一个人想着一个人 提交于 2019-12-01 03:47:18
I have installed Xerces through Maven: <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jdom</groupId> <artifactId>jdom</artifactId> <version>2.0.2</version> </dependency> <dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.11.0</version> </dependency> </dependencies> I then tried the code given in this example from the Xerces FAQ to validate a XML file against a schema in version 1.1. This is my code: private static void validateFile(File

不允许有匹配 "[xX][mM][lL]" 的处理指令目标

假装没事ソ 提交于 2019-11-30 17:49:26
Bug解决方案:org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 8; 不允许有匹配 "[xX][mM][lL]" 的处理指令目标 Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 8; 不允许有匹配 "[xX][mM][lL]" 的处理指令目标。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError

Maven打jar包时MANIFEST.MF文件的重要性,MANIFEST.MF文件详细介绍

主宰稳场 提交于 2019-11-30 09:07:02
打开Java的JAR文件我们经常可以看到文件中包含着一个META-INF目录, 这个目录下会有一些文件,其中必有一个MANIFEST.MF,这个文件描述了该Jar文件的很多信息。 个人理解,MANIFEST.MF文件是jar文件运行依赖的入口,maven打jar包时,MANIFEST.MF文件配置不正确,会导致项目部署失败。 如果我们把MANIFEST中的配置信息进行分类,可以归纳出下面几个大类: 一. 一般属性 1. Manifest-Version 用来定义manifest文件的版本,例如:Manifest-Version: 1.0 2. Created-By 声明该文件的生成者,一般该属性是由jar命令行工具生成的,例如:Created-By: Apache Ant 1.5.1 3. Signature-Version 定义jar文件的签名版本 4. Class-Path 应用程序或者类装载器使用该值来构建内部的类搜索路径 二. 应用程序相关属性 1. Main-Class 定义jar文件的入口类,该类必须是一个可执行的类,一旦定义了该属性即可通过 java -jar x.jar来运行该jar文件。 三. 小程序(Applet)相关属性 1. Extendsion-List 该属性指定了小程序需要的扩展信息列表,列表中的每个名字对应以下的属性 2. <extension>

problems with java installation (xerces) on mac

这一生的挚爱 提交于 2019-11-30 06:04:09
问题 I'm using MacOsX 10.6.4. Some time ago I run into problems with Eclipse (it wouldn't start anymore - I opened a question here and followed all the suggestion but with no luck). Then I also run into very similar problems with other java applications, of which the last one is the android sdk. All these problems seem to be related with xerces/xml, as the following exception shows (just running tools/android and clicking on the "available updates" button): Exception in thread "Loading Source"

Validating document in Xerces C++

泪湿孤枕 提交于 2019-11-29 18:36:48
I want to load an XML document in Xerces-C++ (version 2.8, under Linux), and validate it using a DTD schema not referenced from the document. I tried the following: XercesDOMParser parser; parser.loadGrammar("grammar.dtd", Grammar::DTDGrammarType); parser.setValidationScheme(XercesDOMParser::Val_Always); parser.parse("xmlfile.xml"); But it doesn't indicate an error if the document is not valid. What am I missing? You'll need to set an error handler before calling parse if you want to see anything: Handler handler; parser.setErrorHandler( &handler ); where Handler is a class derived from

after update Apache POI 4.0 - Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized

冷暖自知 提交于 2019-11-29 12:51:26
After updating Apache POI from 3.17 to 4.0.0 i'm getting on line: OPCPackage pck = OPCPackage.open(this.getTemplate()); an exception: java.lang.IllegalArgumentException: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized. at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.setAttribute(DocumentBuilderFactoryImpl.java:144) at __redirected.__DocumentBuilderFactory.setAttribute(__DocumentBuilderFactory.java:125) at org.apache.poi.ooxml.util.DocumentHelper.trySetXercesSecurityManager(DocumentHelper.java:143) at org.apache.poi.ooxml.util.DocumentHelper.

XIncludeAwareParserConfiguration incompatible with XMLParserConfiguration

你说的曾经没有我的故事 提交于 2019-11-29 10:55:54
I get this error when deploying the ear file on to WLS 10.3 on AIX platform. The same ear works fine on Windows/Linux platforms. Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration incompatible with org.apache.xerces.xni.parser.XMLParserConfiguration at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source) at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source) at weblogic.xml.jaxp

How can I parse XML that confirms to the 1.1 spec using Java and Xerces?

Deadly 提交于 2019-11-29 07:53:49
I'm trying to parse a String which contains XML content which conforms to the XML 1.1 spec . The XML contains character references which are not allowed in the XML 1.0 spec but which are allowed in the XML 1.1 spec (character references which translate to Unicode characters in the range U+0001–U+001F). According the Xerces2 website, the Xerces2 parser supports parsing XML 1.1 documents. However, I cannot figure out how to tell it the XML we are trying to parse contains 1.1-compliant XML. I'm using a DocumentBuilder to parse the XML (something like this): public Element parseString(String

XercesImpl in conflict with JavaSE 6's internal xerces implementation. Both are needed… what can be done?

五迷三道 提交于 2019-11-29 01:56:41
I am sure that I am not the first to encounter this conflict. The code that I have inherited does the following: org.w3c.dom.Document dom; // declaration javax.xml.validation.Schema schema; // declaration ... ... ... javax.xml.validation.Validator validator = schema.newValidator(); validator.validate(new DOMSource(dom)); where the ... stands for seemingly unimportant/irrelevant code Compiling and running the code with JDK 6 works (and always had...) Recently I have had to integrate into my code another component written elsewhere in the company. That component absolutely requires the inclusion

problems with java installation (xerces) on mac

徘徊边缘 提交于 2019-11-28 14:17:30
I'm using MacOsX 10.6.4. Some time ago I run into problems with Eclipse (it wouldn't start anymore - I opened a question here and followed all the suggestion but with no luck). Then I also run into very similar problems with other java applications, of which the last one is the android sdk. All these problems seem to be related with xerces/xml, as the following exception shows (just running tools/android and clicking on the "available updates" button): Exception in thread "Loading Source" java.lang.AbstractMethodError: org.apache.xerces.dom.DeferredElementNSImpl.getTextContent()Ljava/lang