[Tutor] the art of testing
Kent Johnson
kent37 at tds.net
Wed Nov 25 12:35:42 CET 2009
On Tue, Nov 24, 2009 at 3:41 PM, Serdar Tumgoren <zstumgoren at 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
More information about the Tutor
mailing list