Brett's Blog
Edit     New

Tuesday, September 25, 2007

XQuery

Wow, is XQuery cool... I'm looking now at making sites I run to be more accessibility friendly and I wanted to extract all of the official checkpoints so that I could reorganize them in a way which I feel would be more useful to developers (more by type, e.g., having all relevant concerns grouped under "language", "images", "forms", "tables", etc.). While regular expressions might have done the trick (another technology which should be taught to high school students, along with XQuery, imho), I liked the greater predictability of working with XQuery.

With my XqUSEme Firefox extension, I was able to XQuery the current window in Firefox (i.e., the accessibility page) and perform the following pretty straightforward query (if you know XPath) to get the results:

<html><body> {
for $dt in doc('XQuseMeContainer.dbxml/mytest.xml')//dt[@class='checkpoint']
let $url := 'http://www.w3.org/TR/WAI-WEBCONTENT/'
return <p><a href="{$url}#{$dt/span[@class='checkpoint']/a/@name}">{$dt/span[@class='checkpoint']/a/string()}</a> {$dt/text()}

} </body></html>


which returned results such as this:

5.5 Provide summaries for tables.

5.6 Provide abbreviations for header labels.

6.1 Organize documents so they may be read without style sheets. For example, when an HTML document is rendered without associated style sheets, it must still be possible to read the document.



Pretty neat...

addendum: Well, I see the above XQuery is a little too simplistic. While the text() node test does avoid the link I didn't want to copy, it also manages to fail to grab the inner text of some other elements such as <em> which I did want to grab. I suppose I should just use string() and use regexp to remove the preceding numbers or investigate whether XPath 2.0 can deal better with text nodes and then apply that... Anyways, it's all still cool...

addendum2: Looks like I should have researched more carefully. There already is an official page with the items organized by element type: http://www.w3.org/TR/WCAG10-HTML-TECHS/

Incredible Media Vacuum

Hello all,

Just wanted to point out what I feel is an absolutely stunning silence on the part of the media and academics regarding the plight of the Baha'is in Iran (well, given the Rwanda coverage during the genocide, it shouldn't be so stunning, but still...). You'd think that the focus on Iran might draw to light some of the reprehensible yet oh-so-skillfully-duplicitous dealings of the government of Iran with the law-abiding Baha'is there.

I noticed that in the recent Columbia address, the president of the university did raise the issue of the treatment of Baha'is (just one time, but toward the beginning as he referred to him as exhibiting "all the signs of a petty and cruel dictator"), yet this systematic campaign of repression (I'm not exaggerating here--there was an actual blueprint of plans (see also this background) for repression leaked to the U.N., not to mention the constant and tragic evidence), doesn't even get a blip of coverage. While it may not be constant killings (the killings of Baha'is in the early 1980's weren't very good for international relations), you'd think that secret orders by the military to monitor all Baha'is, the largest religious minority in the country, might get a little more press or a leaked memo to expel any Baha'is from universities. This is not to speak of the other abuses such as denial of pensions, the confiscation of properties, the destruction of holy sites and Baha'i cemeteries, arbitrary detentions, propagandized media hatred, intimidation of children, denial of jobs, and other calculated measures to weaken the community there. When the issue is raised, Iran will post some lies or do some double-talk, and it seems to quell interest in the subject.

Some might assume this is some political rivalry between obscure factions and dismiss it as such, but look at the recent letter of the international governing body of the Baha'i Faith to Iranian students there. They write "With an illumined conscience, with a world-embracing vision, with no partisan political agenda, and with due regard for law and order, strive for the regeneration of your country. By your deeds and services, attract the hearts of those around you, even win the esteem of your avowed enemies". Baha'is also live in countries around the world and is, according to the Encyclopedia Brittanica, the most widespread religion in the world after Christianity in terms of geographic distribution. Hardly an obscure and narrow sect either--though even if it were, the outrages against the community deserve, I would say, quite a bit more attention than they are presently getting.

Milk

Strange observation...

I can consistently give myself nightmares by drinking milk or eating ice cream at night.

Since paying attention to this phenomenon, I've also discovered that I have slightly more paranoid tendencies when I drink milk. No, I don't mean hearing voices, believing helicopters are going to get me, or anything like that... But I do notice I am more prone to suspiciousness, etc.

This is really interesting to me. While I must admit, this could have some idiosyncratic connection, this really has me wondering about paranoia in cultures, etc. I swear, after waking up, I felt like I'd be able to write horror films (though God forbid I'd ever want to).

Food for thought... (especially since milk is, as they say, a food)

In searching the net to see if there were any known medical connection between the two, I came across this article (which doesn't refer to my supposed connection) which I thought was interesting: http://www.vegsource.com/attwood/milk.htm. I then went to the Wikipedia article on milk and was disappointed to find something which read, in parts, like a milk brochure from some dairy farmer's association--which then made me think of Wikiscanner, the fascinating project to identify the source of Wikipedia edits -- see also http://www.maltastar.com/pages/msFullArt.asp?an=14323 and for ongoing examples, see http://wired.reddit.com/wikidgame/ ) and I wondered whether the dairy industry was editing the milk page. Then again, maybe this is a paranoid delusion brought on by the milk.


Google
 
Brett's Blog Web