xerces

Xerces-C validate xml with hardcoded xsd

孤人 提交于 2020-01-19 15:17:34
问题 I'm writing a library which takes xml files and parses them. To prevent users from feeding inalid xmls into my application i'm using xerces to validate the xml files via an xsd. However, i only manages to validate against xsd-files. Theoretically an user could just open this file and mess around with it. That's why i would like my xsd to be hardcoded in my library. Unfortunately i haven't found a way to do this with XercesC++, yet. That's how it is working right now... bool XmlParser:

How to use schema component designators in xerces for java?

最后都变了- 提交于 2020-01-17 07:52:19
问题 I want to run SCD queries on a schema. The docs indicates that there is experimental support, but I don't see anything in the javadoc. Anyone know how it's supposed to work? 回答1: Checkout this wrapper on xerces. It can locate the paths as well as generate them. 来源: https://stackoverflow.com/questions/8581594/how-to-use-schema-component-designators-in-xerces-for-java

No declaration found for element

旧城冷巷雨未停 提交于 2020-01-16 16:48:13
问题 I have a simple XML and XSD files. I am using Xerces to generate .h/cpp files but when I run the application it gives an error: no declaration found for element 'x:books' My XML file is: <?xml version="1.0"?> <x:books xmlns:x="urn:books" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:BookStore books.xsd"> <book id="bk001"> <author>Writer</author> <title>The First Book</title> <genre>Fiction</genre> <price>44.95</price> <pub_date>2000-10-01</pub_date> <review>An

Android SDK Manager Java “Loading Sources” Exception on OS X

本秂侑毒 提交于 2020-01-14 06:46:20
问题 I'm trying to get started with the Android SDK on OS X 10.6.8 but can't load any packages in the SDK manager. Here's what I see in the SDK Manager: http://sarahtube.s3.amazonaws.com/20111221_Android_GUI_SDK_Manager_GUI_Java_Exception.jpg Here's my Java/JDK: $ java -version java version "1.6.0_29" Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527) Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode) Here's the exception I get on loading the SDK or trying to update

Why is Apache Xerces/Xalan adding additional carriage returns to my serialized output?

陌路散爱 提交于 2020-01-13 09:01:53
问题 I'm using Apache Xerces 2.11.0 and Apache Xalan 2.7.1 and I'm having problems with additional carriage return characters in the serialized XML. I have this (pseudo) code: String myString = ...; Document doc = ...; Element item = doc.createElement("item"); item.appendChild(doc.createCDATASection(myString)); Transformer transformer = ...; ByteArrayOutputStream stream = new ByteArrayOutputStream(); Result result = new StreamResult(stream); transformer.transform(new DOMSource(document), result);

XIncludeAwareParserConfiguration incompatible with XMLParserConfiguration

独自空忆成欢 提交于 2020-01-10 04:00:20
问题 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

Restlet client on Java 1.7 xml parse error “FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present.”

我的未来我决定 提交于 2020-01-06 19:09:14
问题 EDIT : 31/OCT/2014 The fix for this is now available in both Restlet 2.2 and master (future 2.3) branches Our Netbeans Platform Restlet client app runs okay on Java 1.6 but with 1.7.0_11, I get security runtime errors. Is there a easy way to prevent this? WARN org.restlet.log():241 - Unable to unmarshal the XML representation javax.xml.bind.JAXBException: Unable to create customized SAX source - with linked exception: [javax.xml.parsers.ParserConfigurationException: FEATURE_SECURE_PROCESSING:

dynamic_cast failed when hiding symbol

南笙酒味 提交于 2020-01-02 08:25:43
问题 I have many static libraries. One is static_lib_a.a. I create a dynamic library, dynamic_lib.so to put them together. In static_lib_a.a, it uses xerces 3.1.1 to parse xml. The following is the code snippet in static_lib_a.a xerces::DOMElement *pElementNode = dynamic_cast<xerces::DOMElement *>(pNode); The type of pNode is xerces::DOMNode. It is assigned to an object of xerces::DOMElement. This line of code will do downcasting. In order to hide all symbols of static_lib_a.a in dynamic_lib.so, I

XPath support in Xerces-C

ⅰ亾dé卋堺 提交于 2020-01-01 09:13:14
问题 I am supporting a legacy C++ application which uses Xerces-C for XML parsing. I've been spoiled by .Net and am used to using XPath to select nodes from a DOM tree. Is there any way to get access some limited XPath functionality in Xerces-C? I'm looking for something like selectNodes("/for/bar/baz"). I could do this manually, but XPath is so nice by comparison. 回答1: See the xerces faq. http://xerces.apache.org/xerces-c/faq-other-2.html#faq-9 Does Xerces-C++ support XPath? No.Xerces-C++ 2.8.0

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

风格不统一 提交于 2019-12-29 05:20:17
问题 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