OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Element content



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

*******************************************************************