views:

169

answers:

3

I've been working with code synthesis xsd to generate an xml tree to ensure constinency of the xml output to the original xsd.

After initial testing, everything looked ok but when I tried entering invalid values (correct type, but outside the defined range), the values were allowed.

Although the xml is well formed and conforms to the types set in the xsd, it is not a valid xml wrt the schema.

Has anybody else used this tool and/or come up across this problem?

A: 

You'll want to provide some examples here to get a detailed response, but for now I think it's fair to say that all bets are off if your document doesn't validate according to the schema.

Remember it's the parser which does the schema validation, not Code Synthesis XSD (which by the way, is a terrible product name because it is difficult to use unambiguously!).

Alastair
What do you mean unambiguously? Also - the point of code synthesis XSD is to parse your schema doc and design code that corresponds to the schema, so in escence, it is the parser.This question was generally worded to see if this is a general problem with the tool
Fry
as for the name, if you google "generate c++ from xsd", this is the first, most prevalent and most celebrated tool that I was able to find. I agree though, the product could be called better than "XSD"
Fry
A: 

The tool may not do the sort of checking you want when creating the document.

If your document is small, you may just want to generate the XML,then re-parse it with XSD checking on and let that be your checking.

David Norman
CodeSynthesis says it generates code that will conform to the schema and create valid XMLs. After looking at the definition of "Valid", I now believe it creates "correct" rather than "valid" XMLs. I was just waiting for somebody to say that to mark it as answered :)
Fry