refactor: split the repo into self-contained validator, directory, quickstart, spec and site folders
validator/ holds mewslint (lint, css, fetch, DTD/CSS data); directory/ holds the mews.page service (app, db, check, pages, cli) and depends on validator/; quickstart/ holds mews-quickstart and md2mews.py for third parties who want to create Mews content without cloning the repo; spec/ consolidates doc/ and dtd/ with the canonical mews-0.1.css; site/ becomes a Pelican project with the forward-facing pages as Markdown, the check form kept as a raw HTML snippet. Root pyproject.toml is now a virtual uv workspace over validator, directory and quickstart, with cross-cutting tests that span more than one of them staying at the repo root. Makefile and flake.nix updated to match.
This commit is contained in:
parent
5fa8708bd1
commit
060d4e00fd
90 changed files with 1290 additions and 287 deletions
428
spec/LICENSE
Normal file
428
spec/LICENSE
Normal file
|
|
@ -0,0 +1,428 @@
|
|||
Attribution-ShareAlike 4.0 International
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
||||
does not provide legal services or legal advice. Distribution of
|
||||
Creative Commons public licenses does not create a lawyer-client or
|
||||
other relationship. Creative Commons makes its licenses and related
|
||||
information available on an "as-is" basis. Creative Commons gives no
|
||||
warranties regarding its licenses, any material licensed under their
|
||||
terms and conditions, or any related information. Creative Commons
|
||||
disclaims all liability for damages resulting from their use to the
|
||||
fullest extent possible.
|
||||
|
||||
Using Creative Commons Public Licenses
|
||||
|
||||
Creative Commons public licenses provide a standard set of terms and
|
||||
conditions that creators and other rights holders may use to share
|
||||
original works of authorship and other material subject to copyright
|
||||
and certain other rights specified in the public license below. The
|
||||
following considerations are for informational purposes only, are not
|
||||
exhaustive, and do not form part of our licenses.
|
||||
|
||||
Considerations for licensors: Our public licenses are
|
||||
intended for use by those authorized to give the public
|
||||
permission to use material in ways otherwise restricted by
|
||||
copyright and certain other rights. Our licenses are
|
||||
irrevocable. Licensors should read and understand the terms
|
||||
and conditions of the license they choose before applying it.
|
||||
Licensors should also secure all rights necessary before
|
||||
applying our licenses so that the public can reuse the
|
||||
material as expected. Licensors should clearly mark any
|
||||
material not subject to the license. This includes other CC-
|
||||
licensed material, or material used under an exception or
|
||||
limitation to copyright. More considerations for licensors:
|
||||
wiki.creativecommons.org/Considerations_for_licensors
|
||||
|
||||
Considerations for the public: By using one of our public
|
||||
licenses, a licensor grants the public permission to use the
|
||||
licensed material under specified terms and conditions. If
|
||||
the licensor's permission is not necessary for any reason--for
|
||||
example, because of any applicable exception or limitation to
|
||||
copyright--then that use is not regulated by the license. Our
|
||||
licenses grant only permissions under copyright and certain
|
||||
other rights that a licensor has authority to grant. Use of
|
||||
the licensed material may still be restricted for other
|
||||
reasons, including because others have copyright or other
|
||||
rights in the material. A licensor may make special requests,
|
||||
such as asking that all changes be marked or described.
|
||||
Although not required by our licenses, you are encouraged to
|
||||
respect those requests where reasonable. More considerations
|
||||
for the public:
|
||||
wiki.creativecommons.org/Considerations_for_licensees
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International Public
|
||||
License
|
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree
|
||||
to be bound by the terms and conditions of this Creative Commons
|
||||
Attribution-ShareAlike 4.0 International Public License ("Public
|
||||
License"). To the extent this Public License may be interpreted as a
|
||||
contract, You are granted the Licensed Rights in consideration of Your
|
||||
acceptance of these terms and conditions, and the Licensor grants You
|
||||
such rights in consideration of benefits the Licensor receives from
|
||||
making the Licensed Material available under these terms and
|
||||
conditions.
|
||||
|
||||
|
||||
Section 1 -- Definitions.
|
||||
|
||||
a. Adapted Material means material subject to Copyright and Similar
|
||||
Rights that is derived from or based upon the Licensed Material
|
||||
and in which the Licensed Material is translated, altered,
|
||||
arranged, transformed, or otherwise modified in a manner requiring
|
||||
permission under the Copyright and Similar Rights held by the
|
||||
Licensor. For purposes of this Public License, where the Licensed
|
||||
Material is a musical work, performance, or sound recording,
|
||||
Adapted Material is always produced where the Licensed Material is
|
||||
synched in timed relation with a moving image.
|
||||
|
||||
b. Adapter's License means the license You apply to Your Copyright
|
||||
and Similar Rights in Your contributions to Adapted Material in
|
||||
accordance with the terms and conditions of this Public License.
|
||||
|
||||
c. BY-SA Compatible License means a license listed at
|
||||
creativecommons.org/compatiblelicenses, approved by Creative
|
||||
Commons as essentially the equivalent of this Public License.
|
||||
|
||||
d. Copyright and Similar Rights means copyright and/or similar rights
|
||||
closely related to copyright including, without limitation,
|
||||
performance, broadcast, sound recording, and Sui Generis Database
|
||||
Rights, without regard to how the rights are labeled or
|
||||
categorized. For purposes of this Public License, the rights
|
||||
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
||||
Rights.
|
||||
|
||||
e. Effective Technological Measures means those measures that, in the
|
||||
absence of proper authority, may not be circumvented under laws
|
||||
fulfilling obligations under Article 11 of the WIPO Copyright
|
||||
Treaty adopted on December 20, 1996, and/or similar international
|
||||
agreements.
|
||||
|
||||
f. Exceptions and Limitations means fair use, fair dealing, and/or
|
||||
any other exception or limitation to Copyright and Similar Rights
|
||||
that applies to Your use of the Licensed Material.
|
||||
|
||||
g. License Elements means the license attributes listed in the name
|
||||
of a Creative Commons Public License. The License Elements of this
|
||||
Public License are Attribution and ShareAlike.
|
||||
|
||||
h. Licensed Material means the artistic or literary work, database,
|
||||
or other material to which the Licensor applied this Public
|
||||
License.
|
||||
|
||||
i. Licensed Rights means the rights granted to You subject to the
|
||||
terms and conditions of this Public License, which are limited to
|
||||
all Copyright and Similar Rights that apply to Your use of the
|
||||
Licensed Material and that the Licensor has authority to license.
|
||||
|
||||
j. Licensor means the individual(s) or entity(ies) granting rights
|
||||
under this Public License.
|
||||
|
||||
k. Share means to provide material to the public by any means or
|
||||
process that requires permission under the Licensed Rights, such
|
||||
as reproduction, public display, public performance, distribution,
|
||||
dissemination, communication, or importation, and to make material
|
||||
available to the public including in ways that members of the
|
||||
public may access the material from a place and at a time
|
||||
individually chosen by them.
|
||||
|
||||
l. Sui Generis Database Rights means rights other than copyright
|
||||
resulting from Directive 96/9/EC of the European Parliament and of
|
||||
the Council of 11 March 1996 on the legal protection of databases,
|
||||
as amended and/or succeeded, as well as other essentially
|
||||
equivalent rights anywhere in the world.
|
||||
|
||||
m. You means the individual or entity exercising the Licensed Rights
|
||||
under this Public License. Your has a corresponding meaning.
|
||||
|
||||
|
||||
Section 2 -- Scope.
|
||||
|
||||
a. License grant.
|
||||
|
||||
1. Subject to the terms and conditions of this Public License,
|
||||
the Licensor hereby grants You a worldwide, royalty-free,
|
||||
non-sublicensable, non-exclusive, irrevocable license to
|
||||
exercise the Licensed Rights in the Licensed Material to:
|
||||
|
||||
a. reproduce and Share the Licensed Material, in whole or
|
||||
in part; and
|
||||
|
||||
b. produce, reproduce, and Share Adapted Material.
|
||||
|
||||
2. Exceptions and Limitations. For the avoidance of doubt, where
|
||||
Exceptions and Limitations apply to Your use, this Public
|
||||
License does not apply, and You do not need to comply with
|
||||
its terms and conditions.
|
||||
|
||||
3. Term. The term of this Public License is specified in Section
|
||||
6(a).
|
||||
|
||||
4. Media and formats; technical modifications allowed. The
|
||||
Licensor authorizes You to exercise the Licensed Rights in
|
||||
all media and formats whether now known or hereafter created,
|
||||
and to make technical modifications necessary to do so. The
|
||||
Licensor waives and/or agrees not to assert any right or
|
||||
authority to forbid You from making technical modifications
|
||||
necessary to exercise the Licensed Rights, including
|
||||
technical modifications necessary to circumvent Effective
|
||||
Technological Measures. For purposes of this Public License,
|
||||
simply making modifications authorized by this Section 2(a)
|
||||
(4) never produces Adapted Material.
|
||||
|
||||
5. Downstream recipients.
|
||||
|
||||
a. Offer from the Licensor -- Licensed Material. Every
|
||||
recipient of the Licensed Material automatically
|
||||
receives an offer from the Licensor to exercise the
|
||||
Licensed Rights under the terms and conditions of this
|
||||
Public License.
|
||||
|
||||
b. Additional offer from the Licensor -- Adapted Material.
|
||||
Every recipient of Adapted Material from You
|
||||
automatically receives an offer from the Licensor to
|
||||
exercise the Licensed Rights in the Adapted Material
|
||||
under the conditions of the Adapter's License You apply.
|
||||
|
||||
c. No downstream restrictions. You may not offer or impose
|
||||
any additional or different terms or conditions on, or
|
||||
apply any Effective Technological Measures to, the
|
||||
Licensed Material if doing so restricts exercise of the
|
||||
Licensed Rights by any recipient of the Licensed
|
||||
Material.
|
||||
|
||||
6. No endorsement. Nothing in this Public License constitutes or
|
||||
may be construed as permission to assert or imply that You
|
||||
are, or that Your use of the Licensed Material is, connected
|
||||
with, or sponsored, endorsed, or granted official status by,
|
||||
the Licensor or others designated to receive attribution as
|
||||
provided in Section 3(a)(1)(A)(i).
|
||||
|
||||
b. Other rights.
|
||||
|
||||
1. Moral rights, such as the right of integrity, are not
|
||||
licensed under this Public License, nor are publicity,
|
||||
privacy, and/or other similar personality rights; however, to
|
||||
the extent possible, the Licensor waives and/or agrees not to
|
||||
assert any such rights held by the Licensor to the limited
|
||||
extent necessary to allow You to exercise the Licensed
|
||||
Rights, but not otherwise.
|
||||
|
||||
2. Patent and trademark rights are not licensed under this
|
||||
Public License.
|
||||
|
||||
3. To the extent possible, the Licensor waives any right to
|
||||
collect royalties from You for the exercise of the Licensed
|
||||
Rights, whether directly or through a collecting society
|
||||
under any voluntary or waivable statutory or compulsory
|
||||
licensing scheme. In all other cases the Licensor expressly
|
||||
reserves any right to collect such royalties.
|
||||
|
||||
|
||||
Section 3 -- License Conditions.
|
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the
|
||||
following conditions.
|
||||
|
||||
a. Attribution.
|
||||
|
||||
1. If You Share the Licensed Material (including in modified
|
||||
form), You must:
|
||||
|
||||
a. retain the following if it is supplied by the Licensor
|
||||
with the Licensed Material:
|
||||
|
||||
i. identification of the creator(s) of the Licensed
|
||||
Material and any others designated to receive
|
||||
attribution, in any reasonable manner requested by
|
||||
the Licensor (including by pseudonym if
|
||||
designated);
|
||||
|
||||
ii. a copyright notice;
|
||||
|
||||
iii. a notice that refers to this Public License;
|
||||
|
||||
iv. a notice that refers to the disclaimer of
|
||||
warranties;
|
||||
|
||||
v. a URI or hyperlink to the Licensed Material to the
|
||||
extent reasonably practicable;
|
||||
|
||||
b. indicate if You modified the Licensed Material and
|
||||
retain an indication of any previous modifications; and
|
||||
|
||||
c. indicate the Licensed Material is licensed under this
|
||||
Public License, and include the text of, or the URI or
|
||||
hyperlink to, this Public License.
|
||||
|
||||
2. You may satisfy the conditions in Section 3(a)(1) in any
|
||||
reasonable manner based on the medium, means, and context in
|
||||
which You Share the Licensed Material. For example, it may be
|
||||
reasonable to satisfy the conditions by providing a URI or
|
||||
hyperlink to a resource that includes the required
|
||||
information.
|
||||
|
||||
3. If requested by the Licensor, You must remove any of the
|
||||
information required by Section 3(a)(1)(A) to the extent
|
||||
reasonably practicable.
|
||||
|
||||
b. ShareAlike.
|
||||
|
||||
In addition to the conditions in Section 3(a), if You Share
|
||||
Adapted Material You produce, the following conditions also apply.
|
||||
|
||||
1. The Adapter's License You apply must be a Creative Commons
|
||||
license with the same License Elements, this version or
|
||||
later, or a BY-SA Compatible License.
|
||||
|
||||
2. You must include the text of, or the URI or hyperlink to, the
|
||||
Adapter's License You apply. You may satisfy this condition
|
||||
in any reasonable manner based on the medium, means, and
|
||||
context in which You Share Adapted Material.
|
||||
|
||||
3. You may not offer or impose any additional or different terms
|
||||
or conditions on, or apply any Effective Technological
|
||||
Measures to, Adapted Material that restrict exercise of the
|
||||
rights granted under the Adapter's License You apply.
|
||||
|
||||
|
||||
Section 4 -- Sui Generis Database Rights.
|
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that
|
||||
apply to Your use of the Licensed Material:
|
||||
|
||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
||||
to extract, reuse, reproduce, and Share all or a substantial
|
||||
portion of the contents of the database;
|
||||
|
||||
b. if You include all or a substantial portion of the database
|
||||
contents in a database in which You have Sui Generis Database
|
||||
Rights, then the database in which You have Sui Generis Database
|
||||
Rights (but not its individual contents) is Adapted Material,
|
||||
including for purposes of Section 3(b); and
|
||||
|
||||
c. You must comply with the conditions in Section 3(a) if You Share
|
||||
all or a substantial portion of the contents of the database.
|
||||
|
||||
For the avoidance of doubt, this Section 4 supplements and does not
|
||||
replace Your obligations under this Public License where the Licensed
|
||||
Rights include other Copyright and Similar Rights.
|
||||
|
||||
|
||||
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
||||
|
||||
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
||||
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
||||
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
||||
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
||||
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
||||
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
||||
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
||||
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
||||
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
||||
|
||||
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
||||
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
||||
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
||||
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
||||
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
||||
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
||||
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
||||
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
||||
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
c. The disclaimer of warranties and limitation of liability provided
|
||||
above shall be interpreted in a manner that, to the extent
|
||||
possible, most closely approximates an absolute disclaimer and
|
||||
waiver of all liability.
|
||||
|
||||
|
||||
Section 6 -- Term and Termination.
|
||||
|
||||
a. This Public License applies for the term of the Copyright and
|
||||
Similar Rights licensed here. However, if You fail to comply with
|
||||
this Public License, then Your rights under this Public License
|
||||
terminate automatically.
|
||||
|
||||
b. Where Your right to use the Licensed Material has terminated under
|
||||
Section 6(a), it reinstates:
|
||||
|
||||
1. automatically as of the date the violation is cured, provided
|
||||
it is cured within 30 days of Your discovery of the
|
||||
violation; or
|
||||
|
||||
2. upon express reinstatement by the Licensor.
|
||||
|
||||
For the avoidance of doubt, this Section 6(b) does not affect any
|
||||
right the Licensor may have to seek remedies for Your violations
|
||||
of this Public License.
|
||||
|
||||
c. For the avoidance of doubt, the Licensor may also offer the
|
||||
Licensed Material under separate terms or conditions or stop
|
||||
distributing the Licensed Material at any time; however, doing so
|
||||
will not terminate this Public License.
|
||||
|
||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
||||
License.
|
||||
|
||||
|
||||
Section 7 -- Other Terms and Conditions.
|
||||
|
||||
a. The Licensor shall not be bound by any additional or different
|
||||
terms or conditions communicated by You unless expressly agreed.
|
||||
|
||||
b. Any arrangements, understandings, or agreements regarding the
|
||||
Licensed Material not stated herein are separate from and
|
||||
independent of the terms and conditions of this Public License.
|
||||
|
||||
|
||||
Section 8 -- Interpretation.
|
||||
|
||||
a. For the avoidance of doubt, this Public License does not, and
|
||||
shall not be interpreted to, reduce, limit, restrict, or impose
|
||||
conditions on any use of the Licensed Material that could lawfully
|
||||
be made without permission under this Public License.
|
||||
|
||||
b. To the extent possible, if any provision of this Public License is
|
||||
deemed unenforceable, it shall be automatically reformed to the
|
||||
minimum extent necessary to make it enforceable. If the provision
|
||||
cannot be reformed, it shall be severed from this Public License
|
||||
without affecting the enforceability of the remaining terms and
|
||||
conditions.
|
||||
|
||||
c. No term or condition of this Public License will be waived and no
|
||||
failure to comply consented to unless expressly agreed to by the
|
||||
Licensor.
|
||||
|
||||
d. Nothing in this Public License constitutes or may be interpreted
|
||||
as a limitation upon, or waiver of, any privileges and immunities
|
||||
that apply to the Licensor or You, including from the legal
|
||||
processes of any jurisdiction or authority.
|
||||
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons is not a party to its public
|
||||
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
||||
its public licenses to material it publishes and in those instances
|
||||
will be considered the “Licensor.” The text of the Creative Commons
|
||||
public licenses is dedicated to the public domain under the CC0 Public
|
||||
Domain Dedication. Except for the limited purpose of indicating that
|
||||
material is shared under a Creative Commons public license or as
|
||||
otherwise permitted by the Creative Commons policies published at
|
||||
creativecommons.org/policies, Creative Commons does not authorize the
|
||||
use of the trademark "Creative Commons" or any other trademark or logo
|
||||
of Creative Commons without its prior written consent including,
|
||||
without limitation, in connection with any unauthorized modifications
|
||||
to any of its public licenses or any other arrangements,
|
||||
understandings, or agreements concerning use of licensed material. For
|
||||
the avoidance of doubt, this paragraph does not form part of the
|
||||
public licenses.
|
||||
|
||||
Creative Commons may be contacted at creativecommons.org.
|
||||
|
||||
38
spec/NOTES.md
Normal file
38
spec/NOTES.md
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Known issues
|
||||
|
||||
Things that are true of the implementation but not yet of the spec, or the other
|
||||
way round. Each one is a decision waiting to be made, not a bug to work around.
|
||||
|
||||
## The hosted XHTML-MP DTD cannot validate offline
|
||||
|
||||
Section 9.1 says the project hosts a copy of the original XHTML-MP 1.2 DTD "so
|
||||
validation never depends on the Open Mobile Alliance's server." The copy in
|
||||
`spec/xhtml-mobile12.dtd` is only the OMA *driver*: it pulls about twenty-two
|
||||
modules from `http://www.w3.org/TR/xhtml-modularization/DTD/*.mod`, one module
|
||||
from openmobilealliance.org, and a relative `xhtml-mobile12-model-1.mod` that is
|
||||
not in this repository. Hosting it therefore removes one network dependency and
|
||||
leaves the rest.
|
||||
|
||||
It does not affect Mews validation. `spec/mews-0.1.dtd` is self-contained, and
|
||||
the only thing the declared doctype has to provide is the character entity set,
|
||||
which `validator/mews/lint.py` builds in memory from `html.entities` — the same
|
||||
252 names, no network, nothing to keep in sync.
|
||||
|
||||
Two ways out, when it matters: reword 9.1 to say the hosted copy is a
|
||||
convenience, or vendor the modules under `spec/xhtml-mobile12/` with a
|
||||
public-ID resolver. Only the second would let a test prove section 3's claim
|
||||
that every page passing the Mews DTD is also valid XHTML-MP 1.2 apart from
|
||||
`lang` and `dir`.
|
||||
|
||||
## The head element order is normative, and surprising
|
||||
|
||||
`<!ELEMENT head ( title, meta, ( meta | link )* )>` means the title comes first
|
||||
and at least one meta follows it, so a `<link>` before the first `<meta>` is
|
||||
invalid. That follows section 3.3, but 3.3 does not say the order is normative,
|
||||
and the validator's message has to explain it. Worth a sentence in the spec.
|
||||
|
||||
## The copies under validator/mews/data
|
||||
|
||||
`validator/mews/data/mews-0.1.css` and `validator/mews/data/mews-0.1.dtd` are
|
||||
copies of the canonical files in `spec/`. They exist so the validator finds
|
||||
them when it is installed as a wheel with nothing else on disk. `tests/test_data.py` fails if a copy drifts from its original.
|
||||
394
spec/SPEC.md
Normal file
394
spec/SPEC.md
Normal file
|
|
@ -0,0 +1,394 @@
|
|||
# Mews Profile (Draft 0.1)
|
||||
|
||||
## 1. Status and introduction
|
||||
|
||||
Mews Profile is the format behind the Mews project at mews.page. It is a small-web format built from a strict subset of XHTML Mobile Profile 1.2, a shared default stylesheet, and simple subscription conventions. Mews pages are ordinary web pages: they open in any browser and on WAP 2.0 phones, and dedicated clients can render them with their own presentation.
|
||||
|
||||
This specification is published under Creative Commons Attribution-ShareAlike 4.0 International. The software published with it, including the validator and the default stylesheet, is published under Apache License 2.0; the stylesheet is deliberately not share-alike, because section 5.2 asks every site to host its own copy of it.
|
||||
|
||||
This is a working draft (0.1). The name keeps the "MP" of XHTML-MP, turning Mobile Profile into Mews Profile. Each version is published at mews.page/spec/\<version> (this one at mews.page/spec/0.1), and mews.page/spec/ always points to the latest. Everything here is open to change.
|
||||
|
||||
### Core principle
|
||||
|
||||
**Authors provide structure. Readers control presentation.**
|
||||
|
||||
Every rule in this spec follows from that principle. Scripts and author styling are excluded because they take control from the reader. The default stylesheet exists so readers without a dedicated client still get good presentation. The conformance marker exists so clients know when they may apply their own presentation.
|
||||
|
||||
### Goals
|
||||
|
||||
- Pages that are small, fast, readable, and free of tracking.
|
||||
- No special protocol, server, proxy, or client required to read a page.
|
||||
- Every conforming page is valid XHTML-MP 1.2 apart from two attributes (section 3), so it works on real WAP 2.0 handsets.
|
||||
- A format simple enough to write by hand and to implement a client for in a weekend.
|
||||
|
||||
## 2. Conventions and terminology
|
||||
|
||||
The key words MUST, MUST NOT, SHOULD, SHOULD NOT and MAY are to be interpreted as described in RFC 2119.
|
||||
|
||||
| Term | Meaning |
|
||||
| --- | --- |
|
||||
| Mews page | An XHTML-MP 1.2 document that follows every MUST rule in this spec and carries the conformance marker. |
|
||||
| Mews site | A set of Mews pages under one registered domain. |
|
||||
| Author | Whoever writes or publishes Mews pages. |
|
||||
| Client | Any software that displays Mews pages: a dedicated Mews client, an ordinary browser, or a WAP phone. |
|
||||
| Mews client | A client that recognizes the conformance marker and applies its own presentation. |
|
||||
| Default stylesheet | The shared CSS file published with this spec (section 5). |
|
||||
| Entry | A dated link that a client can treat as a post (section 6). |
|
||||
|
||||
## 3. Document format
|
||||
|
||||
A Mews page MUST be a well-formed, valid XHTML-MP 1.2 document that also follows the restrictions in section 4, with one exception: it MAY carry the lang and dir attributes, which XHTML-MP lacks. Browsers need lang to know a page's language when it is served as text/html, and dir to show right-to-left text; old WAP browsers ignore both. Apart from these two attributes, the rules only remove or restrict features, so every Mews page is otherwise valid XHTML-MP.
|
||||
|
||||
### 3.1 Prologue and doctype
|
||||
|
||||
A Mews page MUST begin with an XML declaration specifying UTF-8, followed by the XHTML-MP 1.2 doctype. Either quote character may be used in the declaration, as XML allows:
|
||||
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"
|
||||
"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
|
||||
```
|
||||
|
||||
The root element MUST be `<html xmlns="http://www.w3.org/1999/xhtml">` and SHOULD carry `xml:lang` and `lang` attributes with the same value, naming the page language, plus `dir="rtl"` for right-to-left languages such as Hebrew and Arabic.
|
||||
|
||||
### 3.2 Conformance marker
|
||||
|
||||
A Mews page MUST include this element in its `<head>`:
|
||||
|
||||
```xml
|
||||
<meta name="mews-profile" content="0.1" />
|
||||
```
|
||||
|
||||
The `content` value is the spec version the page follows. A Mews client MUST NOT apply Mews presentation to a page without the marker; such a page is ordinary XHTML-MP.
|
||||
|
||||
### 3.3 Head
|
||||
|
||||
The `<head>` MUST contain a `<title>` and the conformance marker (3.2). It MAY contain `<meta name="description">`, `<meta name="author">`, `<meta name="viewport" content="width=device-width" />`, `<link rel="icon">` pointing to the same site, the stylesheet link (section 5) and feed links (section 6). Nothing else is permitted in the head. Pages SHOULD include the viewport tag, so modern phones show them at readable size.
|
||||
|
||||
## 4. Elements and attributes
|
||||
|
||||
Mews Profile keeps the structural parts of XHTML-MP 1.2 and removes everything that controls appearance or behavior. Anything not listed in 4.1 is excluded, notably script, event attributes such as onclick, the style element and attribute, object, meta refresh, and big and small.
|
||||
|
||||
### 4.1 Permitted elements and attributes
|
||||
|
||||
| Group | Elements |
|
||||
| --- | --- |
|
||||
| Structure | `html`, `head`, `title`, `body` |
|
||||
| Headings | `h1`–`h6` |
|
||||
| Text blocks | `p`, `blockquote`, `pre`, `address`, `hr` |
|
||||
| Inline text | `em`, `strong`, `b`, `i`, `code`, `kbd`, `samp`, `var`, `q`, `cite`, `abbr`, `dfn`, `br` |
|
||||
| Links | `a` |
|
||||
| Lists | `ul`, `ol`, `li`, `dl`, `dt`, `dd` |
|
||||
| Tables | `table`, `caption`, `tr`, `th`, `td` |
|
||||
| Images | `img` |
|
||||
| Forms | `form`, `fieldset`, `label`, `input`, `select`, `option`, `optgroup`, `textarea` |
|
||||
| Head | `meta`, `link` (as limited in 3.3) |
|
||||
|
||||
Only the attributes below are permitted; any other attribute MUST NOT appear. `id`, `title`, `xml:lang`, `lang` and `dir` are permitted on every element in the body; `lang` and `dir` are the Mews extensions described in section 3. `class` is permitted only on `body` (section 5.3).
|
||||
|
||||
| Element | Attributes |
|
||||
| --- | --- |
|
||||
| `html` | `xmlns`, `xml:lang`, lang, dir |
|
||||
| `meta` | `name`, `content` |
|
||||
| `link` | `rel`, `href`, `type`, `title` |
|
||||
| `a` | `href`, `hreflang`, `rel`, `type`, `accesskey` |
|
||||
| `img` | `src`, `alt` |
|
||||
| `blockquote`, `q` | `cite` |
|
||||
| `ol` | `start` |
|
||||
| `li` | `value` |
|
||||
| `table` | `summary` |
|
||||
| `th`, `td` | `rowspan`, `colspan`, `scope` |
|
||||
| `form` | `action`, `method`, `enctype` |
|
||||
| `input` | `type` (`text`, `password`, `checkbox`, `radio`, `submit`, `reset`, `hidden`), `name`, `value`, `checked`, `size`, `maxlength`, `accesskey`, `inputmode` |
|
||||
| `select` | `name`, `multiple`, `size` |
|
||||
| `option` | `value`, `selected` |
|
||||
| `optgroup` | `label` |
|
||||
| `textarea` | `name`, `rows`, `cols`, `accesskey`, `inputmode` |
|
||||
| `label` | `for`, `accesskey` |
|
||||
|
||||
### 4.2 Rules for kept features
|
||||
|
||||
- **Links.** `href` MAY point anywhere. Links to non-Mews pages are allowed; clients decide how to open them.
|
||||
- **Images.** An `img` MUST have an `alt` attribute: a description, or `alt=""` for decoration. It MUST NOT carry `width`, `height`, `align` or any other attribute that sizes, aligns or styles it. Each image is shown in its own block, at its natural size and never wider than the text column; the default stylesheet does this, and clients SHOULD do the same. Its `src` MUST point to the same site as the page (the same registered domain, so example.com and img.example.com both qualify) and MUST NOT be a `data:` URI. Formats SHOULD be GIF, JPEG or PNG, which every client and old handset can show. Each image SHOULD be under 50 KB. Authors SHOULD strip location and camera metadata. Text SHOULD NOT be presented only as an image; where it is, the alt attribute SHOULD carry that text.
|
||||
- **Tables.** Tables are for data only. Tables MUST NOT be nested, and SHOULD use `th` for header cells.
|
||||
- **Forms.** Forms SHOULD use `method="post"` for anything that changes server state.
|
||||
- **`accesskey`.** Values SHOULD be the digits 0–9, which map to phone keypads.
|
||||
|
||||
### 4.3 Size
|
||||
|
||||
The page markup SHOULD be under 64 KB and MUST be under 256 KB. The page plus all its images SHOULD be under 320 KB.
|
||||
|
||||
## 5. Presentation
|
||||
|
||||
Authors MUST NOT style their pages. The only stylesheet a Mews page may reference is the default stylesheet, which gives ordinary browsers and phones good presentation. Mews clients ignore it and use their own.
|
||||
|
||||
### 5.1 The default stylesheet
|
||||
|
||||
The project publishes a versioned default stylesheet. Below is the complete version 0.1, `mews-0.1.css`; sites copy it unchanged (5.2). Its base rules MUST be valid WAP CSS so handsets can use it; `line-height`, `max-width` and the dark-mode block are enhancements that older parsers skip. Every text and link color meets 7:1 contrast against its background.
|
||||
|
||||
```css
|
||||
/* Mews Profile default stylesheet 0.1 */
|
||||
|
||||
/* Base: light theme */
|
||||
body {
|
||||
background-color: #faf8f3;
|
||||
color: #1f1f1f;
|
||||
font-family: "Atkinson Hyperlegible", Verdana, Tahoma, system-ui, sans-serif;
|
||||
font-size: 106%;
|
||||
line-height: 1.5;
|
||||
margin: 0 auto;
|
||||
padding: 1em;
|
||||
max-width: 40em;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-weight: bold;
|
||||
line-height: 1.25;
|
||||
margin: 1.6em 0 0.5em 0;
|
||||
}
|
||||
h1 { font-size: 1.6em; margin-top: 0.5em; }
|
||||
h2 { font-size: 1.3em; }
|
||||
h3 { font-size: 1.1em; }
|
||||
h4, h5, h6 { font-size: 1em; }
|
||||
|
||||
p, ul, ol, dl, blockquote, pre, table, address {
|
||||
margin: 0 0 1em 0;
|
||||
}
|
||||
ul, ol { padding-left: 1.5em; }
|
||||
li { margin-bottom: 0.25em; }
|
||||
dt { font-weight: bold; }
|
||||
dd { margin: 0 0 0.5em 1.5em; }
|
||||
|
||||
a { color: #1a4f9c; text-decoration: underline; }
|
||||
a:visited { color: #5b2a86; }
|
||||
a:focus, a:active { outline: 2px solid #1a4f9c; }
|
||||
|
||||
blockquote {
|
||||
margin-left: 0;
|
||||
padding-left: 1em;
|
||||
border-left: 3px solid #c9c4b8;
|
||||
}
|
||||
|
||||
pre, code, kbd, samp {
|
||||
font-family: "Source Code Pro", Consolas, Menlo, "DejaVu Sans Mono", monospace;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
pre {
|
||||
background-color: #efece4;
|
||||
padding: 0.75em;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: 0;
|
||||
border-top: 1px solid #c9c4b8;
|
||||
margin: 2em 0;
|
||||
}
|
||||
|
||||
table { border-collapse: collapse; }
|
||||
th, td {
|
||||
border: 1px solid #c9c4b8;
|
||||
padding: 0.3em 0.6em;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
caption { font-weight: bold; text-align: left; }
|
||||
|
||||
img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
input, select, textarea { font-size: 1em; font-family: inherit; }
|
||||
|
||||
/* Body variants: light */
|
||||
body.mews-warm { background-color: #fbf4e8; color: #2a2420; }
|
||||
body.mews-warm a { color: #8a3d14; }
|
||||
body.mews-cool { background-color: #f3f6fa; color: #1c2430; }
|
||||
body.mews-cool a { color: #1a4f9c; }
|
||||
body.mews-green { background-color: #f2f6ef; color: #1f2a1f; }
|
||||
body.mews-green a { color: #24502a; }
|
||||
body.mews-mono { background-color: #e8ebe1; color: #1e2219; }
|
||||
body.mews-mono a { color: #1e2219; }
|
||||
|
||||
/* Dark theme: follows the system setting */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body { background-color: #18191b; color: #e3e1dc; }
|
||||
a { color: #8fb8f5; }
|
||||
a:visited { color: #c9a3f2; }
|
||||
a:focus, a:active { outline-color: #8fb8f5; }
|
||||
blockquote, hr, th, td { border-color: #45464a; }
|
||||
pre { background-color: #222326; }
|
||||
|
||||
body.mews-warm { background-color: #1d1916; color: #e8dfd3; }
|
||||
body.mews-warm a { color: #f0b48a; }
|
||||
body.mews-cool { background-color: #161a20; color: #dde4ee; }
|
||||
body.mews-cool a { color: #8fb8f5; }
|
||||
body.mews-green { background-color: #161b16; color: #dbe6d8; }
|
||||
body.mews-green a { color: #9fd39a; }
|
||||
body.mews-mono { background-color: #1b1d18; color: #c8d0b8; }
|
||||
body.mews-mono a { color: #c8d0b8; }
|
||||
}
|
||||
|
||||
html { color-scheme: light dark; }
|
||||
```
|
||||
|
||||
### 5.2 Linking it
|
||||
|
||||
A Mews page SHOULD link the default stylesheet with exactly one element:
|
||||
|
||||
```xml
|
||||
<link rel="stylesheet" type="text/css" href="mews-0.1.css" />
|
||||
```
|
||||
|
||||
Sites SHOULD host their own copy rather than linking a central URL, so no single server sees traffic across all sites. A copy on another site is also a resource from another site, which section 7.4 forbids; the project's own copy at `mews.page/mews-0.1.css` is the one exception a validator tolerates, and it warns about it. Authors MUST NOT modify their copy, except to add @font-face rules that load font files from their own site; any other change makes the page non-conforming.
|
||||
|
||||
### 5.3 Body variants
|
||||
|
||||
To let sites look distinct without author styling, `body` MAY carry one class from this list. The default stylesheet and Mews clients choose how each variant looks.
|
||||
|
||||
| Class | Intent |
|
||||
| --- | --- |
|
||||
| `mews-warm` | Warm palette |
|
||||
| `mews-cool` | Cool palette |
|
||||
| `mews-green` | Green palette |
|
||||
| `mews-mono` | Monochrome, like an early phone screen |
|
||||
|
||||
Mews clients MAY ignore variants and instead derive colors from the hostname.
|
||||
|
||||
## 6. Subscriptions
|
||||
|
||||
Any Mews page can be subscribed to through dated links. Sites MAY also offer an Atom feed for ordinary feed readers.
|
||||
|
||||
### 6.1 Dated links
|
||||
|
||||
A link is an entry when it starts a list item (li) and its text begins with a date in `YYYY-MM-DD` format, followed by a space and a title:
|
||||
|
||||
```xml
|
||||
<ul>
|
||||
<li><a href="2026-10-08-retro-phones.html">2026-10-08 Collecting retro phones</a></li>
|
||||
<li><a href="2026-09-21-first-post.html">2026-09-21 First post</a></li>
|
||||
</ul>
|
||||
```
|
||||
|
||||
Rules:
|
||||
|
||||
- Entries SHOULD be listed newest first.
|
||||
- An entry's URL SHOULD NOT change once published; clients use it to tell entries apart.
|
||||
- A Mews client subscribing to a page MUST treat each entry link as a post and report new ones.
|
||||
|
||||
### 6.2 Atom feeds
|
||||
|
||||
A site MAY publish an Atom feed and link it from the head:
|
||||
|
||||
```xml
|
||||
<link rel="alternate" type="application/atom+xml" href="feed.xml" title="Posts" />
|
||||
```
|
||||
|
||||
The feed SHOULD contain the same entries as the dated-links page. Entry content in the feed, if any, SHOULD itself follow section 4.
|
||||
|
||||
## 7. Transport and serving
|
||||
|
||||
Mews pages are served over ordinary HTTP. No special server software is needed.
|
||||
|
||||
### 7.1 MIME type
|
||||
|
||||
Servers SHOULD send Mews pages as `text/html`, so browsers still display a page that has a small markup error. Servers MAY send `application/xhtml+xml`, or `application/vnd.wap.xhtml+xml`, to clients whose `Accept` header prefers it. Mews clients parse pages as XML whatever the MIME type.
|
||||
|
||||
### 7.2 HTTPS and HTTP
|
||||
|
||||
Sites SHOULD serve over HTTPS. Because WAP 2.0 handsets cannot negotiate modern TLS, sites MAY also serve the same pages over plain HTTP. A site serving both MUST NOT redirect HTTP requests to HTTPS for clients that cannot follow it; a common approach is to redirect only when the `User-Agent` is a modern browser.
|
||||
|
||||
### 7.3 Caching
|
||||
|
||||
Servers SHOULD send `Last-Modified` or `ETag` headers so clients and aggregators can check for changes cheaply.
|
||||
|
||||
### 7.4 No tracking
|
||||
|
||||
Mews pages MUST NOT load resources from other sites. Servers MUST NOT set cookies on requests for Mews pages, except as part of a form the reader submits.
|
||||
|
||||
## 8. Clients
|
||||
|
||||
Any browser can read a Mews page. This section applies to Mews clients, which present pages their own way.
|
||||
|
||||
### 8.1 Requirements
|
||||
|
||||
A Mews client:
|
||||
|
||||
- MUST detect the conformance marker and apply Mews presentation only to pages that carry it.
|
||||
- MUST ignore any author CSS, including the default stylesheet, and use its own presentation.
|
||||
- MUST NOT execute scripts or event attributes, even on a page that wrongly includes them.
|
||||
- MUST NOT load resources from sites other than the page's own site without the reader's action.
|
||||
- MUST display a page that is not well-formed as a clear error, or offer to show its text; it MUST NOT silently guess.
|
||||
|
||||
### 8.2 Recommendations
|
||||
|
||||
A Mews client SHOULD:
|
||||
|
||||
- Let the reader choose fonts, sizes, colors and line width.
|
||||
- Support `accesskey` as keyboard or keypad shortcuts.
|
||||
- Support subscriptions through dated links (6.1) and Atom (6.2).
|
||||
- Show a non-Mews page plainly, or hand it to the system browser, rather than refusing it.
|
||||
- Mark links to non-Mews pages before the reader follows them, where it can tell.
|
||||
|
||||
### 8.3 Freedom
|
||||
|
||||
Clients MAY present pages in any way that keeps their structure intact, including reflowing tables on narrow screens, or hiding images until requested.
|
||||
|
||||
## 9. Validation, directory and versioning
|
||||
|
||||
### 9.1 Validation
|
||||
|
||||
A page conforms when it passes two checks:
|
||||
|
||||
1. **The Mews DTD.** The XHTML-MP 1.2 DTD, restricted as in section 4 and extended with lang and dir, published with each spec version at `mews.page/dtd/mews-<version>.dtd` (this one at `mews.page/dtd/mews-0.1.dtd`). It encodes the permitted elements and attributes (4.1), the head rules (3.3), the body variant values (5.3) and the ban on nested tables (4.2).
|
||||
2. **Rule checks.** The rules a DTD cannot express: image sources, formats and sizes (4.2), page size (4.3), the default stylesheet link and its unmodified copy (5.2), and no resources from other sites (7.4).
|
||||
|
||||
Apart from lang and dir, every page that passes the Mews DTD is also valid XHTML-MP 1.2. Pages keep the XHTML-MP doctype from 3.1; the Mews DTD is used only by validators. The project publishes a validator that runs both checks and reports each failure with its section number, at mews.page/check and as a command line tool.
|
||||
|
||||
The project also hosts a copy of the original XHTML-MP 1.2 DTD at `mews.page/dtd/xhtml-mobile12.dtd`, so validation never depends on the Open Mobile Alliance's server. Browsers and clients MUST NOT fetch either DTD.
|
||||
|
||||
### 9.2 Directory
|
||||
|
||||
The Mews directory at mews.page/directory lists only sites whose pages pass validation. Anyone may submit a page address: the page is fetched and checked, and a page that passes lists its site at once. Nobody reviews submissions, and the directory holds no contact details.
|
||||
|
||||
Listed sites are rechecked periodically. A site whose page stops conforming is removed; submitting the page again once it is fixed lists the site again straight away. A site the checker simply cannot reach is retried for a few days before it is removed, because downtime is not a conformance failure. The checks say nothing about what a site publishes, so the project also removes a listing on request.
|
||||
|
||||
### 9.3 Versioning
|
||||
|
||||
The spec version uses `MAJOR.MINOR`. A minor version may only relax rules or add recommendations, so pages valid under an earlier minor version remain valid. A major version may tighten rules. Clients SHOULD accept any version with a major number they support.
|
||||
|
||||
## Appendix A. Example Mews page
|
||||
|
||||
A complete conforming page with a posts list and a feed link:
|
||||
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"
|
||||
"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Signal Bars</title>
|
||||
<meta name="mews-profile" content="0.1" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta name="description" content="Notes on old phones and small screens." />
|
||||
<link rel="stylesheet" type="text/css" href="mews-0.1.css" />
|
||||
<link rel="alternate" type="application/atom+xml" href="feed.xml" title="Posts" />
|
||||
</head>
|
||||
<body class="mews-green">
|
||||
<h1>Signal Bars</h1>
|
||||
<p>Notes on old phones, small screens and <em>slow</em> software.</p>
|
||||
|
||||
<h2>Posts</h2>
|
||||
<ul>
|
||||
<li><a href="2026-10-08-retro-phones.html" accesskey="1">2026-10-08 Collecting retro phones</a></li>
|
||||
<li><a href="2026-09-21-first-post.html" accesskey="2">2026-09-21 First post</a></li>
|
||||
</ul>
|
||||
|
||||
<hr />
|
||||
<p><a href="about.html" accesskey="0">About this site</a></p>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
102
spec/check_dtd.py
Normal file
102
spec/check_dtd.py
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
#!/usr/bin/env python
|
||||
"""Check mews-0.1.dtd against the XHTML Mobile 1.2 driver and the spec.
|
||||
|
||||
The Mews DTD is maintained by hand. It cannot be generated by stripping
|
||||
xhtml-mobile12.dtd: that file is a driver which declares no elements (the
|
||||
declarations live in the W3C and OMA module files it points to), DTD
|
||||
attribute lists only ever add, a re-declared element is an error rather
|
||||
than an override, and the rules that define Mews (the head model of
|
||||
SPEC.md 3.3, the body variant classes of 5.3, the ban on nested tables
|
||||
of 4.2, and lang and dir) do not exist in XHTML-MP to be kept.
|
||||
|
||||
This script verifies what the driver and the spec can check:
|
||||
|
||||
- the driver is the expected XHTML Mobile 1.2 driver, with event
|
||||
attributes included and bidi ignored, so lang and dir are Mews
|
||||
extensions (SPEC.md 3);
|
||||
- the DTD declares exactly the elements SPEC.md 4.1 permits;
|
||||
- the DTD keeps the driver's pre content model verbatim;
|
||||
- the DTD keeps the li value and ol start attributes the driver adds.
|
||||
|
||||
Run with: uv run check_dtd.py
|
||||
"""
|
||||
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parent
|
||||
DRIVER_PATH = ROOT / "xhtml-mobile12.dtd"
|
||||
DTD_PATH = ROOT / "mews-0.1.dtd"
|
||||
|
||||
DRIVER_FPI = "-//OMA//DTD XHTML Mobile 1.2//EN"
|
||||
|
||||
# The Mews element set (SPEC.md 4.1).
|
||||
KEPT_ELEMENTS = (
|
||||
"html head title body "
|
||||
"h1 h2 h3 h4 h5 h6 "
|
||||
"p blockquote pre address hr "
|
||||
"em strong b i code kbd samp var q cite abbr dfn br "
|
||||
"a "
|
||||
"ul ol li dl dt dd "
|
||||
"table caption tr th td "
|
||||
"img "
|
||||
"form fieldset label input select option optgroup textarea "
|
||||
"meta link"
|
||||
).split()
|
||||
|
||||
|
||||
def entity(text, name):
|
||||
match = re.search(r"<!ENTITY\s+%\s*" + re.escape(name) + r'\s+"([^"]*)"', text)
|
||||
return match.group(1).strip() if match else None
|
||||
|
||||
|
||||
def pre_content(text):
|
||||
match = re.search(r'<!ENTITY\s+%\s*pre\.content\s+"(.*?)"\s*>', text, re.DOTALL)
|
||||
return re.sub(r"\s+", " ", match.group(1)) if match else None
|
||||
|
||||
|
||||
def attlist(text, element):
|
||||
match = re.search(r"<!ATTLIST\s+" + element + r"\s+(.*?)\n>", text, re.DOTALL)
|
||||
return match.group(1) if match else None
|
||||
|
||||
|
||||
def main():
|
||||
driver = DRIVER_PATH.read_text(encoding="utf-8")
|
||||
dtd = DTD_PATH.read_text(encoding="utf-8")
|
||||
errors = []
|
||||
|
||||
def check(condition, message):
|
||||
if not condition:
|
||||
errors.append(message)
|
||||
|
||||
check(entity(driver, "XHTML.version") == DRIVER_FPI, "driver is not XHTML Mobile 1.2")
|
||||
check(
|
||||
entity(driver, "xhtml-events.module") == "INCLUDE",
|
||||
"driver must include event attributes; Mews drops them",
|
||||
)
|
||||
check(
|
||||
entity(driver, "XHTML.bidi") == "IGNORE",
|
||||
"driver must ignore bidi, so dir is a Mews extension",
|
||||
)
|
||||
|
||||
declared = set(re.findall(r"<!ELEMENT\s+([\w:-]+)", dtd))
|
||||
expected = set(KEPT_ELEMENTS)
|
||||
check(
|
||||
declared == expected,
|
||||
f"elements differ from SPEC.md 4.1: {sorted(declared ^ expected)}",
|
||||
)
|
||||
|
||||
check(pre_content(dtd) == pre_content(driver), "pre content model differs from the driver's")
|
||||
check("value" in (attlist(dtd, "li") or ""), "li is missing the driver's value attribute")
|
||||
check("start" in (attlist(dtd, "ol") or ""), "ol is missing the driver's start attribute")
|
||||
|
||||
if errors:
|
||||
for message in errors:
|
||||
print(f"error: {message}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
print(f"{DTD_PATH.name} matches the driver and SPEC.md 4.1 ({len(expected)} elements)")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
106
spec/mews-0.1.css
Normal file
106
spec/mews-0.1.css
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
/* Mews Profile default stylesheet 0.1 */
|
||||
|
||||
/* Base: light theme */
|
||||
body {
|
||||
background-color: #faf8f3;
|
||||
color: #1f1f1f;
|
||||
font-family: "Atkinson Hyperlegible", Verdana, Tahoma, system-ui, sans-serif;
|
||||
font-size: 106%;
|
||||
line-height: 1.5;
|
||||
margin: 0 auto;
|
||||
padding: 1em;
|
||||
max-width: 40em;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-weight: bold;
|
||||
line-height: 1.25;
|
||||
margin: 1.6em 0 0.5em 0;
|
||||
}
|
||||
h1 { font-size: 1.6em; margin-top: 0.5em; }
|
||||
h2 { font-size: 1.3em; }
|
||||
h3 { font-size: 1.1em; }
|
||||
h4, h5, h6 { font-size: 1em; }
|
||||
|
||||
p, ul, ol, dl, blockquote, pre, table, address {
|
||||
margin: 0 0 1em 0;
|
||||
}
|
||||
ul, ol { padding-left: 1.5em; }
|
||||
li { margin-bottom: 0.25em; }
|
||||
dt { font-weight: bold; }
|
||||
dd { margin: 0 0 0.5em 1.5em; }
|
||||
|
||||
a { color: #1a4f9c; text-decoration: underline; }
|
||||
a:visited { color: #5b2a86; }
|
||||
a:focus, a:active { outline: 2px solid #1a4f9c; }
|
||||
|
||||
blockquote {
|
||||
margin-left: 0;
|
||||
padding-left: 1em;
|
||||
border-left: 3px solid #c9c4b8;
|
||||
}
|
||||
|
||||
pre, code, kbd, samp {
|
||||
font-family: "Source Code Pro", Consolas, Menlo, "DejaVu Sans Mono", monospace;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
pre {
|
||||
background-color: #efece4;
|
||||
padding: 0.75em;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: 0;
|
||||
border-top: 1px solid #c9c4b8;
|
||||
margin: 2em 0;
|
||||
}
|
||||
|
||||
table { border-collapse: collapse; }
|
||||
th, td {
|
||||
border: 1px solid #c9c4b8;
|
||||
padding: 0.3em 0.6em;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
caption { font-weight: bold; text-align: left; }
|
||||
|
||||
img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
input, select, textarea { font-size: 1em; font-family: inherit; }
|
||||
|
||||
/* Body variants: light */
|
||||
body.mews-warm { background-color: #fbf4e8; color: #2a2420; }
|
||||
body.mews-warm a { color: #8a3d14; }
|
||||
body.mews-cool { background-color: #f3f6fa; color: #1c2430; }
|
||||
body.mews-cool a { color: #1a4f9c; }
|
||||
body.mews-green { background-color: #f2f6ef; color: #1f2a1f; }
|
||||
body.mews-green a { color: #24502a; }
|
||||
body.mews-mono { background-color: #e8ebe1; color: #1e2219; }
|
||||
body.mews-mono a { color: #1e2219; }
|
||||
|
||||
/* Dark theme: follows the system setting */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body { background-color: #18191b; color: #e3e1dc; }
|
||||
a { color: #8fb8f5; }
|
||||
a:visited { color: #c9a3f2; }
|
||||
a:focus, a:active { outline-color: #8fb8f5; }
|
||||
blockquote, hr, th, td { border-color: #45464a; }
|
||||
pre { background-color: #222326; }
|
||||
|
||||
body.mews-warm { background-color: #1d1916; color: #e8dfd3; }
|
||||
body.mews-warm a { color: #f0b48a; }
|
||||
body.mews-cool { background-color: #161a20; color: #dde4ee; }
|
||||
body.mews-cool a { color: #8fb8f5; }
|
||||
body.mews-green { background-color: #161b16; color: #dbe6d8; }
|
||||
body.mews-green a { color: #9fd39a; }
|
||||
body.mews-mono { background-color: #1b1d18; color: #c8d0b8; }
|
||||
body.mews-mono a { color: #c8d0b8; }
|
||||
}
|
||||
|
||||
html { color-scheme: light dark; }
|
||||
396
spec/mews-0.1.dtd
Normal file
396
spec/mews-0.1.dtd
Normal file
|
|
@ -0,0 +1,396 @@
|
|||
<!-- Mews Profile 0.1 DTD
|
||||
Published at mews.page/dtd/mews-0.1.dtd. Browsers and clients must not
|
||||
fetch this file.
|
||||
|
||||
XHTML Mobile Profile 1.2 restricted as in the Mews Profile
|
||||
Specification 0.1 section 4, extended with lang and dir (section 3).
|
||||
Maintained by hand and checked against the XHTML Mobile 1.2 driver,
|
||||
xhtml-mobile12.dtd (OMA-SUP-DTD_xhtml_mobile12-V1_2-20080331-A), by
|
||||
check_dtd.py. It cannot be generated by stripping the driver: the
|
||||
driver declares no elements itself, attribute lists only ever add,
|
||||
and the rules below do not exist in XHTML-MP to be kept.
|
||||
|
||||
This file is standalone: it declares every element and attribute
|
||||
itself, so validation never depends on the Open Mobile Alliance's or
|
||||
W3C's servers. Pages keep the XHTML-MP doctype (section 3.1); only
|
||||
validators use this file (section 9.1).
|
||||
|
||||
Encoded here: the permitted elements and attributes (4.1), the head
|
||||
rules (3.3), the body variant classes (5.3) and the ban on nested
|
||||
tables (4.2). 51 elements are kept from XHTML Mobile 1.2. Dropped:
|
||||
acronym, base, big, button, div, legend, noscript, object, param,
|
||||
script, small, span, style, sub, sup, tt. Event attributes and the
|
||||
style attribute are omitted entirely.
|
||||
-->
|
||||
|
||||
<!-- Datatypes (as in XHTML Modularization) -->
|
||||
<!ENTITY % Text.datatype "CDATA" >
|
||||
<!ENTITY % URI.datatype "CDATA" >
|
||||
<!ENTITY % Number.datatype "CDATA" >
|
||||
<!ENTITY % LanguageCode.datatype "NMTOKEN" >
|
||||
<!ENTITY % Character.datatype "CDATA" >
|
||||
|
||||
<!-- Common attributes. id, title, xml:lang, lang and dir are permitted
|
||||
on every element in the body (SPEC.md 4.1); lang and dir are the Mews
|
||||
extensions over XHTML-MP (SPEC.md 3). -->
|
||||
<!ENTITY % id.attrib "id ID #IMPLIED" >
|
||||
<!ENTITY % title.attrib "title CDATA #IMPLIED" >
|
||||
<!ENTITY % i18n.attrib
|
||||
"xml:lang %LanguageCode.datatype; #IMPLIED
|
||||
lang %LanguageCode.datatype; #IMPLIED
|
||||
dir (ltr | rtl) #IMPLIED" >
|
||||
<!ENTITY % Common.attrib "%id.attrib; %title.attrib; %i18n.attrib;" >
|
||||
|
||||
<!-- Inline classes -->
|
||||
<!ENTITY % InlStruct.class "br" >
|
||||
<!ENTITY % InlPhras.class "| em | strong | code | kbd | samp | var | q | cite | abbr | dfn" >
|
||||
<!ENTITY % InlPres.class "| b | i" >
|
||||
<!ENTITY % Anchor.class "| a" >
|
||||
<!ENTITY % InlSpecial.class "| img" >
|
||||
<!ENTITY % InlFormNoLabel.class "| input | select | textarea" >
|
||||
<!ENTITY % InlForm.class "%InlFormNoLabel.class; | label" >
|
||||
<!ENTITY % Inline.extra "" >
|
||||
<!ENTITY % Inline.class "%InlStruct.class;
|
||||
%InlPhras.class;
|
||||
%InlPres.class;
|
||||
%Anchor.class;
|
||||
%InlSpecial.class;
|
||||
%InlForm.class;
|
||||
%Inline.extra;" >
|
||||
<!ENTITY % InlNoAnchor.class "%InlStruct.class;
|
||||
%InlPhras.class;
|
||||
%InlPres.class;
|
||||
%InlSpecial.class;
|
||||
%InlForm.class;
|
||||
%Inline.extra;" >
|
||||
<!ENTITY % InlNoLabel.class "%InlStruct.class;
|
||||
%InlPhras.class;
|
||||
%InlPres.class;
|
||||
%Anchor.class;
|
||||
%InlSpecial.class;
|
||||
%InlFormNoLabel.class;
|
||||
%Inline.extra;" >
|
||||
|
||||
<!-- Block classes -->
|
||||
<!ENTITY % Heading.class "h1 | h2 | h3 | h4 | h5 | h6" >
|
||||
<!ENTITY % List.class "ul | ol | dl" >
|
||||
<!ENTITY % BlkStruct.class "p" >
|
||||
<!ENTITY % BlkPhras.class "| pre | blockquote | address" >
|
||||
<!ENTITY % BlkPres.class "| hr" >
|
||||
<!ENTITY % Table.class "| table" >
|
||||
<!ENTITY % Form.class "| form" >
|
||||
<!ENTITY % Fieldset.class "| fieldset" >
|
||||
<!ENTITY % Block.extra "" >
|
||||
<!ENTITY % BlkNoForm.class "%Heading.class;
|
||||
| %List.class;
|
||||
| %BlkStruct.class;
|
||||
%BlkPhras.class;
|
||||
%BlkPres.class;
|
||||
%Fieldset.class;
|
||||
%Block.extra;" >
|
||||
<!ENTITY % BlkNoTable.class "%BlkNoForm.class;
|
||||
%Form.class;
|
||||
%Block.extra;" >
|
||||
<!ENTITY % Blk.class "%BlkNoTable.class;
|
||||
%Table.class;
|
||||
%Block.extra;" >
|
||||
<!ENTITY % FlowNoTable.class "%Inline.class;
|
||||
| %BlkNoTable.class;" >
|
||||
|
||||
<!-- pre content model, taken verbatim from the driver. It excludes
|
||||
%InlPres.class; and %InlSpecial.class;, so b, i and img are not
|
||||
permitted in pre, as in XHTML Mobile 1.2. -->
|
||||
<!ENTITY % pre.content
|
||||
"( #PCDATA
|
||||
| %InlStruct.class;
|
||||
%InlPhras.class;
|
||||
%Anchor.class;
|
||||
%Inline.extra; )*"
|
||||
>
|
||||
|
||||
<!-- Document structure (SPEC.md 4.1) -->
|
||||
<!--
|
||||
Only body uses %Blk.class;, so a table can appear directly in the
|
||||
body and nowhere else, and tables cannot nest (SPEC.md 4.2). body may
|
||||
carry one class from the variant list (SPEC.md 5.3).
|
||||
-->
|
||||
<!ELEMENT html ( head, body ) >
|
||||
<!ATTLIST html
|
||||
xmlns CDATA #FIXED "http://www.w3.org/1999/xhtml"
|
||||
xml:lang %LanguageCode.datatype; #IMPLIED
|
||||
lang %LanguageCode.datatype; #IMPLIED
|
||||
dir (ltr | rtl) #IMPLIED
|
||||
>
|
||||
<!ELEMENT head ( title, meta, ( meta | link )* ) >
|
||||
<!ELEMENT title ( #PCDATA )* >
|
||||
<!ELEMENT body ( %Blk.class; )+ >
|
||||
<!ATTLIST body
|
||||
%Common.attrib;
|
||||
class (mews-warm | mews-cool | mews-green | mews-mono) #IMPLIED
|
||||
>
|
||||
|
||||
<!-- Head elements (SPEC.md 3.3) -->
|
||||
<!--
|
||||
The head may contain only title, meta and link. The title comes
|
||||
first and at least one meta is required; the conformance marker is a
|
||||
meta (SPEC.md 3.2), but a DTD cannot check its name and content
|
||||
together, so validators confirm the marker as a rule check (SPEC.md
|
||||
9.1). link rel is limited to the uses SPEC.md 3.3 names: the
|
||||
stylesheet, the icon and feed links.
|
||||
-->
|
||||
<!ELEMENT meta EMPTY >
|
||||
<!ATTLIST meta
|
||||
name NMTOKEN #IMPLIED
|
||||
content CDATA #REQUIRED
|
||||
>
|
||||
<!ELEMENT link EMPTY >
|
||||
<!ATTLIST link
|
||||
rel (alternate | icon | stylesheet) #IMPLIED
|
||||
href %URI.datatype; #IMPLIED
|
||||
type CDATA #IMPLIED
|
||||
title CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!-- Headings (SPEC.md 4.1) -->
|
||||
<!ELEMENT h1 ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST h1
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT h2 ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST h2
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT h3 ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST h3
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT h4 ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST h4
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT h5 ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST h5
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT h6 ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST h6
|
||||
%Common.attrib;
|
||||
>
|
||||
|
||||
<!-- Text blocks (SPEC.md 4.1) -->
|
||||
<!ELEMENT p ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST p
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT blockquote ( %BlkNoTable.class; )* >
|
||||
<!ATTLIST blockquote
|
||||
%Common.attrib;
|
||||
cite %URI.datatype; #IMPLIED
|
||||
>
|
||||
<!ELEMENT pre %pre.content; >
|
||||
<!ATTLIST pre
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT address ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST address
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT hr EMPTY >
|
||||
<!ATTLIST hr
|
||||
%Common.attrib;
|
||||
>
|
||||
|
||||
<!-- Inline text (SPEC.md 4.1) -->
|
||||
<!ELEMENT em ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST em
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT strong ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST strong
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT code ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST code
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT kbd ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST kbd
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT samp ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST samp
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT var ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST var
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT cite ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST cite
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT abbr ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST abbr
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT dfn ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST dfn
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT b ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST b
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT i ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST i
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT q ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST q
|
||||
%Common.attrib;
|
||||
cite %URI.datatype; #IMPLIED
|
||||
>
|
||||
<!ELEMENT br EMPTY >
|
||||
<!ATTLIST br
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT a ( #PCDATA | %InlNoAnchor.class; )* >
|
||||
<!ATTLIST a
|
||||
%Common.attrib;
|
||||
href %URI.datatype; #IMPLIED
|
||||
hreflang %LanguageCode.datatype; #IMPLIED
|
||||
rel CDATA #IMPLIED
|
||||
type CDATA #IMPLIED
|
||||
accesskey %Character.datatype; #IMPLIED
|
||||
>
|
||||
<!ELEMENT img EMPTY >
|
||||
<!ATTLIST img
|
||||
%Common.attrib;
|
||||
src %URI.datatype; #REQUIRED
|
||||
alt %Text.datatype; #REQUIRED
|
||||
>
|
||||
|
||||
<!-- Lists (SPEC.md 4.1) -->
|
||||
<!ELEMENT ul ( li )+ >
|
||||
<!ATTLIST ul
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT ol ( li )+ >
|
||||
<!ATTLIST ol
|
||||
%Common.attrib;
|
||||
start %Number.datatype; #IMPLIED
|
||||
>
|
||||
<!ELEMENT dl ( dt | dd )+ >
|
||||
<!ATTLIST dl
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT li ( #PCDATA | %FlowNoTable.class; )* >
|
||||
<!ATTLIST li
|
||||
%Common.attrib;
|
||||
value %Number.datatype; #IMPLIED
|
||||
>
|
||||
<!ELEMENT dt ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST dt
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT dd ( #PCDATA | %FlowNoTable.class; )* >
|
||||
<!ATTLIST dd
|
||||
%Common.attrib;
|
||||
>
|
||||
|
||||
<!-- Tables (SPEC.md 4.2) -->
|
||||
<!--
|
||||
As in the XHTML Mobile basic tables module, cells take
|
||||
%FlowNoTable.class; and never a table, so tables cannot nest
|
||||
(SPEC.md 4.2).
|
||||
-->
|
||||
<!ELEMENT table ( caption?, tr+ ) >
|
||||
<!ATTLIST table
|
||||
%Common.attrib;
|
||||
summary %Text.datatype; #IMPLIED
|
||||
>
|
||||
<!ELEMENT caption ( #PCDATA | %Inline.class; )* >
|
||||
<!ATTLIST caption
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT tr ( th | td )+ >
|
||||
<!ATTLIST tr
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT th ( #PCDATA | %FlowNoTable.class; )* >
|
||||
<!ATTLIST th
|
||||
%Common.attrib;
|
||||
rowspan %Number.datatype; "1"
|
||||
colspan %Number.datatype; "1"
|
||||
scope (row | col) #IMPLIED
|
||||
>
|
||||
<!ELEMENT td ( #PCDATA | %FlowNoTable.class; )* >
|
||||
<!ATTLIST td
|
||||
%Common.attrib;
|
||||
rowspan %Number.datatype; "1"
|
||||
colspan %Number.datatype; "1"
|
||||
scope (row | col) #IMPLIED
|
||||
>
|
||||
|
||||
<!-- Forms (SPEC.md 4.1, 4.2) -->
|
||||
<!--
|
||||
As in the XHTML MP forms module, form takes %BlkNoForm.class;, so
|
||||
forms cannot nest. fieldset also takes %BlkNoForm.class;, so a
|
||||
fieldset cannot reintroduce a form.
|
||||
-->
|
||||
<!ELEMENT form ( %BlkNoForm.class; )+ >
|
||||
<!ATTLIST form
|
||||
%Common.attrib;
|
||||
action %URI.datatype; #REQUIRED
|
||||
method (get | post) "get"
|
||||
enctype CDATA "application/x-www-form-urlencoded"
|
||||
>
|
||||
<!ELEMENT fieldset ( #PCDATA | %Inline.class; | %BlkNoForm.class; )* >
|
||||
<!ATTLIST fieldset
|
||||
%Common.attrib;
|
||||
>
|
||||
<!ELEMENT label ( #PCDATA | %InlNoLabel.class; )* >
|
||||
<!ATTLIST label
|
||||
%Common.attrib;
|
||||
for IDREF #IMPLIED
|
||||
accesskey %Character.datatype; #IMPLIED
|
||||
>
|
||||
<!ELEMENT input EMPTY >
|
||||
<!ATTLIST input
|
||||
%Common.attrib;
|
||||
type (text | password | checkbox | radio | submit | reset | hidden) "text"
|
||||
name CDATA #IMPLIED
|
||||
value CDATA #IMPLIED
|
||||
checked (checked) #IMPLIED
|
||||
size %Number.datatype; #IMPLIED
|
||||
maxlength %Number.datatype; #IMPLIED
|
||||
accesskey %Character.datatype; #IMPLIED
|
||||
inputmode CDATA #IMPLIED
|
||||
>
|
||||
<!ELEMENT select ( optgroup | option )+ >
|
||||
<!ATTLIST select
|
||||
%Common.attrib;
|
||||
name CDATA #IMPLIED
|
||||
multiple (multiple) #IMPLIED
|
||||
size %Number.datatype; #IMPLIED
|
||||
>
|
||||
<!ELEMENT optgroup ( option )+ >
|
||||
<!ATTLIST optgroup
|
||||
%Common.attrib;
|
||||
label %Text.datatype; #REQUIRED
|
||||
>
|
||||
<!ELEMENT option ( #PCDATA )* >
|
||||
<!ATTLIST option
|
||||
%Common.attrib;
|
||||
value CDATA #IMPLIED
|
||||
selected (selected) #IMPLIED
|
||||
>
|
||||
<!ELEMENT textarea ( #PCDATA )* >
|
||||
<!ATTLIST textarea
|
||||
%Common.attrib;
|
||||
name CDATA #IMPLIED
|
||||
rows %Number.datatype; #REQUIRED
|
||||
cols %Number.datatype; #REQUIRED
|
||||
accesskey %Character.datatype; #IMPLIED
|
||||
inputmode CDATA #IMPLIED
|
||||
>
|
||||
248
spec/xhtml-mobile12.dtd
Normal file
248
spec/xhtml-mobile12.dtd
Normal file
|
|
@ -0,0 +1,248 @@
|
|||
<!--
|
||||
FILE INFORMATION
|
||||
|
||||
OMA Permanent Document
|
||||
File: OMA-SUP-DTD_xhtml_mobile12-V1_2-20080331-A
|
||||
Type: Text
|
||||
|
||||
Public Reachable Information
|
||||
Path: http://www.openmobilealliance.org/tech/DTD
|
||||
Name: xhtml-mobile12.dtd
|
||||
|
||||
NORMATIVE INFORMATION
|
||||
|
||||
Information about this file can be found in the specification
|
||||
OMA-TS-XHTMLMP-V1_2-20080331-A available at
|
||||
http://www.openmobilealliance.org/
|
||||
|
||||
Send comments to technical-comments@mail.openmobilealliance.org
|
||||
|
||||
LEGAL DISCLAIMER
|
||||
|
||||
Use of this document is subject to all of the terms and conditions
|
||||
of the Use Agreement located at
|
||||
http://www.openmobilealliance.org/UseAgreement.html
|
||||
|
||||
You may use this document or any part of the document for internal
|
||||
or educational purposes only, provided you do not modify, edit or
|
||||
take out of context the information in this document in any manner.
|
||||
Information contained in this document may be used, at your sole
|
||||
risk, for any purposes.
|
||||
|
||||
You may not use this document in any other manner without the prior
|
||||
written permission of the Open Mobile Alliance. The Open Mobile
|
||||
Alliance authorizes you to copy this document, provided that you
|
||||
retain all copyright and other proprietary notices contained in the
|
||||
original materials on any copies of the materials and that you
|
||||
comply strictly with these terms. This copyright permission does
|
||||
not constitute an endorsement of the products or services. The
|
||||
Open Mobile Alliance assumes no responsibility for errors or
|
||||
omissions in this document.
|
||||
|
||||
Each Open Mobile Alliance member has agreed to use reasonable
|
||||
endeavors to inform the Open Mobile Alliance in a timely manner of
|
||||
Essential IPR as it becomes aware that the Essential IPR is related
|
||||
to the prepared or published specification. However, the members
|
||||
do not have an obligation to conduct IPR searches. The declared
|
||||
Essential IPR is publicly available to members and non-members of
|
||||
the Open Mobile Alliance and may be found on the "OMA IPR
|
||||
Declarations" list at http://www.openmobilealliance.org/ipr.html.
|
||||
The Open Mobile Alliance has not conducted an independent IPR review
|
||||
of this document and the information contained herein, and makes no
|
||||
representations or warranties regarding third party IPR, including
|
||||
without limitation patents, copyrights or trade secret rights. This
|
||||
document may contain inventions for which you must obtain licenses
|
||||
from third parties before making, using or selling the inventions.
|
||||
Defined terms above are set forth in the schedule to the Open Mobile
|
||||
Alliance Application Form.
|
||||
|
||||
NO REPRESENTATIONS OR WARRANTIES (WHETHER EXPRESS OR IMPLIED) ARE
|
||||
MADE BY THE OPEN MOBILE ALLIANCE OR ANY OPEN MOBILE ALLIANCE MEMBER
|
||||
OR ITS AFFILIATES REGARDING ANY OF THE IPR'S REPRESENTED ON THE "OMA
|
||||
IPR DECLARATIONS" LIST, INCLUDING, BUT NOT LIMITED TO THE ACCURACY,
|
||||
COMPLETENESS, VALIDITY OR RELEVANCE OF THE INFORMATION OR WHETHER OR
|
||||
NOT SUCH RIGHTS ARE ESSENTIAL OR NON-ESSENTIAL.
|
||||
|
||||
THE OPEN MOBILE ALLIANCE IS NOT LIABLE FOR AND HEREBY DISCLAIMS ANY
|
||||
DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR
|
||||
EXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF
|
||||
DOCUMENTS AND THE INFORMATION CONTAINED IN THE DOCUMENTS.
|
||||
|
||||
Copyright 2008 Open Mobile Alliance Ltd. All Rights Reserved.
|
||||
Used with the permission of the Open Mobile Alliance Ltd. under the
|
||||
terms set forth above.
|
||||
-->
|
||||
<!-- This is the driver file for version 1.2 of the XHTML Mobile DTD.
|
||||
|
||||
This DTD is identified by the PUBLIC and SYSTEM identifiers:
|
||||
|
||||
PUBLIC: "-//OMA//DTD XHTML Mobile 1.2//EN"
|
||||
SYSTEM: "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd"
|
||||
-->
|
||||
<!ENTITY % XHTML.version "-//OMA//DTD XHTML Mobile 1.2//EN" >
|
||||
|
||||
<!-- Use this URI to identify the default namespace:
|
||||
|
||||
"http://www.w3.org/1999/xhtml"
|
||||
|
||||
See the Qualified Names module for information
|
||||
on the use of namespace prefixes in the DTD.
|
||||
-->
|
||||
<!ENTITY % NS.prefixed "IGNORE" >
|
||||
<!ENTITY % XHTML.prefix "" >
|
||||
|
||||
<!-- For example, if you are using XHTML Mobile 1.2 directly, use
|
||||
the FPI in the DOCTYPE declaration, with the xmlns attribute
|
||||
on the document element to identify the default namespace:
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"
|
||||
"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd" >
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
...
|
||||
</html>
|
||||
-->
|
||||
|
||||
<!-- Reserved for future use with document profiles -->
|
||||
<!ENTITY % XHTML.profile "" >
|
||||
|
||||
<!-- Intrinsic Events Module ................................................... -->
|
||||
<!ENTITY % xhtml-events.module "INCLUDE" >
|
||||
|
||||
<!-- Inline Style Module ....................................................... -->
|
||||
<!ENTITY % xhtml-inlstyle.mod
|
||||
PUBLIC "-//W3C//ELEMENTS XHTML Inline Style 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlstyle-1.mod" >
|
||||
%xhtml-inlstyle.mod;
|
||||
|
||||
<!-- Document Model ............................................................. -->
|
||||
<!ENTITY % xhtml-model.mod
|
||||
PUBLIC "-//OMA//ENTITIES XHTML Mobile 1.2 Document Model 1.0//EN"
|
||||
"xhtml-mobile12-model-1.mod" >
|
||||
|
||||
<!-- XHTML Framework ............................................................ -->
|
||||
<!ENTITY % XHTML.bidi "IGNORE" >
|
||||
<!ENTITY % xhtml-framework.mod
|
||||
PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-framework-1.mod" >
|
||||
%xhtml-framework.mod;
|
||||
|
||||
<!-- XHTML Core Modules ......................................................... -->
|
||||
<!ENTITY % pre.content
|
||||
"( #PCDATA
|
||||
| %InlStruct.class;
|
||||
%InlPhras.class;
|
||||
%Anchor.class;
|
||||
%Inline.extra; )*"
|
||||
>
|
||||
|
||||
<!ENTITY % xhtml-text.mod
|
||||
PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-text-1.mod" >
|
||||
%xhtml-text.mod;
|
||||
|
||||
<!ENTITY % xhtml-hypertext.mod
|
||||
PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-hypertext-1.mod" >
|
||||
%xhtml-hypertext.mod;
|
||||
|
||||
<!ENTITY % xhtml-list.mod
|
||||
PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-list-1.mod" >
|
||||
%xhtml-list.mod;
|
||||
<!-- Extend lists with value and start attributes -->
|
||||
<!ATTLIST %li.qname;
|
||||
value %Number.datatype; #IMPLIED
|
||||
>
|
||||
<!ATTLIST %ol.qname;
|
||||
start %Number.datatype; #IMPLIED
|
||||
>
|
||||
|
||||
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
||||
|
||||
<!-- Image Module ............................................... -->
|
||||
<!ENTITY % xhtml-image.mod
|
||||
PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-image-1.mod" >
|
||||
%xhtml-image.mod;
|
||||
|
||||
<!-- Tables Module ............................................... -->
|
||||
<!ENTITY % xhtml-table.mod
|
||||
PUBLIC "-//W3C//ELEMENTS XHTML Basic Tables 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-basic-table-1.mod" >
|
||||
%xhtml-table.mod;
|
||||
|
||||
<!-- Forms Module ...............................................
|
||||
XHTML Form with an inputmode extension from XForm 1.0
|
||||
-->
|
||||
|
||||
<!ENTITY % xhtml-form.mod
|
||||
PUBLIC "-//OMA//ELEMENTS XHTML MP 1.2 Forms 1.0//EN"
|
||||
"http://www.openmobilealliance.org/tech/DTD/xhtmlmp12-form-1.mod" >
|
||||
%xhtml-form.mod;
|
||||
|
||||
<!-- Link Element Module ........................................ -->
|
||||
<!ENTITY % xhtml-link.mod
|
||||
PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-link-1.mod" >
|
||||
%xhtml-link.mod;
|
||||
|
||||
<!-- Document Metainformation Module ............................ -->
|
||||
<!ENTITY % xhtml-meta.mod
|
||||
PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-meta-1.mod" >
|
||||
%xhtml-meta.mod;
|
||||
|
||||
<!-- Base Element Module ........................................ -->
|
||||
<!ENTITY % xhtml-base.mod
|
||||
PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-base-1.mod" >
|
||||
%xhtml-base.mod;
|
||||
|
||||
<!-- Scripting Module ........................................... -->
|
||||
<!ENTITY % xhtml-script.mod
|
||||
PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-script-1.mod" >
|
||||
%xhtml-script.mod;
|
||||
|
||||
<!-- Style Sheets Module ......................................... -->
|
||||
<!ENTITY % xhtml-style.mod
|
||||
PUBLIC "-//W3C//ELEMENTS XHTML Style Sheets 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-style-1.mod" >
|
||||
%xhtml-style.mod;
|
||||
|
||||
<!-- Param Element Module ....................................... -->
|
||||
<!ENTITY % xhtml-param.mod
|
||||
PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-param-1.mod" >
|
||||
%xhtml-param.mod;
|
||||
|
||||
<!-- Embedded Object Module ..................................... -->
|
||||
<!ENTITY % xhtml-object.mod
|
||||
PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-object-1.mod" >
|
||||
%xhtml-object.mod;
|
||||
|
||||
<!-- Document Structure Module ..................................... -->
|
||||
<!ENTITY % xhtml-struct.mod
|
||||
PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-struct-1.mod" >
|
||||
%xhtml-struct.mod;
|
||||
|
||||
<!-- Block Presentation ........................................ -->
|
||||
<!ENTITY % xhtml-blkpres.mod PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-blkpres-1.mod" >
|
||||
%xhtml-blkpres.mod;
|
||||
|
||||
<!-- ========================================== -->
|
||||
<!--
|
||||
XHTMLMP 1.2 Inline Presentation: all of XHTML Mod Presentation module
|
||||
(b, big, hr, i, small, sub, sup, tt) not just the subset (b, big, hr, i,
|
||||
small) as in XHTMLMP 1.1
|
||||
-->
|
||||
<!ENTITY % xhtml-inlpres.mod PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN"
|
||||
"http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlpres-1.mod">
|
||||
%xhtml-inlpres.mod;
|
||||
|
||||
<!-- end of XHTML Mobile 1.2 DTD ........................................... -->
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue