document page 9 - Dave's Blog

Search
My timeline on Mastodon

<msxsl:script> Element

2007 May 18, 1:14Documentation on adding custom functions to XSLTs run with MSXML3.DLL.PermalinkCommentsmsdn xml script extension programming code microsoft windows reference

XPointer Framework - IE7 XML Source View Upgrade Part 3

2007 May 17, 5:16Previously I created some resource tools and then I used them to overwrite msxml3's XML source view. In this update I've added support for the XPointer Framework.

This time around I've started to add support for the XPointer Framework to my XML source view and I've added installation instructions. The framework consists of a series of pointer segments each of which has a scheme name followed by data in parenthesis. For example 'scheme1(data1)scheme2(data2)scheme3(data3)'. A pointer segment resolves to a portion of the XML document based on the data and the scheme name. The whole pointer resolves to the first segment that successfully resolves. That is, from the example, if scheme1 resolves to nothing and scheme2 resolves to something then that's used and scheme3 is ignored. In addition to the framework I've added support for the xmlns scheme which binds namespace prefixes to a namespace URI and the element scheme which is a simple way to resolve to particular elements in an XML. I also have limited support for the xpointer scheme the content of which is resolved as an XPath with some extra functions (which I don't support -- hence the limited). I've also thrown in schemes for the two SelectionLanguage values supported by msxml3.

Next time I might try to support the xpointer functions that aren't in xpath using msxml script. But I think I'm losing steam on this project... we'll see.PermalinkCommentsresource technical xml xpointer res xpath xslt

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

res Protocol

2007 May 9, 9:47MSDN documentation on the res URI scheme which resolves resources in Windows modules.PermalinkCommentsmsdn uri res microsoft schema scheme resource module

XSL to XSLT Converter 1.1

2007 May 3, 12:52A free tool to convert old style XSL documents into XSLT documents.PermalinkCommentsmsdn microsoft tool free download xsl xslt xml

RSS 2.0 Specification (RSS 2.0 at Harvard Law)

2007 Apr 25, 1:43The RSS spec.PermalinkCommentsdocumentation quickreference rss reference specification standard xml

Opera Speed Dial Code-less Hack for IE7

2007 Apr 17, 11:45Opera (the fifth most popular web browser) has a new feature named Speed Dial (video of it in action). Whenever you open a new tab you get your Speed Dial view which consists of nine thumbnails of user-settable pages. Its like a quick-favorites that appears every time you open a new tab. I think this is a neat idea and was considering how I might do that in IE7. The following is my hack-y and ugly but no coding required version of Speed Dial for IE7. I like my hack and I'm about to expound upon it in unnecessary detail so skip to the last paragraph if you're afraid of losing interest.

By default in IE7, whenever you open a new tab you navigate to 'about:Tabs'. As noted in wikipedia the result of navigation to 'about:Tabs' is determined by values in the registry. Specifically, values in the key in "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AboutURLs". Usually this fact is exploited by malicious software to hijack "about:blank" and show you ads but we can hijack it too in order to display our Speed Dial-ish page.

Of course since this is a code-less hack we've got limited options on what to change 'about:Tabs' to display. It should have the following requirements.
  1. Something local so that our 'about:Tabs' doesn't disappear when we go offline and so that its relatively fast.
  2. The user should be able to modify its content.
  3. Show links that the user uses.
  4. Show thumbnails of those links
  5. Provide easy to use drag and drop interaction and generally look cool.
Now, I use del.icio.us which allows me to store all of my favorites online and which provides RSS feeds that list my saved links. New in IE7 is an RSS platform that will, among other things, cache RSS feeds locally. So, by pointing about:Tabs to my del.icio.us feed 'http://del.icio.us/rss/sequelguy/quickreference' I get (1) from IE7's RSS support, and (2) and (3) from del.icio.us. Of course requirements (4) and (5) are missing but hey, I said this was ugly.

In summary, if you change the registry value "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AboutURLs!Tabs" to point to an RSS feed of your favorites you can get a hack-y version of Opera's Speed Dial. I should note that although its referenced on pages such as wikipedia changing your 'about:Tabs' URI in the manner I describe is not documented and not supported by Microsoft. There could be all kinds of horrible repercussions from this change of which I'm not aware. Yeah, actually you know what? Forget I said any of this. Pretend I never wrote it...PermalinkCommentsbrowser technical hack

IE Extensibility - Using Rendering Behaviors

2007 Apr 16, 3:33An overlooked point of IE extensibility. Attach behaviors to elements in your document via style sheets. Essentially this lets you override the normal behavior of document elements with your own code. The article tells you all about it.PermalinkCommentsmsdn microsoft ie browser code programming css article howto extension behavior

RFC 2141 URN Syntax

2007 Apr 12, 10:55Uniform Resource Names (URNs) are intended to serve as persistent, location-independent, source identifiers. This document sets forward the canonical syntax for URNs.PermalinkCommentsurn uri rfc reference internet namespace standard

Localisation Considerations in DTD Design

2007 Apr 5, 5:28A paper on localization of XML DTDs.PermalinkCommentsdesign documentation i18n xml dtd richard-ishida

Using public keys for SSH authentication

2007 Mar 19, 3:13Documentation on setting up SSH to use keys.PermalinkCommentssecurity ssh howto key publickey putty

Version Control with Subversion

2007 Mar 19, 11:23This is a free online book on using Subversion the version control system.PermalinkCommentsreference book subversion svn tutorial documentation free download howto

wikileaks.org

2007 Mar 19, 1:23A site dedicated to creating a tool for leaking documents in an uncensorable fashion.PermalinkCommentswiki politics censorship government privacy security crypto cryptography

Articles / Classic Texts in Computer Science

2007 Feb 25, 2:46Classic articles and texts on Computer Science.PermalinkCommentsbooks article algorithm documentation csc

XPointer Framework

2007 Feb 22, 10:44The standard for URI fragments for identifying portions of an XML document. I've been looking for this...PermalinkCommentsxml xpointer w3c specification standards xpath uri fragment

URI Fragment Identifiers for the text/plain Media Type (draft-wilde-text-fragment-06)

2007 Feb 22, 10:15Draft document that would update text/plain to allow for fragments identifying portions of the document.PermalinkCommentsmime uri fragment text-plain rfc ietf reference standard

CreateUri (MSDN)

2007 Feb 20, 11:41Documentation for one of the main functions I worked on in IE7.PermalinkCommentsme projects professional createuri iuri msdn microsoft api help documentation reference internet web uri urlmon

Java Platform SE 6 - JavaDocs

2007 Feb 9, 1:12Documentation on Java 6PermalinkCommentsjava API development documentation help javadoc programming reference sun standard quickreference

Java 2 Platform SE v1.4.2 - JavaDocs

2007 Feb 8, 10:43Sun's online Java documentationPermalinkCommentsjava api programming javadoc reference documentation development sun
Older EntriesNewer Entries Creative Commons License Some rights reserved.