[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Use DTDs!

  • From: Hans-Juergen Rennau <hrennau@yahoo.de>
  • To: "Costello, Roger L." <costello@mitre.org>, "xml-dev@l..." <xml-dev@l...>
  • Date: Mon, 2 May 2016 14:33:29 +0000 (UTC)

Re:  Use DTDs!
In general, it is quite feasible to design an XML format which defines the model to be represented by XSD in a very compact and readable way - resembling closely the instance documents described by the XSD - and generate the XSD from such "XSD design" documents. A simple example:

<x:xsdd xmlns:x="http://www.xsdr.org/ns/xsdd" ...>
    <x:stypes>
        <x:stype name="LocaleOrLangType" typeDesc="#[a-z]{2}(-[A-Z]{2})?#"/>
        ...
    </x:stypes>

    <TravelAgenciesRQ>
        <RQ_Metadata Language="$LocaleOrLangType" RequestID="xs:string" TransactionID="xs:string"
            >#empty</RQ_Metadata>
        <TravelAgencyFilter x:occ="?">
            <x:_choice_>
                <TravelAgencyIDs>
                    <TravelAgencyID x:occ="+">$NonEmptyString32</TravelAgencyID>
                </TravelAgencyIDs>
                <TravelAgencyShortNames>
                    <TravelAgencyShortName x:occ="+">$NonEmptyString</TravelAgencyShortName>
                </TravelAgencyShortNames>
            </x:_choice_>
        </TravelAgencyFilter>
    </TravelAgenciesRQ>
</x:xsdd>

In fact, as a rule I do not write XSDs any more, but write xsdd (XSD design) documents instead.

Cheers,
Hans-Jürgen


"Costello, Roger L." <costello@mitre.org> schrieb am 15:33 Montag, 2.Mai 2016:


The unofficial compact syntax for XSD <http://dret.net/projects/xscs> is even simpler:
 
element altitude { (xs:string)
    required attribute units {"feet", "meters"}
}
 
I like it!
 
Are there validating engines which validate XML instances against schemas that are specified using this compact syntax?
 
Are people using this compact syntax in real-world applications?
 
/Roger
 
From: John Cowan [mailto:johnwcowan@gmail.com]
Sent: Monday, May 02, 2016 9:24 AM
To: Costello, Roger L. <costello@mitre.org>
Cc: xml-dev@lists.xml.org
Subject: Re: Use DTDs!
 
 
On Mon, May 2, 2016 at 7:49 AM, Costello, Roger L. <costello@mitre.org> wrote:
 
<!ELEMENT altitude (#PCDATA)>

<!ATTLIST altitude
             units (feet|meters) #REQUIRED>


The unofficial compact syntax for XSD <http://dret.net/projects/xscs> is even simpler:
 
element altitude { (xs:string)
    required attribute units {"feet", "meters"}
}
 
XSD has plenty of problems, but it shouldn't be blamed for the verboseness of XML as a language notation.
 
--
GMail doesn't have rotating .sigs, but you can see mine at http://www.ccil.org/~cowan/signatures



  • References:

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.