Re: Why a DTD and not a XML-Schema ?

Low Zhen Lin <[email protected]> Thu, 18 Dec 2003 23:50:26 +0800
Newsgroups gmane.linux.zynot.general,gmane.linux.zynot.devel
Message-ID <[email protected]>
--===============1630572285==
Content-type: multipart/alternative;
	boundary="Boundary_(ID_m6CbmP+xRGmtEc3+g6gfzA)"


--Boundary_(ID_m6CbmP+xRGmtEc3+g6gfzA)
Content-type: text/plain; charset=ISO-2022-JP; format=flowed
Content-transfer-encoding: 7BIT


On Thursday, December 18, 2003, at 11:35  PM, [email protected] wrote:

> Hi everybody,
>
>
> I am new to this mailing list and I hope I would be able to help
> Xeta development team.
>
> After a short discussion with "theDevil-" on IRC I would like to know,
> why you have decided to use a DTD for Xbuild and not an XML-Schema ?
>
> IMHO, DTD is document oriented and not application orientated like 
> XML-Schema.
>
> How do you make the difference between :
>
> "10 april 2004" and "10/04/2004" or "04/10/2004" if they all are
> PCDATA ?
>
> XML-Schema allows you strong typing for your attributes or elements 
> (and therefore
> IMHO it is much safer).
>
> To use XML-SCHEMA from C++ there is, for example, two open source 
> libraries like :
> Xerces-C++ http://xml.apache.org/xerces-c/
> or
> Gnome's one : http://www.xmlsoft.org/ (C and not C++ oriented)
> allowing C++ programs parsing easly XML files.
>
> Do you plan to use one of them ? to write a new one ? Or to use 
> another one ?
>
> As short example of what you can do with XML-Schema you may read this :
> http://www.xml.com/pub/a/2000/11/29/schemas/part1.html
>
> Thank you to let me know what are your points of view and be lenient 
> with
> a new mailing list subscriber.
> I do not want to make a "troll" or to create
> (again?) a passionate discussion  on the subject if the subject is 
> closed.

I know of the advantages. However - the fact is that there is a lot 
more to validate than just types. I'd rather leave typed validation to 
the specialised validating tool, and well-formedness to the generic 
validator.

Feel free to write an XML schema on it... I have a feeling that XML 
schemas are less supported by the generic validators. If you can write 
a XML schema that can functionally replace all the DTDs - and fit into 
a <!DOCTYPE> declaration, we might take that instead.

Truth is, I didn't even need to write a DTD. DTDs are just the most 
convenient way for me to give a specification.

There are also areas DTD can do that XML schema can't. I just can't 
remember them... I think they had to do with attributes.

We are using libxml2 - it is sufficiently fast for our needs, and has a 
very reasonable license.

By the way: I see "April 14 2003", "20030414", "二千零三年四月十四日", 
"14/04/2003", and "04/14/2003" to be the same thing: a date, referring 
to the 14th day of the 4th month of the 2003rd year AD of the Gregorian 
calendar. There was a nastier spec about time elsewhere, I think it was 
XSLT - a nightmare to implement given all the different calendars and 
languages. (But I do see "01/04/2004" to be ambiguous. I usually read 
that as April 1st 2004)

All followups to [email protected].

--Boundary_(ID_m6CbmP+xRGmtEc3+g6gfzA)
Content-type: text/enriched; charset=ISO-2022-JP
Content-transfer-encoding: 7BIT



On Thursday, December 18, 2003, at 11:35  PM, [email protected] wrote:


<excerpt>Hi everybody,



I am new to this mailing list and I hope I would be able to help

Xeta development team.


After a short discussion with "theDevil-" on IRC I would like to know,

why you have decided to use a DTD for Xbuild and not an XML-Schema ?


IMHO, DTD is document oriented and not application orientated like
XML-Schema.


How do you make the difference between : 


"10 april 2004" and "10/04/2004" or "04/10/2004" if they all are

PCDATA ?


XML-Schema allows you strong typing for your attributes or elements
(and therefore 

IMHO it is much safer).


To use XML-SCHEMA from C++ there is, for example, two open source
libraries like : 

Xerces-C++ http://xml.apache.org/xerces-c/

or 

Gnome's one : http://www.xmlsoft.org/ (C and not C++ oriented)

allowing C++ programs parsing easly XML files.


Do you plan to use one of them ? to write a new one ? Or to use
another one ?


As short example of what you can do with XML-Schema you may read this :

http://www.xml.com/pub/a/2000/11/29/schemas/part1.html


Thank you to let me know what are your points of view and be lenient
with

a new mailing list subscriber. 

I do not want to make a "troll" or to create 

(again?) a passionate discussion  on the subject if the subject is
closed.

</excerpt>

I know of the advantages. However - the fact is that there is a lot
more to validate than just types. I'd rather leave typed validation to
the specialised validating tool, and well-formedness to the generic
validator.


Feel free to write an XML schema on it... I have a feeling that XML
schemas are less supported by the generic validators. If you can write
a XML schema that can functionally replace all the DTDs - and fit into
a <<!DOCTYPE> declaration, we might take that instead.


Truth is, I didn't even need to write a DTD. DTDs are just the most
convenient way for me to give a specification.


There are also areas DTD can do that XML schema can't. I just can't
remember them... I think they had to do with attributes.


We are using libxml2 - it is sufficiently fast for our needs, and has
a very reasonable license.


By the way: I see "April 14 2003", "20030414",
"<fontfamily><param>Hei</param>二千零三年四月十四日", "14/04/2003", and
"04/14/2003" to be the same thing: a date, referring to the 14th day
of the 4th month of the 2003rd year AD of the Gregorian calendar.
There was a nastier spec about time elsewhere, I think it was XSLT - a
nightmare to implement given all the different calendars and
languages. (But I do see "01/04/2004" to be ambiguous. I usually read
that as April 1st 2004)


All followups to [email protected].</fontfamily>

--Boundary_(ID_m6CbmP+xRGmtEc3+g6gfzA)--

--===============1630572285==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xeta mailing list
[email protected]
http://lists.zynot.org/mailman/listinfo/xeta

--===============1630572285==--