xerces

error in one line Xerces program

The following application gives me an access violation on its first line, whats with that? // test.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <xercesc/util/XMLString.hpp> using namespace xercesc; int main() { XMLCh* path= XMLString::transcode("test.xml"); ...

Exception in two line Xerces program

The following code gives me an exception on the XMLFormatTarget line, but if I change the string from "C:/test.xml" to "test.xml" it works fine. // test.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <xercesc/util/XMLString.hpp> #include <xercesc/framework/LocalFileFormatT...

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

Hi all, 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)); w...

Xerces - XmlString to Dom object

I am trying to convert an Xml String to XML DOM object using Xerces (xercesImpl-2.8.1.jar). But it seems that it provides only following methods, it does not offer a method that would take an XML string and convert it to an Object. parse(File f) parse(InputSource is) parse(InputStream is) parse(String uri) Any pointers would be g...

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

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.)...

Xerces C++ - no error for non-existent file

Hi, I'm using the Xerces C++ DOM parser to read some XML files in a Visual C++ project. I have a class with a parse() method that is supposed to read and validate my XML source file. This is what the method looks like: #include <xercesc/util/PlatformUtils.hpp> #include <xercesc/dom/DOM.hpp> #include <xercesc/parsers/XercesDOM...

Get default value for element from schema using xerces (C++)

Hi, Say I have a schema which defines an element as follows: <xsd:element name="Widget" type="tns:WidgetType" /> <xsd:complexType name="WidgetType"> <xsd:sequence> <xsd:element name="Name" type="xsd:normalizedString" maxOccurs="1" minOccurs="1" /> <xsd:element name="Description" type="xsd:normalizedString" default="Unknown" ...

Xerces-C++ DOM node line/column number location

Hi, I'm writing a custom XML validator using Xerces-C++. My current approach loads the document into a DOM, and then checks are performed on it. What I need is a way to access the line/column number of a node in the DOM. I've been reading the API docs and googling, but I'm coming up short. Is it possible to somehow retrieve this kind of...

Can't call getElementsByTagName on a node in Xerces or Neko?

hi all I'm trying to parse a DOM tree using Neko/Xerces in Java. NodeList divs = this.doc.getElementsByTagName("DIV"); for(int i=0; i < divs.getLength(); i++) { NodeList images = divs.item(i).parentNode().getElementsByTagName("IMG"); // operate on these } is what I'd ideally like to do. It seems I can only call getElementsByT...

Configure Xerces SAX parser to tolerate an XML syntax error

I am getting this error when parsing an incorrectly-generated XML document: org.xml.sax.SAXParseException: The value of attribute "bar" associated with an element type "foo" must not contain the '<' character. I know what is causing the problem. It is this line: <foo bar="x<y">42</foo> It should have been <foo bar="x&lt;y">42</fo...

Building Xerces 2.8.0 on AIX 5.3 using gcc and g++

Hi All I am trying to compile and create a library using the Xerces 2.8.0 source code and compile it on AIX 5.3 using gcc and g++. I have tried various forums to try and resolve the error that is shown below including changing the makeC++Sharelib with g++ in my Makefile.incl. ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtai...

problems with java installation (xerces) on mac

Hello 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 w...

How can I validate the XML document in a SAXParser without having to use an XMLReader?

I want to create a SAXParser which validates, but it seems the only way is either to create an XMLReader and use setErrorHandler() or let the ContentHandler in SAXParser.parse() also implement ErrorHandler. Am I missing something? All I want to do is create a validating SAXParser like this: private SAXParser createParser(final boolean ...

Spring / ActiveMQ schema validation from behind a proxy

Hello, I'm trying to run this JAX-RS web services which uses ActiveMQ and Spring, and have some definitions relating to both in the Spring context xml file. If i'm not behind a proxy, everything runs fine. However, when i'm behind a proxy, I get the following validation error: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The ...

what does "When <simpleContent> is used, the base type must be a complexType whose content type is simple..." mean?

heres the whole error I keep getting from xerces.... When is used, the base type must be a complexType whose content type is simple, or, only if restriction is specified, a complex type with mixed content and emptiable particle, or, only if extension is specified, a simple type. 'string' satisfies none of these conditions. I thought ...

How can I use use endorsed jars for one part of application and classpath jars for another?

In a environment the following jars have been endorsed because a particular module for SingleSignOn uses these versions of jars: - • xercesImpl-2.9.1.jar • serializer-2.9.1.jar • xml-apis-2.9.1.jar • xalan-2.7.1.jar • resolver-2.9.1.jar These endorsed jars are creating a problem as now these jars are used for parsing and not the corre...

Why can't I use values of nodes I retrieve by using exsl:node-set/set:distinct in an XPath-Expression?

Hello there. In a xslt-stylesheet I'm using the methods exsl:node-set and set:distinct to access and filter unique nodes from a variable that contains a result tree fragment. I can write the values of these nodes into my output file, example: <xsl:variable name="myNodes"> <xsl:call-template name="getNodes"/> </xsl:variable> <xsl:for...

libxml2 from java

Hi, This question is somewhat related to http://stackoverflow.com/questions/530064/fastest-xml-parser-for-small-simple-documents-in-java but with a few more specifics. I'm working on an application which needs to parse many (10s of millions), small (approx. 300k) xml documents. The current implementation is using xerces-j and it takes...

pass Node to Xerces' setParameter()

Hi all, I try pass a node as xsl stylesheet parameter to Xerces XSL Transformer transformer.setParameter("settings", nodeSettings); in xsl: But i receive the following Exception: javax.xml.transform.TransformerException: java.lang.RuntimeException: Invalid conversion of 'com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl'...

Xerces C++ XML: escape is really hard to do?

I am using Xerces library, everything is fine to use but now I want to escape the XML string and I found there is a XMLFormatter class used for that, after I dig into the doc, I see it is really hard to use from the constructor perspective. What I want is just 2 functions: string escape(string); string unescape(string); why xerces mak...