[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: BML - first cut discussion document
Greg et al.,
Here is a first cut of an election results DTD that we've developed
in-house.
My key concern at this early point is that the fields used to identify
an election (Office, Type, State, Party, District/Seat) be consistent
both in collecting and reporting votes.
Regards,
Tim
--
Tim Bovee, Director of Projects/Technology
The Associated Press, Washington
202-776-9465, tbovee@ap.org
--
<!-- Root element: ELECTION RETURNS -->
<!ELEMENT ELECTION_RETURNS
(P*, DATETIME?, P*, (REGION_NAME, REGION_TYPE?)?, RACE+, P*)>
<!ELEMENT P (#PCDATA)> <!-- opening or closing paragraphs -->
<!ELEMENT DATETIME (MONTH,DAY,YEAR,HOUR,MINUTE)>
<!ELEMENT MONTH (#PCDATA)>
<!ELEMENT DAY (#PCDATA)>
<!ELEMENT YEAR (#PCDATA)>
<!ELEMENT HOUR (#PCDATA)>
<!ELEMENT MINUTE (#PCDATA)>
<!ELEMENT RACE
((OFFICE, SEAT?, P*, DATETIME?, CANDIDATE+)|
(BALLOT_QUESTION, P*, DATETIME?, YES, NO)>
<!ELEMENT OFFICE (#PCDATA)>
<!ELEMENT SEAT (#PCDATA)>
<!ELEMENT CANDIDATE (BALLOT_NAME, PARTY?, INCUMBENT?,
(WINNER|ADVANCED)?, VOTES, PCT?)>
<!ELEMENT BALLOT_NAME (#PCDATA)>
<!ELEMENT WINNER EMPTY >
<!ELEMENT PARTY (#PCDATA)>
<!ELEMENT INCUMBENT EMPTY >
<!ELEMENT ADVANCED EMPTY > <!--advanced to runoff-->
<!ELEMENT VOTES (#PCDATA)>
<!ELEMENT PCT (#PCDATA)> <!-- PCT=percentage -->
<!ELEMENT REGION (REGION_NAME, REGION_TYPE, PRECINCTS?, VOTES, PCT?)>
<!ELEMENT REGION_NAME (#PCDATA)>
<!ELEMENT REGION_TYPE
(NONE |
COUNTY | PARISH |
CITY | TOWN | BOROUGH | TOWNSHIP |
DISTRICT | STATE | COMMONWEALTH |
DIVISION | PRECINCT | WARD | OTHER )>
<!ELEMENT PRECINCTS ((REPORTING,TOTAL)?,PCT)>
<!ELEMENT REPORTING (#PCDATA)>
<!ELEMENT TOTAL (#PCDATA)>
> "McGilvray, Gregg" wrote:
>
> Here is a first cut for the Ballot Markup Language (BML). There is a
> sample XML, DTD, and XSL
> file at the end. The sylesheet ballot.xsl will display a simple ballot
> in HTML format.
> If you create separate files for each of them with the proper names
> you may try to open ballot.xml
> in an XML compliant browser. I used IE 5.5 to view the results.
>
> Please use this as a starting point for discussions about how to start
> the development and approval of
> the EML standard. This is not a comprehensive description and will
> need to be embellished. We will formalize
> the document as we go along.
>
> I used a DTD for this example which is not to imply that DTD's will be
> used instead of schemas. I also
> used only elements in favor of attributes which does not necessarily
> mean it is the best method.
>
> A few definitions:
>
> The term ITEM is meant to represent the thing voted upon whether it is
> an office, position-elect
> or referendum. This is a very generic term and can be replaced if
> necessary. The term SELECTION refers
> to the candidate, answer, etc which is the option or choice for
> election. Each ballot has a unique ID as
> do the ITEMS and SELECTIONS. The VOTELIMIT defines the number of
> vacancies to be filled in that particulat ITEM.
> The UNDERVOTE element indicates whether it is allowable to vote for
> fewer than the allowable SELECTIONS. The
> WRITEIN element describes the number of write in candidates allowed.
> The ITEM_TYPE element describes the type
> of ITEM (such as first-past-the-post, plurality, proportional vote,
> etc.) and will need to be discussed further.
>
> Structure:
>
> Each ballot will be enclosed with the tags <ballot>...</ballot>. The
> ballot has a description (such as
> Nassau County, ED1,SD1) and a unique number. There are as many
> <item>...</item> pairs as there are
> offices to be voted upon. Each has a unique number, a description, an
> ID which describes the voting
> characteristics of this ITEM, the number of vacancies (VOTELIMIT),
> whether the number of selections may be
> less than the number to be voted upon, and if write in votes are
> accepted. There will be a number of
> <selection>...</selection> pairs as there are candidates (selections)
> running for that office. Each SELECTION
> has a unique number and description.
>
> This structure will generically accommodate a large number of eletion
> possibilities.
>
> Ballot.xml
>
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="ballot.xsl"?>
> <!DOCTYPE ballot SYSTEM "ballot.dtd">
> <ballot>
> <ballot_id>1</ballot_id>
> <ballot_description>US Election 2000 Test</ballot_description>
> <item>
> <item_id>1</item_id>
> <item_type>1</item_type>
> <item_description>President of the United
> States</item_description>
> <votelimit>1</votelimit>
> <undervote>Y</undervote>
> <writeins>0</writeins>
> <selection>
> <selection_id>10</selection_id>
> <selection_description>Al Gore</selection_description>
> </selection>
> <selection>
> <selection_id>11</selection_id>
> <selection_description>George W. Bush</selection_description>
>
> </selection>
> </item>
> </ballot>
>
> Ballot.xsl
>
> <?xml version='1.0'?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
> <xsl:template match="/">
> <html>
> <H1><CENTER><xsl:value-of
> select="/ballot/ballot_description"/></CENTER></H1>
> <body bgcolor = "TEAL">
> <table border="2" bgcolor="yellow">
> <xsl:for-each select="/ballot/item">
> <tr>
> <th>
> <xsl:value-of select="item_description"/>
> </th>
> </tr>
> <xsl:for-each select="/ballot/item/selection">
> <tr>
> <th>
> <xsl:value-of select="selection_description"/>
> </th>
> </tr>
> </xsl:for-each>
> </xsl:for-each>
> </table>
> </body>
> </html>
> </xsl:template>
> </xsl:stylesheet>
>
> Ballot.dtd
>
> <!ELEMENT ballot (ballot_id , ballot_description , item+ )>
>
> <!ELEMENT ballot_id (#PCDATA )>
>
> <!ELEMENT ballot_description (#PCDATA )>
>
> <!ELEMENT item (item_id , item_type , item_input_type ,
> item_description , votelimit , undervote , writeins , selection+ )>
>
> <!ELEMENT item_id (#PCDATA )>
>
> <!ELEMENT item_type (#PCDATA )>
>
> <!ELEMENT item_input_type (#PCDATA )>
>
> <!ELEMENT item_description (#PCDATA )>
>
> <!ELEMENT votelimit (#PCDATA )>
>
> <!ELEMENT undervote (#PCDATA )>
>
> <!ELEMENT writeins (#PCDATA )>
>
> <!ELEMENT selection (selection_id , selection_description )>
>
> <!ELEMENT selection_id (#PCDATA )>
>
> <!ELEMENT selection_description (#PCDATA )>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC