473,386 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Lightweight XSD validation

Dear all,
I'm using XML in a project. This is a very simple and small file that
follows an even simpler XSD schema. I've found a lightweight library
(TinyXML) to read and access the contents of the XML file in C++.
Now I'm looking for something similar to validate a given XML file
agains a XSD schema. This library should:
- be lightweight (!)
- thus not depend on xerces, MSXML and similar
- cross-platform (g++) compatible
- can use STL (this would be a nice-to-have)
Any idea would be greatly appreciated.
With best regards, Martin.
Aug 3 '06 #1
2 14667
Hi Martin,

Martin Halle <ma**********@gmx.netwrites:
I'm using XML in a project. This is a very simple and small file that
follows an even simpler XSD schema. I've found a lightweight library
(TinyXML) to read and access the contents of the XML file in C++.
Now I'm looking for something similar to validate a given XML file
agains a XSD schema.
General-purpose XML Schema validators are usually neither simple nor
lightweight ;-). You might be interested in the so called "perfect
parser" approach where the validation code is generated by a tool
specifically for your schema. If your schema is fairly simple then
the resulting code will be small as well. A well-implemented perfect
parser will also perform several times faster than general-purpose
validators.

One such tool is CodeSynthesis XSD[1] and its C++/Parser mapping[2]
(full disclosure: I am working on this project). It is an open-source
(GPL + proprietary license), cross-platform XML data binding compiler
for C++.

This library should:
- be lightweight (!)
Executable size for a small schema (our benchmark) is around 250K.

- thus not depend on xerces, MSXML and similar
It uses Expat as the underlying XML parser. Expat is fairly small
and is the fastest among Xerces-C++, MSXML, and libxml2.

- cross-platform (g++) compatible
Check. See the list of supported platforms and compilers[3].

- can use STL (this would be a nice-to-have)
Uses standard C++ and STL.
[1] http://codesynthesis.com/products/xsd/
[2] http://codesynthesis.com/products/xsd/c++/parser/
[3] http://codesynthesis.com/products/xsd/platforms.xhtml
hth,
-boris
Aug 3 '06 #2
Dear Boris,

thank you for your answer.
One such tool is CodeSynthesis XSD[1]
and its C++/Parser mapping[2]
Guess what: When doing the "googleing" this was the one that came
closest to what I had in mind. I'm glad you point to this, too. I was
hoping that there is an even smaller one but I understand the complexity
of a XML schema validation. Hence what would be enough for me is a
structure, data-type and data-range check in a fairly XML flat structure
and that would be it. Anyway, thanks a lot for your answer - so I guess
I'll stick with [1] and [2] and give it another try. (I had some
troubles compiling this in the first place but I'll try again...)

With best regards, Martin.
Aug 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jeremy Hylton | last post by:
Lightweight Languages 2004 (LL4) http://ll4.csail.mit.edu/ Dec. 4, 2004 MIT, Cambridge MA Call for Presentations LL4 will be an intense, exciting, one-day forum bringing together the best...
2
by: build | last post by:
G'day all, I want to load comma sep text files and display it in a grid. I'd like something simple and lightweight. Don't need to edit it in grid, I could do that in textboxes if required. tia...
1
by: Guinness Mann | last post by:
Greetings, I'm working in VS2003.NET using C#. I need to download a few rows from an SQL Server database table and then be able to page back and forth through them. I don't need to make any...
0
by: tjr7933 | last post by:
Has anyone implemented the OMG lightweight log spec into a c++ application? #! rnews 1946 Xref: xyzzy comp.lang.lisp:150483 Newsgroups: comp.lang.lisp Path: xyzzy!nntp From: Jeffrey Cunningham...
3
by: Ramza Brown | last post by:
I am sorry if I think like this, but sometimes(keyword sometimes) I like distributing my interpreters. Anyway, I found the absolute minimum libraries needed for Python to work with Win32. And,...
2
by: MS News | last post by:
Hello When I spawn a lightweight process on a new Thread and return immediately to the Client what happens if the lightweight process takes an hour to finish? Under what context is the process...
11
by: garyusenet | last post by:
I have 'cli via c# on order', and in the mean time am reading 'Pro C# 2005 and the .NET platform' (Andrew Troelson). I'm just reading about the 'five types defined in the CTS'. Specifically Struct....
12
by: javaBookWorm | last post by:
import java.applet.Applet; import java.awt.*; // Contains all of the classes for creating user interfaces and for painting graphics and images. import java.awt.event.*;//The root event class for...
3
by: javaBookWorm | last post by:
import java.applet.Applet; import java.awt.*; // Contains all of the classes for creating user interfaces and for painting graphics and images. import java.awt.event.*;//The root event class for...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.