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

Re: Element content

  • From: Wayne Steele <xmlmaster@h...>
  • To: Mick.McRae@a..., xml-dev@l...
  • Date: Tue, 13 Mar 2001 18:27:08 -0800

mick mcrae

A DTD cannot express this constraint.
Anywhere CDATA can occur, an empty string is equally welcome.

If you have a lot of constraints that you cannot express using DTDs, you 
might want to look at Schematron:
   http://www.ascc.net/xml/resource/schematron/schematron.html


-Wayne Steele



>From: Mick McRae <Mick.McRae@a...>
>To: xml-dev@l...
>Subject: Element content
>Date: Wed, 14 Mar 2001 12:33:52 +1100
>
>Non-empty elements.
>
>I have a basic XML document which references a DTD.  The document may have 
>some tags as follows;
>
><?xml version="1.0" encoding="UTF-8"?>
><!DOCTYPE StaffReport SYSTEM "file:/opt/app/java/staff.dtd">
><StaffReport>
>   <Person>
>     <Firstname>Mick</Firstname>
>     <MiddleName></MiddleName>
>     <Surname></Surname>
>   <Person>
></StaffReport>
>
>
>Is it possible within the DTD to specify that certain elements cannot be 
>empty?  For example, in the sample XML above, I would like 
><MiddleName></MiddleName> to be valid, as a middle name is not required, 
>but <Surname></Surname> not valid, as a surname is required.  Can I do this 
>or do I need to explicity test for the tag name and length when pasring the 
>document using SAX?
>
>Any help appreciated?
>
>Regards,
>Mick
>
>*******************************************************************
>                                                    WARNING
>
>The information contained in this email and any files attached may be
>confidential  information to the intended recipient and may be the
>subject of legal privilege or  public interest immunity.
>
>If you are not the intended recipient, any use, disclosure or copying is
>unauthorised.
>
>If you have received this document in error please notify the sender
>immediately and delete it from your InBox.
>
>Mail and Attachments are subject to content scanning for inappropriate
>material including, but are not limited to, the transmission of DEFAMATORY,
>OBSCENE or HARASSING messages.
>
>Inappropriate message use will be referred to the senders' Organisation or
>ISP for further action.
>
>This footnote also confirms, In accordance with ABCI Corporate IT Security
>Policy, MIMEsweeper has swept the email message for the presence of
>known computer viruses. This process does not guarantee the email is free 
>from viruses
>
>*******************************************************************
>
>------------------------------------------------------------------
>The xml-dev list is sponsored by XML.org, an initiative of OASIS
><http://www.oasis-open.org>
>
>The list archives are at http://lists.xml.org/archives/xml-dev/
>
>To unsubscribe from this elist send a message with the single word
>"unsubscribe" in the body to: xml-dev-request@l...

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


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.