# Copyright (c) 2012 Jirka Kosek <jirka@kosek.cz>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

include "its20-html5-types.rnc"

its-attribute.locNote.html = attribute its-loc-note { its-locNote.type }

its-attribute.locNoteType.html = attribute its-loc-note-type { its-locNoteType.type }

its-attribute.locNoteRef.html = attribute its-loc-note-ref { its-locNoteRef.type }

its-attribute.termInfoRef.html = attribute its-term-info-ref { its-termInfoRef.type }

its-attribute.term.html = attribute its-term { its-term.type }

its-attribute.termConfidence.html = attribute its-term-confidence { its-termConfidence.type }

its-attribute.withinText.html = attribute its-within-text { its-withinText.type }

its-attribute.domainMapping.html = attribute its-domain-mapping { its-domainMapping.type }

its-attribute.taConfidence.html = attribute its-ta-confidence { its-taConfidence.type }

its-attribute.taClassRef.html = attribute its-ta-class-ref { its-taClassRef.type }

its-attribute.taIdent.html = attribute its-ta-ident { its-taIdent.type }

its-attribute.taIdentRef.html = attribute its-ta-ident-ref { its-taIdentRef.type }

its-attribute.taSource.html = attribute its-ta-source { its-taSource.type }

its-attribute.localeFilterList.html = attribute its-locale-filter-list { its-localeFilterList.type }

its-attribute.localeFilterType.html = attribute its-locale-filter-type { its-localeFilterType.type }

its-attribute.person.html = attribute its-person { its-person.type }

its-attribute.personRef.html = attribute its-person-ref { its-personRef.type }

its-attribute.org.html = attribute its-org { its-org.type }

its-attribute.orgRef.html = attribute its-org-ref { its-orgRef.type }

its-attribute.tool.html = attribute its-tool { its-tool.type }

its-attribute.toolRef.html = attribute its-tool-ref { its-toolRef.type }

its-attribute.revPerson.html = attribute its-rev-person { its-revPerson.type }

its-attribute.revPersonRef.html = attribute its-rev-person-ref { its-revPersonRef.type }

its-attribute.revOrg.html = attribute its-rev-org { its-revOrg.type }

its-attribute.revOrgRef.html = attribute its-rev-org-ref { its-revOrgRef.type }

its-attribute.revTool.html = attribute its-rev-tool { its-revTool.type }

its-attribute.revToolRef.html = attribute its-rev-tool-ref { its-revToolRef.type }

its-attribute.provRef.html = attribute its-prov-ref { its-provRef.type }

its-attribute.provenanceRecordsRef.html = attribute its-provenance-records-ref { its-provenanceRecordsRef.type }

its-attribute.locQualityIssuesRef.html = attribute its-loc-quality-issues-ref { its-locQualityIssuesRef.type }

its-attribute.locQualityIssueType.html = attribute its-loc-quality-issue-type { its-locQualityIssueType.type } 

its-attribute.locQualityIssueComment.html = attribute its-loc-quality-issue-comment { its-locQualityIssueComment.type }

its-attribute.locQualityIssueSeverity.html = attribute its-loc-quality-issue-severity { its-locQualityIssueSeverity.type }

its-attribute.locQualityIssueProfileRef.html = attribute its-loc-quality-issue-profile-ref { its-locQualityIssueProfileRef.type }

its-attribute.locQualityIssueEnabled.html = attribute its-loc-quality-issue-enabled { its-locQualityIssueEnabled.type }

its-attribute.locQualityRatingScore.html = attribute its-loc-quality-rating-score { its-locQualityRatingScore.type }

its-attribute.locQualityRatingVote.html = attribute its-loc-quality-rating-vote { its-locQualityRatingVote.type }

its-attribute.locQualityRatingScoreThreshold.html = attribute its-loc-quality-rating-score-threshold { its-locQualityRatingScoreThreshold.type }

its-attribute.locQualityRatingVoteThreshold.html = attribute its-loc-quality-rating-vote-threshold { its-locQualityRatingVoteThreshold.type }

its-attribute.locQualityRatingProfileRef.html = attribute its-loc-quality-rating-profile-ref { its-locQualityRatingProfileRef.type }

its-attribute.mtConfidence.html = attribute its-mt-confidence { its-mtConfidence.type }

its-attribute.allowedCharacters.html = attribute its-allowed-characters { its-allowedCharacters.type }

its-attribute.storageSize.html = attribute its-storage-size { its-storageSize.type }

its-attribute.storageEncoding.html = attribute its-storage-encoding { its-storageEncoding.type }

its-attribute.lineBreakType.html = attribute its-line-break-type { its-lineBreakType.type }

its-attribute.annotatorsRef.html = attribute its-annotators-ref { its-annotatorsRef.type }

its-html-attributes =
  ((its-attribute.locNote.html | its-attribute.locNoteRef.html), its-attribute.locNoteType.html?)? &
  (its-attribute.term.html, its-attribute.termInfoRef.html?, its-attribute.termConfidence.html?)? &
  its-attribute.withinText.html? &
  (its-attribute.taConfidence.html? &
   (its-attribute.taClassRef.html? &
   ((its-attribute.taSource.html, its-attribute.taIdent.html) | its-attribute.taIdentRef.html)?)) &
  (its-attribute.localeFilterList.html, its-attribute.localeFilterType.html?)? &
  ((
   (its-attribute.person.html | its-attribute.personRef.html )? &
   (its-attribute.org.html | its-attribute.orgRef.html )? &
   (its-attribute.tool.html | its-attribute.toolRef.html )? &
   (its-attribute.revPerson.html | its-attribute.revPersonRef.html )? &
   (its-attribute.revOrg.html | its-attribute.revOrgRef.html )? &
   (its-attribute.revTool.html | its-attribute.revToolRef.html )? &
    its-attribute.provRef.html?)
   | its-attribute.provenanceRecordsRef.html)? &
  (its-attribute.locQualityIssuesRef.html
  |
  ((its-attribute.locQualityIssueType.html? & its-attribute.locQualityIssueComment.html?) & its-attribute.locQualityIssueSeverity.html? & its-attribute.locQualityIssueProfileRef.html? & its-attribute.locQualityIssueEnabled.html?)
  )? &
  (((its-attribute.locQualityRatingScore.html, its-attribute.locQualityRatingScoreThreshold.html?) | (its-attribute.locQualityRatingVote.html, its-attribute.locQualityRatingVoteThreshold.html?)), its-attribute.locQualityRatingProfileRef.html?)? &
  its-attribute.mtConfidence.html? &
  its-attribute.allowedCharacters.html? &
  (its-attribute.storageSize.html, its-attribute.storageEncoding.html?, its-attribute.lineBreakType.html?)? &
  its-attribute.annotatorsRef.html?

# FIXME: Find way how to validate stand-off markup inside <script>
