Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RelaxNG vs XML Schema

Tags:

I have a project where I'm using RelaxNG (jing) to validate xml. I like the syntax for RelaxNG, but most of the tools that I have work with XML schema (actually, I don't think I have a tool that does, other than jing). Am I making a design and future support mistake by using RelaxNG when most of the support seems to be around XML schema? Should I just stick with RelaxNG and make everyone else learn it (kicking and screaming if necessary, j/k)? Should I switch to xml schema because of tool support?

Thanks.

like image 851
jmq Avatar asked Feb 14 '11 16:02

jmq


People also ask

Is XML and XML Schema same?

XML defines the syntax of elements and attributes for structuring data in a well-formed document. XSD (akaXMLSchema), like DTD before, powers the eXtensibility in XML by enabling the user to define the vocabulary and grammar of the elements and attributes in a valid XML document.

What is XML schema used for?

XML Schema Definition or XSD is a recommendation by the World Wide Web Consortium (W3C) to describe and validate the structure and content of an XML document. It is primarily used to define the elements, attributes and data types the document can contain.

How many types of XML schema are there?

Supported XML Schema data types The monitor model supports eight XML Schema data types.


1 Answers

The answers is a bit cliche: it depends.

On what, you might ask? On tools that your users will probably be using. And if you depend on your users, you might lose them if lack of good tools will drive them away. Since XML schema is, from my experience, very widely used, you might want to reconsider your decision on going forward with Relax NG. It is nicer and more easily understood than XML schema, but that doesn't mean it will make your project successful.

If you want to risk a bit, go ahead using Relax NG. And during every step of your development, try converting Relax NG to XML schema using a tool like Trang. Just in case you decide one day that Relax NG isn't worth it and you know you have a reasonable backup.

like image 95
darioo Avatar answered Oct 01 '22 08:10

darioo