MENU
last data update: 2011/10/14, 23:39
Website loading time
during the test: 0.23 s
cable connection (average): 0.37 s
DSL connection (average): 0.5 s
modem (average): 7.7 s
HTTP headers
HTTP/1.1 200 OK
Date: Sat, 15 Oct 2011 06:39:16 GMT
Server: Apache
Last-Modified: Tue, 06 Apr 2010 11:45:29 GMT
ETag: "95f40-d147-4838ffb72a840"
Accept-Ranges: bytes
Content-Length: 53575
Content-Style-Type: text/css
Connection: close
Content-Type: text/html; charset=utf-8
Information about DNS servers
cafeconleche.org | MX | 5 | IN | 10800 | |
cafeconleche.org | A | 152.19.134.41 | IN | 10800 | |
cafeconleche.org | SOA | ns0.easydns.com | admin.easydns.com | 1300355547 | 10800 3600 1209600 10800 IN 10800 |
cafeconleche.org | NS | remote1.easydns.com | IN | 10800 | |
cafeconleche.org | NS | remote2.easydns.com | IN | 10800 | |
cafeconleche.org | NS | ns1.easydns.com | IN | 10800 | |
cafeconleche.org | NS | ns2.easydns.com | IN | 10800 |
Received from the first DNS server
Request to the server "cafeconleche.org"
You used the following DNS server:
DNS Name: remote1.easydns.com
DNS Server Address: 64.68.192.10#53
DNS server aliases:
HEADER opcode: REQUEST, status: NOERROR, id: 41748
flag: qr aa rd REQUEST: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 4
REQUEST SECTION:
cafeconleche.org. IN ANY
ANSWER SECTION:
cafeconleche.org. 10800 IN SOA ns0.easydns.com. admin.easydns.com. 1300355547 10800 3600 1209600 10800
cafeconleche.org. 10800 IN A 152.19.134.41
cafeconleche.org. 10800 IN MX 5 .
cafeconleche.org. 10800 IN NS remote1.easydns.com.
cafeconleche.org. 10800 IN NS ns1.easydns.com.
cafeconleche.org. 10800 IN NS ns2.easydns.com.
cafeconleche.org. 10800 IN NS remote2.easydns.com.
SECTION NOTES:
ns1.easydns.com. 300 IN A 64.68.192.10
ns2.easydns.com. 300 IN A 72.52.2.1
remote1.easydns.com. 300 IN A 64.68.192.10
remote2.easydns.com. 300 IN A 72.52.2.1
Received 266 bytes from address 64.68.192.10#53 in 14 ms
Received from the second DNS server
Request to the server "cafeconleche.org"
You used the following DNS server:
DNS Name: remote2.easydns.com
DNS Server Address: 72.52.2.1#53
DNS server aliases:
HEADER opcode: REQUEST, status: NOERROR, id: 57728
flag: qr aa rd REQUEST: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 4
REQUEST SECTION:
cafeconleche.org. IN ANY
ANSWER SECTION:
cafeconleche.org. 10800 IN SOA ns0.easydns.com. admin.easydns.com. 1300355547 10800 3600 1209600 10800
cafeconleche.org. 10800 IN A 152.19.134.41
cafeconleche.org. 10800 IN MX 5 .
cafeconleche.org. 10800 IN NS ns2.easydns.com.
cafeconleche.org. 10800 IN NS remote1.easydns.com.
cafeconleche.org. 10800 IN NS ns1.easydns.com.
cafeconleche.org. 10800 IN NS remote2.easydns.com.
SECTION NOTES:
ns1.easydns.com. 300 IN A 64.68.192.10
ns2.easydns.com. 300 IN A 72.52.2.1
remote1.easydns.com. 300 IN A 64.68.192.10
remote2.easydns.com. 300 IN A 72.52.2.1
Received 266 bytes from address 72.52.2.1#53 in 67 ms
Subdomains (the first 50)
Typos (misspells)
xafeconleche.org vafeconleche.org fafeconleche.org dafeconleche.org czfeconleche.org csfeconleche.org cwfeconleche.org cqfeconleche.org cadeconleche.org caceconleche.org caveconleche.org cageconleche.org cateconleche.org careconleche.org cafwconleche.org cafsconleche.org cafdconleche.org cafrconleche.org caf4conleche.org caf3conleche.org cafexonleche.org cafevonleche.org cafefonleche.org cafedonleche.org cafecinleche.org cafecknleche.org cafeclnleche.org cafecpnleche.org cafec0nleche.org cafec9nleche.org cafecobleche.org cafecomleche.org | cafecojleche.org cafecohleche.org cafeconkeche.org cafeconpeche.org cafeconoeche.org cafeconlwche.org cafeconlsche.org cafeconldche.org cafeconlrche.org cafeconl4che.org cafeconl3che.org cafeconlexhe.org cafeconlevhe.org cafeconlefhe.org cafeconledhe.org cafeconlecge.org cafeconlecbe.org cafeconlecne.org cafeconlecje.org cafeconlecue.org cafeconlecye.org cafeconlechw.org cafeconlechs.org cafeconlechd.org cafeconlechr.org cafeconlech4.org cafeconlech3.org afeconleche.org cfeconleche.org caeconleche.org cafconleche.org cafeonleche.org | cafecnleche.org cafecoleche.org cafeconeche.org cafeconlche.org cafeconlehe.org cafeconlece.org cafeconlech.org acfeconleche.org cfaeconleche.org caefconleche.org cafceonleche.org cafeocnleche.org cafecnoleche.org cafecolneche.org cafeconelche.org cafeconlcehe.org cafeconlehce.org cafeconleceh.org ccafeconleche.org caafeconleche.org caffeconleche.org cafeeconleche.org cafecconleche.org cafecoonleche.org cafeconnleche.org cafeconlleche.org cafeconleeche.org cafeconlecche.org cafeconlechhe.org cafeconlechee.org |
Location
IP: 152.19.134.41
continent: NA, country: United States (USA), city: Chapel Hill
Website value
rank in the traffic statistics:
There is not enough data to estimate website value.
Basic information
website build using CSS
code weight: 52.32 KB
text per all code ratio: 60 %
title: Cafe con Leche XML News and Resources
description: Cafe con Leche is the preeminent independent source of XML information on the net. Cafe con Leche is neither beholden to specific companies nor to advertisers. At Cafe con Leche you'll find many resources to help you develop your XML skills here including daily news summaries, examples, book reviews, mailing lists and more.
keywords: XML, Cafe con Leche, XML Bible, XML: Extensible Markup Language, XML in a Nutshell, Processing XML with Java, Effective XML
encoding: UTF-8
language: en-US
Website code analysis
one word phrases repeated minimum three times
two word phrases repeated minimum three times
three word phrases repeated minimum three times
B tags
U tags
I tags
Cafe con Leche XML News and Resources Quote of the Day I remember the early days of the web -- and the last days of CD ROM -- when there was this mainstream consensus that the web and PCs were too durned geeky and difficult and unpredictable for "my mom" (it's amazing how many tech people have an incredibly low opinion of their mothers). If I had a share of AOL for every time someone told me that the web would die because AOL was so easy and the web was full of garbage, I'd have a lot of AOL shares. And they wouldn't be worth much. --Cory Doctorow Read the rest in Why I won't buy an iPad (and think you shouldn't, either) Today's News I've released XOM 1.2.5, my free-as-in-speech (LGPL) dual streaming/tree-based API for processing XML with Java. 1.2.5 is a very minor release. The only visible change is that Builder.build((Reader) null) now throws a NullPointerException instead of a confusing MalformedURLException. I've also added support for Maven 2, and hope to get the packages uploaded to the central repository in a week or two. In other news, I have had very little time to work on this site lately. In order to have any time to work on other projects including XOM and Jaxen, I've had to let this site slide. I expect to have more news about that soon. Also, speaking of Jaxen, I noticed that the website has been a little out of date for a while now because I neglected to update the releases page when 1.1.2 was released in 2008. Consequently, a lot of folks have been missing out on the latest bug fixes and optimizations. If you're still using Jaxen 1.1.1 or earlier, please upgrade when you get a minute. Also, note that the official site is http://jaxen.codehaus.org/. jaxen.org is a domain name spammer. I'm not sure who let that one slide, but we'll have to see about grabbing it back one of these days. Permalink to Today's News | Recent News | Today's Java News on Cafe au Lait | The Cafes | Older News | E-mail Elliotte Rusty Harold Recommended Reading Selected content that might have some relevance or interest for this site's visitors: You can also see previous recommended reading or subscribe to the recommended reading RSS feed if you like. Recent News Friday, February 12, 2010 (Permalink) Yesterday I figured out how to process form input. Today I figured out how to parse strings into nodes in eXist. This is very eXist specific, but briefly: let $doc := "<html xmlns='http://www.w3.org/1999/xhtml'> <div> foo </div> </html>" let $list := util:catch('*', (util:parse($doc)), ($util:exception-message)) return $list I'll need this for posts and comments. There's also a parse-html function but it's based on the flaky NekoHTML instead of the m,orereliable TagSoup. Wednesday, February 10, 2010 (Permalink) I'm slowly continuing to work on the new backend. I've finally gotten indexing to work. It turns out that eXist's namespace hanlding for index configuration files is broken in 1.4.0, but that shouldn be fixed in the release. I've also manged to get the source built and most of the tests to run so I can contribute patches back. Next up I'm looking into the supoprt for the Atom Publishing Protocol. Wednesday, February 3, 2010 (Permalink) I spent a morning debugging a problem that I have now boiled down to this test case. The following query prints 3097: <html> { let $num := count(collection("/db/quotes")/quote) return $num } </html> and this query prints 0: <html xmlns="http://www.w3.org/1999/xhtml"> { let $num := count(collection("/db/quotes")/quote) return $num } </html> The only difference is the default namespace declaration. In the documents being queried the quote elements are indeed in no namespace. Much to my surprise XQuery has broken the semantics of XPath 1.0 by applying default namespaces to unqualified names in path expressions. Who thought it would be a good idea to break practice with XSLT, every single XPath implementation on the planet, and years of experience and documentation? There's an argument to be made for default namespaces applying in path expressions, but the time for that argument to be made was 1998. Once the choice was made, the cost of switching was far higher than any incremental improvement you might make. Stare decisis isn't just for the supreme court. Saturday, January 30, 2010 (Permalink) XQuery executing for about an hour now. O(N^2) algorithm perhaps? Maybe I should learn about indexes? Or is eXist just hung? declare namespace xmldb="http://exist-db.org/xquery/xmldb"; declare namespace html="http://www.w3.org/1999/xhtml"; declare namespace xs="http://www.w3.org/2001/XMLSchema"; declare namespace atom="http://www.w3.org/2005/Atom"; for $date in distinct-values( for $updated in collection("/db/news")/atom:entry/atom:updated order by $updated descending return xs:date(xs:dateTime($updated))) let $entries := collection("/db/news")/atom:entry[xs:date(xs:dateTime(atom:updated)) = $date] return <div> for $entry in $entries return $entry/atom:title <hr /> </div> Friday, January 29, 2010 (Permalink) I've got a lot of the old data loaded into eXist (news and quotes; readings and other pages I still have to think about). I'm now focusing on how to get it back out again and put it in web pages. Once that's done, the remaining piece is setting up some system for putting new data in. It will probably be a fairly simple HTML form, but some sort of markdown support might be nice. Perhaps I can hack something together that will insert paragraphs if there are no existing paragraphs, and otherwise leave the markup alone. I'm also divided on the subject of whether to store the raw text, the XHTML converted text, or both. This will be even more critical when I add comment support. Tuesday, January 26, 2010 (Permalink) I've more or less completed the script that converts the old news into Atom entry documents: xquery version "1.0"; declare namespace xmldb="http://exist-db.org/xquery/xmldb"; declare namespace html="http://www.w3.org/1999/xhtml"; declare namespace xs="http://www.w3.org/2001/XMLSchema"; declare namespace atom="http://www.w3.org/2005/Atom"; declare namespace text="http://exist-db.org/xquery/text"; declare function local:leading-zero($n as xs:decimal) as xs:string { let $result := if ($n >= 10) then string($n) else concat("0", string($n)) return $result }; declare function local:parse-date($date as xs:string) as xs:string { let $day := normalize-space(substring-before($date, ",")) let $string-date := normalize-space(substring-after($date, ",")) let $y1 := normalize-space(substring-after($string-date, ",")) (: strip permalink :) let $year := if (contains($y1, "(")) then normalize-space(substring-before($y1, "(")) else $y1 let $month-day := normalize-space(substring-before($string-date, ",")) let $months := ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") let $month := substring-before($month-day, " ") let $day-of-month := local:leading-zero(xs:decimal(substring-after($month-day, " "))) let $monthnum := local:leading-zero(index-of($months,$month)) (: I don't necessarily know the time so I'll pick something vaguely plausible. :) return concat($year, "-", $monthnum, "-", $day-of-month, "T07:00:31-05:00") }; declare function local:first-sentence($text as xs:string) as xs:string { let $r0 := normalize-space($text) let $r1 := substring-before($text, '. ') let $penultimate := substring($r1, string-length($r1)-1, 1) let $sentence := if ($penultimate != " " or not(contains($r1, ' '))) then concat($r1, ".") else concat($r1, ". ", local:first-sentence($r1)) return $sentence }; declare function local:make-id($date as xs:string, $position as xs:integer) as xs:string { let $day := normalize-space(substring-before($date, ",")) let $string-date := normalize-space(substring-after($date, ",")) let $y1 := normalize-space(substring-after($string-date, ",")) (: strip permalink :) let $year := if (contains($y1, "(")) then normalize-space(substring-before($y1, "(")) else $y1 let $month-day := normalize-space(substring-before($string-date, ",")) let $months := ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") let $month := substring-before($month-day, " ") let $day-of-month := local:leading-zero(xs:decimal(substring-after($month-day, " "))) let $monthnum := local:leading-zero(index-of($months,$month)) return concat($month, "_", $day-of-month, "_", $year, "_", $position) }; declare function local:permalink-date($date as xs:string) as xs:string { let $day := normalize-space(substring-before($date, ",")) let $string-date := normalize-space(substring-after($date, ",")) let $y1 := normalize-space(substring-after($string-date, ",")) (: strip permalink :) let $year := if (contains($y1, "(")) then normalize-space(substring-before($y1, "(")) else $y1 let $month-day := normalize-space(substring-before($string-date, ",")) let $month := substring-before($month-day, " ") let $day-of-month := xs:decimal(substring-after($month-day, " ")) return concat($year, $month, $day-of-month) }; for $newsyear in (1998 to 2009) return for $dt in doc(concat("file:///Users/elharo/cafe%20con%20Leche/news", $newsyear ,".html"))/html:html/html:body/html:dl/html:dt let $dd := $dt/following-sibling::html:dd[1] let $date := string($dt) let $itemstoday := count($dd/html:div) return for $item at $count in $dd/html:div let $sequence := $itemstoday - $count + 1 let $id := if ($item/@id) then string($item/@id) else local:make-id($date, $sequence) let $published := if ($item/@class) then string($item/@class) else local:parse-date($date) let $link := concat("http://www.cafeconleche.org/#", $id) let $permalink := if ($item/@id) then concat("http://www.cafeconleche.org/oldnews/news", local:permalink-date($date), ".html#", $item/@id) else concat("http://www.cafeconleche.org/oldnews/news", local:permalink-date($date), ".html") return <atom:entry xml:id="{$id}"> <atom:author> <atom:name>Elliotte Rusty Harold</atom:name> <atom:uri>http://www.elharo.com/</atom:uri> </atom:author> <atom:id>{$link}</atom:id> <atom:title>{local:first-sentence(string($item))}</atom:title> <atom:updated>{$published}</atom:updated> <atom:content type="xhtml" xml:lang="en" xml:base="http://www.cafeconleche.org/" xmlns="http://www.w3.org/1999/xhtml">{$item/node()}</atom:content> <link rel="alternate" href="{$link}"/> <link rel="permalink" href="{$permalink}"/> </atom:entry> I should probably figure out how to remove some of the duplicate date parsing code, but it's basically a one-off migration script so I may not bother. I think I have enough in place now that I can start setting up the templates for the main index.html page and the quote and news archives. Then I can start exploring the authoring half of the equation. Monday, January 25, 2010 (Permalink) I'm beginning to seriously hate the runtime error handling (or lack thereof) in XQuery. It's just too damn hard to debug what's going wrong where compared to Java. You can't see where the bad data is coming from, and there's no try-catch facility to help you out. Now that I think about it, I had very similar problems with Haskell last year. I wonder if this is a common issue with functional languages? Thursday, January 21, 2010 (Permalink) I've just about finished importing all the old quotes into eXist. (There was quite a bit of cleanup work going back 12 years. The format changed solowly over time.) Next up is the news. I am wondering if maybe this is backwards. Perhaps first I should build the forms and backend for posting new content, and then import the old data? After all, it's the new content people are interested in. There's not that much call for breaking XML news from 1998. :-) Wednesday, January 20, 2010 (Permalink) Parsing a date in the form "Wednesday, January 20, 2010" in XQuery: xquery version "1.0"; declare function local:leading-zero($n as xs:decimal) as xs:string { let $result := if ($n >= 10) then string($n) else concat("0", string($n)) return $result }; declare function local:parse-date($date as xs:string) as element() { let $day := normalize-space(substring-before($date, ",")) let $string-date := normalize-space(substring-after($date, ",")) let $year := normalize-space(substring-after($string-date, ",")) let $month-day := normalize-space(substring-before($string-date, ",")) let $months := ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") let $month := substring-before($month-day, " ") let $day-of-month := number(substring-after($month-day, " ")) return <postdate> <day>{$day}</day> <date>{$year}-{local:leading-zero(index-of($months,$month))}-{local:leading-zero($day-of-month)}</date> </postdate> }; local:parse-date("Monday, April 27, 2009") Tuesday, January 19, 2010 (Permalink) Today I went from merely splitting the quotes files apart into indiviodual quotes to actually storing them back into the database: xquery version "1.0"; declare namespace xmldb="http://exist-db.org/xquery/xmldb"; declare namespace html="http://www.w3.org/1999/xhtml"; for $dt in doc("/db/quoteshtml/quotes2009.html")/html:html/html:body/html:dl/html:dt let $id := string($dt/@id) let $date := string($dt) let $dd := $dt/following-sibling::html:dd[1] let $quote := $dd/html:blockquote let $cite := string($quote/@cite) let $source := $quote/following-sibling::* let $sourcetext := normalize-space(substring-after($source, "--")) let $author := if (contains($sourcetext, "Read the")) then substring-before($sourcetext, "Read") else substring-before($sourcetext, "on the") let $location := if ($source/html:a) then $source/html:a else substring-after($sourcetext, "on the") let $quotedate := if (contains($sourcetext, "list,")) then normalize-space(substring-after($sourcetext, "list,")) else "" let $justlocation := if (contains($location, "list,")) then normalize-space(substring-after(substring-before($sourcetext, ","), "on the")) else $location let $singlequote := <quote> <id>{$id}</id> <postdate>{$date}</postdate> <content>{$quote}</content> <cite>{$cite}</cite> <author>{$author}</author> <location>{$justlocation}</location> { if ($quotedate) then <quotedate>{$quotedate}</quotedate> else "" } </quote> let $name := concat("quote_", $id) let $store-return := xmldb:store("quotes", $name, $singlequote) return <store-result> <store>{$store-return}</store> <documentname>{$name}</documentname> </store-result> I suspect the next thing I should do is work on iomproving the dates somewhat since I'll likely want to sort and query by them. Right now they're human reabale but not so easy to process. E.g. <postdate>Monday, April 27, 2009</postdate> I should try to turn this into <postdate> <day>Monday</day> <date>2009-04-27</date> </postdate> Time to read up on the XQuery date and time functions. Hmm, looks like it's going to be regular expressions after all. Friday, January 15, 2010 (Permalink) I've converted all the old quotes archives to well-formed (though not necessarily valid) XHTML and uploaded them into eXist. Now I have to come up with an XQuery that breaks them up into individual quotes. This is proving trickier than expected (and I expected it to be pretty tricky, especially since a lot of the old quotes aren't in perfectly consistent formats. Maybe it's time to try out Oxygen's XQuery debugger since they sent me a freebie? If only the interface weren't such a horrow show. They say they have a debugger but I can't find it, and the buttons they're using in the screencast don't seem to be present in the latest version. In the meantime, can anyone see the syntax error in this code? xquery version "1.0"; declare namespace xmldb="http://exist-db.org/xquery/xmldb"; declare namespace html="http://www.w3.org/1999/xhtml"; for $dt in doc("/db/quoteshtml/quotes2010.html")/html:html/html:body/html:dl/html:dt let $id := string($dt/@id) let $date := string($dt) let $dd := $dt/following-sibling::html:dd let $quote := $dd/html:blockquote let $cite := string($quote/@cite) let $source := $quote/following-sibling::html:p let $author := normalize-space(substring-after($source/*[1], "--")) return <quote> <id>{$id}</id> <date>{$date}</date> <quote>{$quote}</quote> <cite>{$cite}</cite> <source>{$quote}</source> <author>{$author}</author> </quote> The error message from exist is "The actual cardinality for parameter 1 does not match the cardinality declared in the function's signature: string($arg as item()?) xs:string. Expected cardinality: zero or one, got 4." Found the bug: the debugger wasn't very helpful (once I found it--apparently Author and Oxygen are not the same thing), but Saxon had much better error messages than eXist. I needed to change let $dd := $dt/following-sibling::html:dd to let $dd := $dt/following-sibling::html:dd[1]. eXist didn't tell me which line had the problem so I was looking in the wrong place. Saxon pointed me straight to it. Score 1 for Saxon. Here's the finished script. It works for at least the lasy couple of years. I still have to test it out on some of the older files: xquery version "1.0"; declare namespace xmldb="http://exist-db.org/xquery/xmldb"; declare namespace html="http://www.w3.org/1999/xhtml"; for $dt in doc("/db/quoteshtml/quotes2009.html")/html:html/html:body/html:dl/html:dt let $id := string($dt/@id) let $date := string($dt) let $dd := $dt/following-sibling::html:dd[1] let $quote := $dd/html:blockquote let $cite := string($quote/@cite) let $source := $quote/following-sibling::* let $sourcetext := normalize-space(substring-after($source, "--")) let $author := if (contains($sourcetext, "Read the")) then substring-before($sourcetext, "Read") else substring-before($sourcetext, "on the") let $location := if ($source/html:a) then $source/html:a else substring-after($sourcetext, "on the") let $quotedate := if (contains($sourcetext, "list,")) then normalize-space(substring-after($sourcetext, "list,")) else "" let $justlocation := if (contains($location, "list,")) then normalize-space(substring-after(substring-before($sourcetext, ","), "on the")) else $location return <quote> <id>{$id}</id> <postdate>{$date}</postdate> <quote>{$quote}</quote> <cite>{$cite}</cite> <author>{$author}</author> <location>{$justlocation}</location> { if ($quotedate) then <quotedate>{$quotedate}</quotedate> else "" } </quote> Thursday, January 14, 2010 (Permalink) The XQuery work continues to roll along. I think I've roughly figured out to configure the server. I found and reported a few more bugs in eXists, none too critical. I now have eXist serving this entire web site on my local box, though I haven't changed the server here on IBiblio yet. That's still Apache and PHP. The next step is to convert all the static files from the last 12 years--quotes, news, books, conferences, etc.--into smaller documents in the database. For instance, each quote will be its own document. Then I have to rewrite the pages the as XQuery "templates" that query the database. From that point I can add suppor for new posts, submissions, and comments via a web browser and forms. Friday, January 8, 2010 (Permalink) I didn't really like the format of yesterday's Twitter dump so today I opened another can of XQuery ass-kicking to improve it. First, let's group by date: xquery version "1.0"; declare namespace atom="http://www.w3.org/2005/Atom"; let $tweets := for $entry in reverse(document("/db/twitter/elharo")/atom:feed/atom:entry) return <div><date>{substring-before($entry/atom:updated/text(), "T")}</date> <p> <span>{substring-before(substring-after($entry/atom:updated/text(), "T"), "+")} UTC</span> {substring-after($entry/atom:title/text(), "elharo:")}</p></div> return for $date in distinct-values($tweets/date) return <div><h3>{$date}</h3> { for $tweet in $tweets where $tweet/date = $date return $tweet/p }</div> Now let's hyperlink the URLs: xquery version "1.0"; declare namespace atom="http://www.w3.org/2005/Atom"; let $tweets := for $entry in reverse(document("/db/twitter/elharo")/atom:feed/atom:entry) return <div><date>{substring-before($entry/atom:updated/text(), "T")}</date> <p> <span>{substring-before(substring-after($entry/atom:updated/text(), "T"), "+")} </span> {replace(substring-after($entry/atom:title/text(), "elharo:"), "(http://[^s]+)", "<a href='http://$1'>http://$1</a>")}</p></div> return for $date in distinct-values($tweets/date) return <div><h3>{$date}</h3> { for $tweet in $tweets where $tweet/date = $date return $tweet/p }</div> Let's do the same for @names: xquery version "1.0"; declare namespace atom="http://www.w3.org/2005/Atom"; let $tweets := for $entry in reverse(document("/db/twitter/elharo")/atom:feed/atom:entry) return <div><date>{substring-before($entry/atom:updated/text(), "T")}</date> <p> <span>{substring-before(substring-after($entry/atom:updated/text(), "T"), "+")} </span> { replace ( replace(substring-after($entry/atom:title/text(), "elharo:"), "(http://[^s]+)", "<a href='$1'>$1</a>"), " @([a-zA-Z]+)", " <a href='http://twitter.com/$1'>@$1</a>" ) }</p></div> return for $date in distinct-values($tweets/date) return <div><h3>{$date}</h3> { for $tweet in $tweets where $tweet/date = $date return $tweet/p }</div> And one more time for hash tags: xquery version "1.0"; declare namespace atom="http://www.w3.org/2005/Atom"; let $tweets := for $entry in reverse(document("/db/twitter/elharo")/atom:feed/atom:entry) return <div><date>{substring-before($entry/atom:updated/text(), "T")}</date> <p> <span>{substring-before(substring-after($entry/atom:updated/text(), "T"), "+")} </span> { replace ( replace ( replace(substring-after($entry/atom:title/text(), "elharo:"), "(http://[^s]+)", "<a href='$1'>$1</a>"), " @([a-zA-Z]+)", " <a href='http://twitter.com/$1'>@$1</a>" ), " #([a-zA-Z]+)", " <a href='http://twitter.com/search?q=#$1'>#$1</a>" ) }</p></div> return for $date in distinct-values($tweets/date) return <div><h3>{$date}</h3> { for $tweet in $tweets where $tweet/date = $date return $tweet/p }</div> And here's the finished result. Thursday, January 7, 2010 (Permalink) This morning a simple practice exercise to get my toes wet. First load my Tweets from their Atom feed into eXist: xquery version "1.0"; declare namespace xmldb="http://exist-db.org/xquery/xmldb"; let $collection := xmldb:create-collection("/db", "twitter") let $filename := "" let $URI := xs:anyURI("file:///Users/elharo/backups/elharo_statuses.xml") let $retcode := xmldb:store($collection, "elharo", $URI) return $retcode Then generate HTML of each tweet: xquery version "1.0"; declare namespace atom="http://www.w3.org/2005/Atom"; for $entry in document("/db/twitter/elharo")/atom:feed/atom:entry return <p>{$entry/atom:updated/text()} {substring-after($entry/atom:title/text(), "elharo:")}</p> Can I reverse them so they go forward in time? Yes, easily: for $entry in reverse(document("/db/twitter/elharo")/atom:feed/atom:entry) Now how do I dump that to a file? Maybe something like this? xquery version "1.0"; declare namespace atom="http://www.w3.org/2005/Atom"; let $tweets := <html> {for $entry in document("/db/twitter/elharo")/atom:feed/atom:entry return <p>{$entry/atom:updated/text()} {substring-after($entry/atom:title/text(), "elharo:")}</p> } </html> return xmldb:store("/db/twitter", "/Users/elharo/tmp/tweets.html", $tweets) Oh damn. Almost, but that puts it back into the database instead of the filesystem. Still I can now run a query that grabs just that and copy and paste the result since there's only 1. The first query gave almost 1000 results and the query sandbox only shows one at a time. Tomorrow: how do I serve that query as a web page? Wednesday, January 6, 2010 (Permalink) What I've learned about eXist so far: I can use virtual hosting to run it, either at Rackspace Cloud, Amazon EC2, or right here on IBiblio; and use Jetty as my web server. However I probably should proxy it behind Apache anyway. I can upload files into the repository. I can execute simple XQueries using the XQuery sandbox. What I still don't know: How to address the documents I upload from inside the XQuery sandbox; and in general how to manage and manipulate collections. Partial answer: xquery version "1.0"; declare namespace xmldb="http://exist-db.org/xquery/xmldb"; for $foo in collection("/db/collectionname
images
file name | alternative text |
---|---|
cup.gif | Cup of |
refactoringhtml.png | |
c1.png | Refactoring HTML |
c2.jpg | Hosted by IBiblio |
c3.jpg | |
c4.jpg | |
headshot.jpg | |
sm_hosted_trans.gif |
headers
H1
Cafe con Leche XML News and Resources
H2
Quote of the Day
Today's News
Recommended Reading
Recent News
H3
Quote of the Day
Today's News
Recommended Reading
Recent News
H4
Validating Parsers
Non-validating Parsers
Online Validators and Syntax Checkers
Formatting Engines
Browsers
Class Libraries
Editors
XML Applications
External Sites
H5
H6
internal links
address | anchor text |
---|---|
images/favicon.ico | Cup of |
oldnews/news2010April6.html | Permalink to Today's News |
#recent | Recent News |
news2010.html | Older News |
mailto:elharo%40ibiblio%2Eorg | E-mail Elliotte Rusty Harold |
readings2010.phtml | previous recommended reading |
reading.rss | recommended reading RSS feed |
oldnews/news2010February12.html | Permalink |
oldnews/news2010February10.html | Permalink |
oldnews/news2010February3.html | Permalink |
oldnews/news2010January30.html | Permalink |
oldnews/news2010January29.html | Permalink |
oldnews/news2010January26.html | Permalink |
{$link} | I should probably figure out how to remove some of the duplicate date parsing code, but it's basically a one-off migration script so I may not bother. I think I have enough in place now that I can start setting up the templates for the main index.html page and the quote and news archives. Then I can start exploring the authoring half of the equation. Monday, January 25, 2010 (Permalink |
oldnews/news2010January21.html | Permalink |
oldnews/news2010January20.html | Permalink |
oldnews/news2010January19.html | Permalink |
oldnews/news2010January15.html | Permalink |
oldnews/news2010January14.html | Permalink |
oldnews/news2010January8.html | Permalink |
oldnews/news2010January7.html | Permalink |
oldnews/news2010January6.html | Permalink |
oldnews/news2010January5.html | Permalink |
oldnews/news2010January4.html | Permalink |
news2009.html | Older News |
books.html | XML Books |
examples/ | XML Examples |
tradeshows.xml | XML Trade Shows |
mailinglists.html | XML Mailing Lists |
quotes2010.html | XML Quotes |
today.rss | Cafe con Leche RSS Feed |
http://www.cafeconleche.org/books/xian3/ | |
books/bible3/ | |
books/effectivexml/ | |
books/xmljava/ | |
mailto:elharo%40ibiblio%2Eorg | elharo@metalab.unc.edu |
books/xmljava/ | Processing XML with Java |
books/xian3/ | XML in a Nutshell |
books/effectivexml/ | Effective XML |
books/bible3/ | The XML 1.1 Bible |
books/biblegold/ | The XML Bible, Gold Edition |
books/xml/ | XML: Extensible Markup Language |
reports/ | Special Reports |
books.html | XML Book List |
examples/ | XML Examples |
slides/ | XML Seminar Slides |
tradeshows.xml | XML Conferences |
mailinglists.html | XML Mailing Lists |
quotes2010.html | XML Quotes |
today.rss | RSS Feed |
today.atom | Atom Feed |
books/bible3/chapters/ch15.html | XSLT |
books/bible3/chapters/ch16.html | XSL-FO |
books/bible3/chapters/ch17.html | XLinks |
books/bible3/chapters/ch18.html | XPointers |
books/bible3/chapters/ch20.html | Schemas |
tradeshows.xml | More conferences |
SAXTest/ | SAX Conformance Tests |
xquisitor/ | XQuisitor |
slides/albany/effective/effectivexml.html | Effective XML |
slides/sd2004west/stax/ | StAX |
slides/sd2004west/xom/ | XOM |
slides/sd2004west/dom3/ | DOM Level 3 |
slides/sd2002west/introxml/ | Intro to XML |
slides/sd2002west/xmlandjava/ | Processing XML with Java |
slides/sd2004west/xmlfundamentals/ | XML Fundamentals |
slides/albany/xquery/ | XQuery |
slides/xmlone/london2002/namespaces/ | Namespaces |
slides/sd2002west/xslt2/ | XSLT 2.0 and Beyond |
slides/sd2002east/schemas/ | Schemas |
slides/sd2000east/dtds/ | DTDs |
slides/sd2000east/dom/ | DOM |
slides/sd2000east/sax/ | SAX |
slides/sd2002east/xlinks/ | XLinks and XPointers |
slides/sd2004west/xslt/ | XSL Transformations |
slides/jaoo99/hypevshope/ | XML: Hype vs. Hope |
slides/xmlonesanjose2001/xinclude/ | XInclude |
slides/xmlone/london2002/advancedxml/ | Advanced XML |
about.html | About this web site |
books/effectivexml/ | Effective XML |
books/xmljava/ | Processing XML with Java |
books/xian3/ | XML In A Nutshell |
books/bible3/ | XML Bible |
books/xml/ | XML: Extensible Markup Language |
tradeshows.xml | XML Conferences and Trade Shows |
books.html | XML Book List |
mailinglists.html | XML Mailing Lists |
quotes2008.html | Quotes |
external links
address | anchor text |
---|---|
http://www.xom.nu/ | XOM 1.2.5 |
http://jaxen.codehaus.org/ | website |
http://jaxen.codehaus.org/releases.html | releases page |
http://www.cafeaulait.org/ | Today's Java News on Cafe au Lait |
http://cafe.elharo.com/ | The Cafes |
http://www.w3.org/TR/xpath-functions/#durations-dates-times | XQuery date and time functions |
http://www.oxygenxml.com/xquery_debugger.html | XQuery debugger |
http://$1 | http://$1")}
return
for $date in distinct-values($tweets/date)
return {$date}{ for $tweet in $tweets where $tweet/date = $date return $tweet/p }{substring-before(substring-after($entry/atom:updated/text(), "T"), "+")} { replace ( replace(substring-after($entry/atom:title/text(), "elharo:"), "(http://[^s]+)", "$1"), " @([a-zA-Z]+)", " @$1" ) } {$date}{ for $tweet in $tweets where $tweet/date = $date return $tweet/p }{substring-before(substring-after($entry/atom:updated/text(), "T"), "+")} { replace ( replace ( replace(substring-after($entry/atom:title/text(), "elharo:"), "(http://[^s]+)", "$1"), " @([a-zA-Z]+)", " @$1" ), " #([a-zA-Z]+)", " #$1" ) } {$date}{ for $tweet in $tweets where $tweet/date = $date return $tweet/p } |
https://sourceforge.net/tracker/?func=detail&aid=2926143&group_id=17691&atid=117691 | excessive confirmation |
https://sourceforge.net/tracker/?func=detail&aid=2926152&group_id=17691&atid=117691 | Second bug filed |
http://cafe.elharo.com/ | The Cafes |
http://www.cafeaulait.org | Cafe au Lait |
http://www.elharo.com/ | Elliotte Rusty Harold |
http://cafe.elharo.com/ | The Cafes |
http://www.elharo.com/blog/ | Mokka mit Schlag |
http://www.cafeaulait.org | Cafe au Lait |
http://www.amazon.com/gp/pdp/profile/AYXOSXMBUAT1Y/ | Amazon Plog |
http://www.elharo.com/ | |
http://www.amazon.com/exec/obidos/ISBN=0321503635/ref=nosim/cafeaulaitA | Refactoring HTML |
http://www.ucc.ie/xml/ | The XML FAQ List |
http://www.xml.com/axml/testaxml.htm | The Annotated XML Spec |
http://www.balisage.net/ | Balisage |
http://www.xom.nu/ | XOM |
http://jaxen.codehaus.org/ | Jaxen |
http://xincluder.sourceforge.net/ | XInclude |
http://www.cafeaulait.org/ | Cafe au Lait |
http://www.w3c.org/TR/REC-xml | XML 1.0 |
http://www.w3.org/XML/xml-19980210-errata | Errata in XML 1.0 |
http://www.xml.com/axml/axml.html | Annotated XML 1.0 specification |
http://www.w3c.org/TR/REC-xml-names | XML Namespaces |
http://www.w3.org/pub/WWW/TR/REC-CSS1 | CSS Level 1 |
http://www.w3.org/TR/REC-CSS2 | CSS Level 2 |
http://www.w3.org/TR/REC-html40 | HTML 4.0 |
http://www.w3.org/TR/xhtml1 | XHTML 1.0 |
http://www.w3.org/TR/xsl/ | XSL Formatting Objects |
http://www.w3.org/TR/xslt | XSL Transformations 1.0 |
http://www.w3.org/TR/xpath | XPath 1.0 |
http://www.w3.org/TR/xmlschema-0/ | XML Schema Part 0: Primer |
http://www.w3.org/TR/xmlschema-1/ | XML Schema Part 1: Structures |
http://www.w3.org/TR/xmlschema-2/ | XML Schema Part 2: Datatypes |
http://www.w3c.org/TR/xlink | XLinks |
http://www.w3c.org/TR/xptr | XPointers |
http://www.w3.org/DOM/ | DOM |
http://sax.sourceforge.net/ | SAX |
ftp://ds.internic.net/rfc/rfc1738.txt | URLs |
http://www.ics.uci.edu/pub/ietf/uri/rfc2396.txt | URIs |
http://purl.oclc.org/dc/ | Dublin Core |
http://www.unicode.org/ | Unicode |
http://www.xmlsoft.org/ | libxml |
http://exml.sourceforge.net/ | EXML |
http://xml.apache.org/xerces2-j/index.html | Xerces-J |
http://xml.apache.org/xerces-c/index.html | Xerces-C |
http://xml.apache.org/xerces-p/index.html | Xerces-P |
http://msdn.microsoft.com/xml | MSXML |
http://www.alphaworks.ibm.com/formula/xml | XML Parser for Java |
http://www.garshol.priv.no/download/software/xmlproc/ | xmlproc |
http://www.textuality.com/Lark/ | Larval |
http://www.loria.fr/projets/XSilfide/EN/sxp/ | SXP |
ftp://ftp.cogsci.ed.ac.uk/pub/richard/ | RXP |
http://xml.apache.org/crimson/ | Crimson |
http://www.informatik.uni-trier.de/%7Eneumann/Fxp | fxp |
http://www.alphaWorks.ibm.com/tech/xml4c/ | XML for C++ |
http://www.ltg.ed.ac.uk/software/xml/ | LTXML |
http://www.icom-dv.de/xml/ | XML parser |
http://kxml.sourceforge.net/ | KXML |
http://www.latenightsw.com/freeware/XMLTools2/ | XML Tools |
http://www.dcarlisle.demon.co.uk/xmltex/manual.html | xmltex |
http://www.elfdata.com/xmlengine/ | XML Engine |
http://www.perl.com/CPAN-local/modules/by-module/XML/ | XML::Parser |
http://www.textuality.com/Lark/ | Lark |
http://www.jclark.com/xml/xp/index.html | XP |
http://www.gnu.org/software/classpathx/jaxp/jaxp.html | GNU JAXP |
http://www.libexpat.org | Expat |
http://exml.dhs.org | eXML |
http://www.nenie.org/eiffel/xml/ | Nenie XML |
http://www.jeremie.com/Dev/XML/ | XParse |
http://pyxml.sourceforge.net/ | PyXML |
http://www.python.org/doc/current/lib/module-xml.sax.html | xml.sax |
http://www.stg.brown.edu/service/xmlvalid/ | STG XML Validation Form |
http://www.cogsci.ed.ac.uk/%7Erichard/xml-check.html | xml-check |
http://www.xmlsoft.org/XSLT.html | libxslt |
http://saxon.sourceforge.net/ | Saxon |
http://xml.apache.org/xalan/index.html | Xalan |
http://www.aztecrider.com/xslt/ | jd.xslt |
http://www.gingerall.com/charlie-bin/get/webGA/act/sablotron.act | Sablotron |
http://www.jclark.com/xml/xt.html | XT |
http://xml.apache.org/fop/index.html | FOP |
http://xmlroff.sourceforge.net/ | xmlroff |
http://www.renderx.com/tools/xep.html | XEP |
http://www.tei-c.org.uk/Software/passivetex/ | PassiveTeX |
http://www.antennahouse.com/xslformatter.html | Antenna House XSL Formatter |
http://www.jclark.com/jade | Jade |
ftp://ftp.cogsci.ed.ac.uk/pub/XSLJ/ | xslj |
http://javalab.uoregon.edu/ser/software/docproc/ | docproc |
http://www.inria.fr/koala/XML/xslProcessor | Koala XSL Engine |
http://www.opera.com/ | Opera |
http://www.xml-cml.org/jumbo3/index.html | Jumbo |
http://www.mozilla.org/ | Mozilla |
http://www.mozilla.org/products/firefox/ | Firefox |
http://www.apple.com/safari/ | Safari |
http://www.microsoft.com/windows/ie/default.htm | Internet Explorer Windows |
http://www.x-smiles.org/ | X-Smiles |
http://www.integretechpub.com/techexplorer/ | TechExplorer |
http://www.jdom.org/ | JDOM |
http://www.xom.nu/ | XOM |
http://jaxen.codehaus.org/ | Jaxen |
http://xml-copy-editor.sourceforge.net/ | XML Copy Editor |
http://www.syntext.com/products/serna2/index.htm | Serna |
http://www.editix.com/ | EditiX |
http://www.cladonia.com/products.htm | Exchanger |
http://www.oxygenxml.com/ | |
http://www.editml.com/ | EditML |
http://na.justsystems.com/content.php?page=xmetal | XMetaL |
http://www.xmlspy.com/ | XML Spy |
http://www.vervet.com/ | XML Pro |
http://xmlwriter.net/download.shtml | XMLwriter |
http://www.xml-cml.org/jumbo3/index.html | Jumbo |
http://www.xmlcooktop.com/ | Cooktop |
http://www.xmlmind.com/xmleditor/ | XMLmind XML Editor |
http://knb.ecoinformatics.org/software/eml/ | Ecological Metadata Language (EML) |
http://www.ccil.org/%7Ecowan/XML/ibtwsh6.dtd | Itsy Bitsy Teeny Weeny Simple Hypertext DTD (IBTWSH) |
http://violet.csa.iisc.ernet.in/%7Emodl/ | Molecular Dynamics Language |
http://www.venus.co.uk/omf/cml/intro.html | Chemical Markup Language |
http://www.w3c.org/Math/ | Mathematical Markup Language |
http://www.recordare.com/xml.html | MusicXML |
http://www.w3.org/TR/NOTE-ice | ICE |
http://www.w3.org/TR/REC-rdf-syntax | Resource Description Framework |
http://www.flixml.org/ | FlixML |
http://jabr.ne.mediaone.net/documents/xmtp.htm | Extensible Mail Transport Protocol |
http://www.w3.org/TR/NOTE-PIDL | Personalized Information Description Language |
http://www.w3.org/TR/xhtml1/ | XHTML |
http://msdn.microsoft.com/workshop/delivery/cdf/reference/CDF.asp | Channel Definition Format |
http://www.w3.org/TR/SVG/ | Scalable Vector Graphics |
http://www.w3.org/XML/ | The W3C |
http://www.xml.com/ | xml.com |
http://www.microsoft.com/xml/ | Microsoft's XML Page |
http://www.oasis-open.org/cover/xml.html | Robin Cover's XML Web Page |
http://www.idealliance.org/resources_xml.asp | The XML Files |
http://www.oasis-open.org/ | OASIS |
http://xmlfr.org/ | |
http://www.cafeaulait.org/ | Cafe au Lait |
http://www.ibiblio.org/ | Hosted by IBiblio |