language page 6 - Dave's Blog

Search
My timeline on Mastodon

New XSLT - IE7 XML Source View Upgrade Part 2

2007 May 11, 8:55Last time, I had written some resource tools to allow me to view and modify Windows module resources in my ultimate and noble quest to implement the XML content-type fragment in IE7. Using the resource tools I found that MSXML3.DLL isn't signed and that I can replace the XSLT embedded resource with my own, which is great news and means I could continue in my endevour. In the following I discuss how I came up with this replacement for IE7's XML source view.

At first I thought I could just modify the existing XSLT but it turns out that it isn't exactly an XSLT, rather its an IE5 XSL. I tried using the XSL to XSLT converter linked to on MSDN, however the resulting document still requires manual modification. But I didn't want to muck about in their weird language and I figured I could write my own XSLT faster than I could figure out how theirs worked.

I began work on the new XSLT and found it relatively easy to produce. First I got indenting working with all the XML nodes represented appropriately and different CSS classes attached to them to make it easy to do syntax highlighting. Next I added in some javascript to allow for closing and opening of elements. At this point my XSLT had the same features as the original XSL.

Next was the XML mimetype fragment which uses XPointer, a framework around various different schemes for naming parts of an XML document. I focused on the XPointer scheme which is an extended version of XPath. So I named my first task as getting XPaths working. Thankfully javascript running in the HTML document produced by running my XSLT on an XML document has access to the original XML document object via the document.XMLDocument property. From this this I can execute XPaths, however there's no builtin way to map from the XML nodes selected by the XPath to the HTML elements that I produced to represent them. So I created a recursive javascript function and XSLT named-template that both produce the same unique strings based on an XML node's position in the document. For instance 'a3-e2-e' is the name produced for the 3rd attribute of the second element of the root element of the XML document. When producing the HTML for an XML node, I add an 'id' attribute to the HTML with the unique string of the XML node. Then in javascript when I execute an XPath I can discover the unique string of each node in the selected set and map each of them to their corresponding positions in the HTML.

With the hard part out of the way I changed the onload to get the fragment of the URI of the current document, interpret it as an XPath and highlight and navigate to the selected nodes. I also added an interactive floating bar from which you can enter your own XPaths and do the same. On a related note, I found that when accessing XML files via the file URI scheme the fragment is stripped off and not available to the javascript.

The next steps are of course to actually implement XPointer framework parsing as well as the limited number of schemes that the XPointer framework specifies.PermalinkCommentsxml xpointer msxml res xpath xslt resource ie7 technical browser ie xsl

XML Pointer Language (XPointer)

2007 May 10, 12:17The XPointer specification describing the fragment used with text/xml documents.PermalinkCommentsw3c xml xpath xpointer reference uri fragment

WordNet - Princeton University Cognitive Science Laboratory

2007 Apr 19, 3:41"WordNet is a large lexical database of English... Nouns, verbs, adjectives and adverbs are grouped into sets of cognitive synonyms (synsets), each expressing a distinct concept...The resulting network of meaningfully related words and concepts can be navPermalinkCommentsalgorithm collections etymology dictionary visualization xml language ontology tool free

Hole-in-the-Wall Experiment

2007 Apr 12, 2:29Social experminet to see what happens when a computer is made publicly available to poor children with no previous knowledge of computers or the English language.PermalinkCommentscomputer computer-literacy india article experiment education internet

Good Math, Bad Math : Prime Number Pathology: Fractran

2007 Apr 12, 2:04A programming language expressed and evaluated with prime numbers.PermalinkCommentsmath prime programming language algorithm turing

Extensible Markup Language (XML) 1.0 (Third Edition)

2007 Mar 8, 1:02Defintion of the escape mechanism used in XML.PermalinkCommentsxml escape encoding reference w3c standard character-entity-reference

ishida >> utilities: Unicode character pickers

2007 Feb 14, 3:12Another of Richard's tools that allows you to compose strings by visually picking characters from particular alphabets.PermalinkCommentsunicode tools picker encoding javascript language tool codepage i18n

Stefano's Linotype ~ Folksologies: de-idealizing ontologies

2007 Feb 12, 5:20Another article on folksonomy, tagging, and ontologies found via Sir TBL's article.PermalinkCommentsarticle blog essay folksonomy information language metadata ontology social tag tagging semanticweb

Religious Speech Sensor

2007 Feb 2, 2:41This tool searches text for biblical quotes or text suspected to be inspired by biblical quotes. That's sensor not censor.PermalinkCommentsperl religion software politics language tool propaganda download

PHP Manual

2007 Jan 19, 5:06PHP standes for "PHP Hypertext Preprocessor". Its an open source, server side scripting language. Its running my homepage.PermalinkCommentsphp programming reference development web webdesign code documentation software open-source opensource quickreference

xkcd

2006 Dec 28, 2:09A humorous nerdy webcomic.PermalinkCommentscomics humor comic math science nerd daily language

xkcd - A webcomic of romance, sarcasm, math, and language - By Randall Munroe

2006 Dec 28, 1:18This one is also funnyPermalinkCommentscomic math humor your-mom for:jozhik

xkcd - A webcomic of romance, sarcasm, math, and language - By Randall Munroe

2006 Dec 28, 1:15On the topic of your desired major.PermalinkCommentscomic language humor math computational-linguistics for:jozhik

Firefox and Witchcraft - The Connection? (xkcd - A webcomic of romance, sarcasm, math, and language - By Randall Munroe)

2006 Dec 28, 1:09Humorous graph likely produced by 3rd party and in no way generated by Microsoft.PermalinkCommentsfirefox humor comic microsoft mozilla ie witchcraft

Wordie: People: sequelguy

2006 Dec 27, 2:56My profile on WordiePermalinkCommentsproldfile wordie social word words language me

Wordie

2006 Dec 27, 2:52'Like Flickr, but without the photos.' Flickr : photos :: Wordie : words. Its kind of funny really. The web is dead. Long live the web.PermalinkCommentsweb2.0 words social language collaboration list lists word english etymology

OPML

2006 Dec 11, 3:35This is a language for describing outlines. Its used in several places on the Internet to convey your RSS feed subscription list.PermalinkCommentsreference xml html language opml rss specification

Go To Statement Considered Harmful

2006 Dec 7, 1:15Dijkstra's famous anti-goto paper. I agree with him. Due to goto in BASIC through 3rd and 4th grade I thought goto was a word.PermalinkCommentsarticle history humor language goto code programming dijkstra acm read

Encode-O-Matic

2006 Dec 3, 7:21Free encoding conversion application I made. Convert strings between various Internet related encodings including character sets, HTML encoding, URI encoding, and more.PermalinkCommentsfree encoding language tool download encodeomatic convert .net projects me personal

XSL Transformations (XSLT)

2006 Nov 29, 11:35The Extensible Stylesheet Language Transformation specification.PermalinkCommentsxhtml w3c standards specification reference xsl xslt quickreference
Older EntriesNewer Entries Creative Commons License Some rights reserved.