On Tue, Nov 24, 2009 at 3:41 PM, Serdar Tumgoren <zstumgo...@gmail.com> wrote:

> << requirements snippet>>
>
> Root node of every XML file is PublicFiling
> Every PublicFiling node must contain at least one Filing node
> Every Filing must contain 'Type' attribute
> Every Filing must contain 'Year' attribute, etc.
> Filing node must be either a Registration or activity Report
> Filing is a Registration when 'Type' attribute equals 'Registration'
> or 'Registration Amendment'
> Registration must not have an 'Amount' attribute
> Registration must not have an 'is_state_or_local_attrib'
>
> << end requirements>>

Many of these requirements could be written as a DTD or schema for the
input. If you had a DTD or schema, a validating XML parser would check
the requirements for you. If you just want to reject non-conforming
documents this may be the simplest approach.

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to