473,440 Members | 2,835 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,440 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 14671
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...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.