value-excerption-value-title-test: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(→‎Successful Tests: Added real MediaWiki successful test result.)
(Tweaked language. I think this is ready to go.)
Line 1: Line 1:
<entry-title>Value Excerption Pattern: Parsing from empty elements test</entry-title>
<entry-title>Value Excerption Pattern: Parsing from empty elements test</entry-title>
''Please carefully note, this page is about a pre-draft, experimental and unfinished microformats proposal. You '''cannot''' use this pattern on your live pages, it is '''not supported''' by any stable parser and you should not assume that this pattern will be finalized as-is! We're just asking for help in testing this important experiment thoroughly. '''Thank you'''.''
''Please carefully note, this page is about a pre-draft, experimental and unfinished microformats proposal. You '''cannot''' use this pattern on your live pages, it is '''not supported''' by any stable parser and you should not assume that this pattern will be finalized as-is! We're just asking for help in testing this thoroughly. '''Thank you'''.''
__TOC__
__TOC__
This is a special page to introduce and gather results to widespread testing of a '''proposed''' extension to the value-excerption pattern. It looks like this:
This is a special page to introduce and gather results to widespread testing of a '''proposed''' extension to the value-excerption pattern. The variant we're testing looks a little something like this:


<source lang=html4strict>
<source lang=html4strict>
Line 13: Line 13:
It allows you to include [[machine-data|machine-form data]] alongside the human form, without polluting visible formatted content with undesired machine form data.
It allows you to include [[machine-data|machine-form data]] alongside the human form, without polluting visible formatted content with undesired machine form data.


This pattern is based on rendering behavior in browsers whereby an empty element, that is one containing no children (neither text-nodes or other elements), remains in the DOM tree (for parsing) but is not rendered visibly to a page. This allows an element to be included in the document with <code>title</code> content (as in the example), but ''without'' a tooltip being exposed to users, or data read out by screen readers.
This covers cases where a microformat uses a fixed format of data that is either inappropriate for visible inclusion in a page (such as a full date-time and timezone string), or where an American-English keyword is needed — such as <code>cell</code> instead of ‘mobile’ in a British English page, or any number of non-English translations.


Since this pattern attempts to resolve some long standing issues with including machine-data in microformats, it's imperative this is tested completely before adding it to a spec. Following are a number of examples. Please try them out. Push them into publishing systems, editor apps and tools, and check that it comes out the way you expect on the other side; render it in desktop browsers, mobile browers, screen readers, in braille… anything you can test, we want to know about it. We need to see any quirks, oddities and so on.
This pattern is based on rendering behavior in browsers whereby an empty element — that is one containing no  text-nodes or other child elements — remains in the DOM tree (for parsing) but is not rendered visibly to a page. This allows an element to be included in the document with a <code>title</code> attribute (as in the example), but ''without'' a tooltip being exposed to users, and without the data being read out by screen readers.


Also, by all means provide thoughts on the publishing flow for this. An empty element is an uncommon structure outside of forms and scripts, but the reasoning is as follows: ''‘machine data’ is not metadata, it is still content. It's structurally appropriate to have it as a sibling to the human-formatted text.''
Since this pattern attempts to resolve some long standing issues with including machine-data in microformats, it's imperative we test thoroughly before adding it to any pattern specification. Following are a number of example tests. ''Please try them out''. Push them into your publishing systems, editor apps and tools, and check that it comes out looking the same on the other side: Render it in desktop browsers, mobile browers, screen readers, in braille… ''anything you can test, we want to know about''! We need to see any quirks, oddities and so on.


'''Note that valid HTML is a cornerstone of microformats'''. Inventing new attributes, using non-standard DOCTYPEs or XML extensions is not an applicable option. We're trying to achieve something  
Also, by all means provide thoughts on the publishing flow for this. An empty element is an uncommon structure outside of forms and scripts, but the reasoning is as follows: ''So-called ‘machine data’ is not metadata, it is content. It's structurally appropriate to have it as a sibling to the human-formatted text.''
''as gracefully as we can'' within the limits of HTML4, without harming user experience.
 
'''Note that valid HTML is a cornerstone of microformats'''. ''Inventing new attributes, using non-standard DOCTYPEs or XML extensions is not an applicable option''. We're trying to achieve something as gracefully as we can within the limitations of HTML4, and without harming user experience.


==The proposed parsing rules==
==The proposed parsing rules==
Line 26: Line 27:
The current, likely incomplete, proposed parsing rules and restrictions for this pattern are as follows:
The current, likely incomplete, proposed parsing rules and restrictions for this pattern are as follows:


* Only one value-title-element may be included as a child of a property. No splitting or concatenation, no combining with other value-excerption elements.
* Only one <code>value-title</code> element may be included as a child of a property. No splitting or concatenation, no combining with other value-excerption elements.
* An empty value-title-element '''must''' be the ''first''-child of the property (not including any preceding whitespace)
* An empty <code>value-title</code> element '''must''' be the ''first''-child of the property (not including any preceding whitespace)
* The machine-data value ''must'' represent the same data as the visible inner text; nor should the parent property contain arbitrary data. Parsers and validator tools will be encouraged to test this where appropriate (for example, some languages have access to powerful date parsing algorithms).
* The machine-data value ''must'' represent the same data as the visible text; the parent property ''must not'' contain arbitrary data. Validator tools will be encouraged to verify this where possible (for example, some programming languages have access to powerful date parsing algorithms that can compare human dates to the ISO form).
* The empty element can be ''any element'', but a generic <code>span</code> is most appropriate. You could use <code>b</code> if you wanted to save bytes, or an <code>input type=hidden</code> if it makes sense to you. That choice will not matter to parsers. You are in control of that publishing decision. As per usual µf documentation, <code>span</code> will be used for generic examples.
* The empty element can be ''any element'', but a generic <code>span</code> is most appropriate. You could use <code>b</code> if you want to save bytes, or an <code>input type=hidden</code> if it makes sense to you. That choice will not matter to parsers. You are in complete control of that publishing decision. As per usual µf documentation, <code>span</code> will be used for generic examples.
* The <code>value-title</code> property does not have to be empty. If you ''do'' want a tool-tip to expose a useful data-form, you can. e.g. <code>&lt;span class='value-title' title='2008'>last year&lt;/span></code> is valid too.


==Example Tests==
==Example Tests==


The following snippets are example tests for the new pattern. You can use them as is, if you like, or use them as a base for your own tests with your own content. If you write your own tests, please document them under ‘additional test cases’ so that any failing tests can be checked for validity.
The following snippets are example tests for the new pattern. You can use them as is, or use them as a base for your own tests with your own content. If you write your own tests, please document them under ‘additional test cases’ so that any failing tests can be checked for validity.


===hAtom#1: An hAtom <code>published</code>/<code>updated</code> Field===
===hAtom#1: An hAtom <code>published</code>/<code>updated</code> Property===


<source lang=html4strict>
<source lang=html4strict>
Line 63: Line 65:
</html>
</html>
</source>
</source>
* [[value-excerption-pattern-issues/empty-value-element-test/hAtom-1|View the hAtom test]]


===hCal#1: An hCalendar <code>dtstart</code>===
===hCal#1: An hCalendar <code>dtstart</code>===
Line 95: Line 95:
</html>
</html>
</source>
</source>
* [[value-excerption-pattern-issues/empty-value-element-test/hCal-1|View the hCalendar test]]


===hCard#1: An hCard <abbr title="birthday"><code>bday</code></abbr>===
===hCard#1: An hCard <abbr title="birthday"><code>bday</code></abbr>===
Line 125: Line 123:
</html>
</html>
</source>
</source>
* [[value-excerption-pattern-issues/empty-value-element-test/hCard-1|View the hCard test]]


===hAudio#1: An hAudio <code>duration</code>===
===hAudio#1: An hAudio <code>duration</code>===
Line 156: Line 152:
</html>
</html>
</source>
</source>
* [[value-excerption-pattern-issues/empty-value-element-test/hAudio-1|View the hAudio test]]


''If you believe there is an error in any of these tests, or in any others that people contribute, please post on the {{MicroformatsMailingList}}.''
''If you believe there is an error in any of these tests, or in any others that people contribute, please post on the {{MicroformatsMailingList}}.''
Line 163: Line 157:
==Evil Tests==
==Evil Tests==


If you want to give microformat parsers a good run for their money, construct ‘evil’ tests using nesting, combination and interpolation of different microformats.
If you want to give existing microformat parsers a good run out, construct ‘evil’ tests using nesting, combination and interpolation of different microformats.


===hAtom + hCalendar===
===hAtom + hCalendar===
Line 200: Line 194:
</html>
</html>
</source>
</source>
===hAudio + hCard===


==Response==
==Response==


* Don't like the empty element? Don't like the use of the title attribute? '''Please file general issues concerning the proposed pattern on the main [[http://microformats.org/wiki/value-excerption-pattern-brainstorming#enabling_more_use_of_title_attributes|value excerption brainstorming page]]''', or discuss them on the {{MicroformatsMailingList}}.
* Don't like the empty element? Don't like the use of the title attribute? '''Please file general issues concerning the proposed pattern on the main [[http://microformats.org/wiki/value-excerption-pattern-brainstorming#enabling_more_use_of_title_attributes|value excerption brainstorming page]]''', or discuss them on the {{MicroformatsMailingList}}.
* Add the results of and responses to these tests themselves on this page.
* Add results of tests and responses to these tests themselves on ''this page''.


Misplaced responses will be moved, and having to do so will make [[User:BenWard|Ben]] growly, so, y'know, please be helpful.
Misplaced responses will be moved, and having to do so will make [[User:BenWard|Ben]] growly, so, y'know, please try to keep the wiki tidy.


===Successful Tests===
===Successful Tests===


List successfully tested environments here. Add new environments as new list items, and expand existing list items with your name and platform variants to indicate verified successes.
List successfully tested environments here. Add new environments as new list items, and expand existing list items with your name and platform variants to indicate verified successes.


{|
{|
|+ Results of tests across various publishing/rendering environments
|+ Results of tests across various publishing/rendering environments
|-
|-
! Environment
! Product/Environment
! Type
! <abbr title="Publishing or Consuming?">P/C?</abbr>
! Platforms
! Platforms
! Verified By
! Test By
! Notes
! Notes
|-
|-
| MediaWiki
| MediaWiki/Linux
| Publishing
| Publishing
| Microformats.org
| Safari 3.2.1 (Mac OSX 10.5)
| [[User:BenWard]]
| [[User:BenWard]]
| Empty elements are maintained in MW output. Note that <code>a</code> elements in the tests get escaped.
| The empty <code>span</code> elements are maintained in <abbr title="MediaWiki">MW</abbr> output. Note that <code>a</code> elements in the tests get escaped by this MediaWiki install.
|-
|-
|}
|}
Line 233: Line 225:
===Failed Tests===
===Failed Tests===


For failures, please provide as much information as you can. The precise impact of the error, whether the behavior could be regarded as a bug in the software you're testing, whether it works in future versions, whether you changed any settings in the software to produce the result, and if so, whether enabling/disabling that setting would be regarded a showstopper if this pattern were certified.  
For failures, please provide as much information as you can. The precise impact of the error, whether the behavior could be regarded as a bug in the software you're testing, whether it works in subsequent releases, whether you changed any settings in the software to produce the result, and if so, whether enabling/disabling that setting should be regarded a showstopper if this pattern were certified.  


Since we want more detail, please expand failures into headed sections rather than cramming into a table.
Since we want more detail, please expand failures into headed sections rather than cramming into a table.
Line 242: Line 234:
; Platform
; Platform
: Windows Vista
: Windows Vista
; Verified By
; Test By
: [[User:BenWard]]
: [[User:BenWard]]
; Description
; Description
: When trying to enter an empty span in my editor, which I wrote myself whilst I was high, the application immediately crashes, performs <code>rm -rf /</code> on all UNIX boxes connected to my local network (which appears to cause Android phones within Bluetooth range to do the same…), and then causes all attached peripherals to combust. I was not able to reproduce, as my house was now on fire. I think using a self closing XHTML tag instead might work-around the problem because as we know, it's been proved by Real Scienticians that XML is always better than HTML. Alternatively, it may be a bug in the beta software.
: When trying to enter an empty span in my <abbr title="Hypertext Markup Language">HTML</abbr> editor, which I wrote myself whilst I was high, the application immediately crashes, performs <code>rm -rf /</code> on all UNIX boxes connected to my local network (which also appears to cause Android phones within Bluetooth range to do the same…), and then causes all attached peripherals to combust. I was not able to reproduce, as my house was now on fire. I think using a self closing XHTML tag instead might work-around the problem because as we know, it's been proved by Real Scienticians that XML is always better than HTML. Alternatively, it may be a bug in the beta software.
; Notes
; Notes
: This is a beta release, and a bug has been filed.
: This is a beta release, and a bug has been filed.
Line 256: Line 248:
<div class='discussion'>
<div class='discussion'>
* Any general feedback you have on this test is most welcome. However, if you have issues with the pattern or alternate suggestions, please file them on the main [[value-excerption-pattern-issues]] page. Also, please remember to sign your comments with <nowiki>—~~~~</nowiki> —[[User:BenWard|BenWard]] 00:12, 9 January 2009 (UTC)
* Any general feedback you have on this test is most welcome. However, if you have issues with the pattern or alternate suggestions, please file them on the main [[value-excerption-pattern-issues]] page. Also, please remember to sign your comments with <nowiki>—~~~~</nowiki> —[[User:BenWard|BenWard]] 00:12, 9 January 2009 (UTC)
* … <!-- New topic as a top-level list item  -->
** … <!-- Responses as nested list item for threading -->
</div>
</div>



Revision as of 22:24, 19 January 2009

<entry-title>Value Excerption Pattern: Parsing from empty elements test</entry-title> Please carefully note, this page is about a pre-draft, experimental and unfinished microformats proposal. You cannot use this pattern on your live pages, it is not supported by any stable parser and you should not assume that this pattern will be finalized as-is! We're just asking for help in testing this thoroughly. Thank you.

This is a special page to introduce and gather results to widespread testing of a proposed extension to the value-excerption pattern. The variant we're testing looks a little something like this:

<p class='dtstart'>
    <span class='value-title' title='2009-01-06T22:54:00-0800'></span>
    January 6th, in the evening
</p>

It allows you to include machine-form data alongside the human form, without polluting visible formatted content with undesired machine form data.

This covers cases where a microformat uses a fixed format of data that is either inappropriate for visible inclusion in a page (such as a full date-time and timezone string), or where an American-English keyword is needed — such as cell instead of ‘mobile’ in a British English page, or any number of non-English translations.

This pattern is based on rendering behavior in browsers whereby an empty element — that is one containing no text-nodes or other child elements — remains in the DOM tree (for parsing) but is not rendered visibly to a page. This allows an element to be included in the document with a title attribute (as in the example), but without a tooltip being exposed to users, and without the data being read out by screen readers.

Since this pattern attempts to resolve some long standing issues with including machine-data in microformats, it's imperative we test thoroughly before adding it to any pattern specification. Following are a number of example tests. Please try them out. Push them into your publishing systems, editor apps and tools, and check that it comes out looking the same on the other side: Render it in desktop browsers, mobile browers, screen readers, in braille… anything you can test, we want to know about! We need to see any quirks, oddities and so on.

Also, by all means provide thoughts on the publishing flow for this. An empty element is an uncommon structure outside of forms and scripts, but the reasoning is as follows: So-called ‘machine data’ is not metadata, it is content. It's structurally appropriate to have it as a sibling to the human-formatted text.

Note that valid HTML is a cornerstone of microformats. Inventing new attributes, using non-standard DOCTYPEs or XML extensions is not an applicable option. We're trying to achieve something as gracefully as we can within the limitations of HTML4, and without harming user experience.

The proposed parsing rules

The current, likely incomplete, proposed parsing rules and restrictions for this pattern are as follows:

  • Only one value-title element may be included as a child of a property. No splitting or concatenation, no combining with other value-excerption elements.
  • An empty value-title element must be the first-child of the property (not including any preceding whitespace)
  • The machine-data value must represent the same data as the visible text; the parent property must not contain arbitrary data. Validator tools will be encouraged to verify this where possible (for example, some programming languages have access to powerful date parsing algorithms that can compare human dates to the ISO form).
  • The empty element can be any element, but a generic span is most appropriate. You could use b if you want to save bytes, or an input type=hidden if it makes sense to you. That choice will not matter to parsers. You are in complete control of that publishing decision. As per usual µf documentation, span will be used for generic examples.
  • The value-title property does not have to be empty. If you do want a tool-tip to expose a useful data-form, you can. e.g. <span class='value-title' title='2008'>last year</span> is valid too.

Example Tests

The following snippets are example tests for the new pattern. You can use them as is, or use them as a base for your own tests with your own content. If you write your own tests, please document them under ‘additional test cases’ so that any failing tests can be checked for validity.

hAtom#1: An hAtom published/updated Property

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
    <head>
        <title>Value Excerption Pattern Test hAtom#1</title>
    </head>
    <body>
        <div class="hentry">
            <h1 class="entry-title">An introduction to Microformats</h1>
            <p>
                Published on <span class="published updated">
                <span class="value-title" title="2009-01-09T11:33:00-0800"></span>
                January 9th, around lunchtime</span>
                by <span class="author vcard">
                  <a class="url fn" href="http://example.com">
                      Joe Blogger</a></span>.
            </p>
            <p class="entry-content">Wow, microformats are really useful! You can
                learn loads about them on the 
                <a href="http://microformats.org/wiki">microformats wiki</a>.
            </p>
        </div>
    </body>
</html>

hCal#1: An hCalendar dtstart

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
    <head>
        <title>Value Excerption Pattern Test hCal#1</title>
    </head>
    <body>
        <div class="vevent">
            <h1 class="summary">Value Exception Test Day!</h1>
            <p class="description">Come help <span class="organizer vcard">
                <a class="fn url org" href="http://microformats.org">microformats.org</a>
                </span> test a new value-excerption pattern for sanity and 
                robustness!
            </p>
            <p>Help out by running some tests at 
              <span class="dtstart">
                <span class="value-title" title="2009-01-12T12:00:00-0800"></span>
                midday on Monday January 12th</span>.
            </p>
            <p>See <a href="url" href="http://microformats.org/wiki/value-excerption-pattern-issues/empty-value-element-test">the
                wiki</a> for more details!
            </p>
        </div>
    </body>
</html>

hCard#1: An hCard bday

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
    <head>
        <title>Value Excerption Pattern Test hCard#1</title>
    </head>
    <body>
        <!-- Behind Test -->
        <div class="vcard">
            <h1 class="fn">Ben Ward</h1>
            <p>Ben Ward's birthday is 
                <span class="bday">
                    <span class="value-title" title="1984-02-09"></span>
                    February 9th
                </span>.
                You should throw him a party! Or call his <span class="tel">
                <span class="type"><span class="value-title" title="cell"></span>mobile</span>
                on <span class="value">415.123.123</span></span> to wish him well!
            </p>
        </div>
        <!-- End Test -->
    </body>
</html>

hAudio#1: An hAudio duration

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
    <head>
        <title>Value Excerption Pattern Test hAudio#1</title>
    </head>
    <body>
        <h1>Song of the year?</h1>
        <!-- Behind Test -->
        <p class="haudio">Did you hear ‘<span class="fn">Heavy Water</span>’ on
            <span class="contributor">Foals</span><span class="album">Antidodes</span>’ record 
            <span class="published">
                <span class="value-title" title="2008"></span>
                last year
            </span>? It's
            <span class="duration">
                <span class="value-title" title="PT04M32S"></span>
                4 and a half minutes long
            </span>, you should make time to hear it!</p>
        </div>
        <!-- End Test -->
    </body>
</html>

If you believe there is an error in any of these tests, or in any others that people contribute, please post on the mailing list.

Evil Tests

If you want to give existing microformat parsers a good run out, construct ‘evil’ tests using nesting, combination and interpolation of different microformats.

hAtom + hCalendar

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
    <head>
        <title>Value Excerption Pattern Test hAtomhCalEvil#1</title>
    </head>
    <body>
        <div class="hentry vevent">
            <h1 class="entry-title summary">An introduction to Microformats</h1>
            <p>
                Published on <span class="published updated">
                <span class="value-title" title="2009-01-09T11:33:00-0800"></span>
                January 11th, late afternoon</span>
                by <span class="author organizer vcard">
                  <a class="url fn" href="http://example.com">
                      Joe Blogger</a></span>.
            </p>
            <p class="entry-content description">
                <span class="dtstart">
                    <span class="value-title" title="2009-01-14T19:00:00"></span>
                    this coming Wednesday at 7
                </span> is not the date of a completely fictional microformats
                event. If it existed, it would promise to be informative and get
                you up to speed on microformats.org for 2009! Now you've 
                learned to work with microformats a little, why not attend and
                get involved! Why not? Because this event is a test case, not 
                for real.
            </p>
        </div>
    </body>
</html>

Response

  • Don't like the empty element? Don't like the use of the title attribute? Please file general issues concerning the proposed pattern on the main [excerption brainstorming page], or discuss them on the mailing list.
  • Add results of tests and responses to these tests themselves on this page.

Misplaced responses will be moved, and having to do so will make Ben growly, so, y'know, please try to keep the wiki tidy.

Successful Tests

List successfully tested environments here. Add new environments as new list items, and expand existing list items with your name and platform variants to indicate verified successes.

Results of tests across various publishing/rendering environments
Product/Environment P/C? Platforms Test By Notes
MediaWiki/Linux Publishing Safari 3.2.1 (Mac OSX 10.5) User:BenWard The empty span elements are maintained in MW output. Note that a elements in the tests get escaped by this MediaWiki install.

Failed Tests

For failures, please provide as much information as you can. The precise impact of the error, whether the behavior could be regarded as a bug in the software you're testing, whether it works in subsequent releases, whether you changed any settings in the software to produce the result, and if so, whether enabling/disabling that setting should be regarded a showstopper if this pattern were certified.

Since we want more detail, please expand failures into headed sections rather than cramming into a table.

For example, take this entirely plausible scenario as a template:

Example: Fake Publisher 3.1ß

Platform
Windows Vista
Test By
User:BenWard
Description
When trying to enter an empty span in my HTML editor, which I wrote myself whilst I was high, the application immediately crashes, performs rm -rf / on all UNIX boxes connected to my local network (which also appears to cause Android phones within Bluetooth range to do the same…), and then causes all attached peripherals to combust. I was not able to reproduce, as my house was now on fire. I think using a self closing XHTML tag instead might work-around the problem because as we know, it's been proved by Real Scienticians that XML is always better than HTML. Alternatively, it may be a bug in the beta software.
Notes
This is a beta release, and a bug has been filed.
This product has a known history of flammability bugs.
The user must explicitly enable the ‘Endanger My Life’ checkbox under the ‘Advanced Mislabelled Checkboxes’ tab of the ‘Complicated Preferences’ preferences pane.
You get the idea.

General Test Feedback

  • Any general feedback you have on this test is most welcome. However, if you have issues with the pattern or alternate suggestions, please file them on the main value-excerption-pattern-issues page. Also, please remember to sign your comments with —~~~~ —BenWard 00:12, 9 January 2009 (UTC)

Related Pages