- Slaw - https://www.slaw.ca -

Linking to a Section in the Criminal Code

So try this: create a link to section 650 of a freely available online version of the Criminal Code. Basic law, basic task in this digital age, right?

Unless I’ve missed something obvious, which is the best sort of thing to miss, it ain’t so easy nowadays. There are two online sources of the Code: CanLII’s [1] and the Department of Justice’s [2], which are actually just one version because CanLII publishes what the DOJ provides.

But let’s start with the CanLII version. There’s the whole statute with no table of contents. And that’s it. A search within for “650,” of course, turns up all manner of mentions of that number, and wouldn’t give us a usable URL in any case.

Now the federal site. Here there is a table of contents, but unless you’re a frequent user of the Code, you’re going to have to shuffle around a bit because the TOC has no section numbers, just section heads and cut lines. Stabbing at where you think s.650 might be, will bring up any old section, and if you’re persistent you’ll see that at the bottom of the “any old” page there’s a drop-down list that offers you links to groups of sections by number. So we “Go to…” “573 … 672”. Scroll down to s.650. Now what?

Well, there’s no help from the location bar of your browser, obviously, because it reads: “http://laws.justice.gc.ca/eng/C-46/page-3.html”. But if you’re adventurous, you’ll see that the number and the cutline above it are hyperlinks — to the version of the target section in the other language. Undaunted, you press on: click the number link to the French (in my case); once there, click the number link back to the English, and voila! Section 650 sits proudly at the top of my browser window, and I purloin the URL from the location bar.

Perhaps there was an easier way. Back you go to the federal beginning, where you notice a link to something helpfully identified as a “Frames View.” This takes you to a truly tempting screen, with the table of contents and section numbers in the left frame and the Code itself in the right frame. Section 650 isn’t listed — only the principal sections are listed — but this is getting closer, you think. Perhaps either of the links to ss. 645 or 655 will do, so you right click them and copy the link — only to find that you’ve wound up with this: javascript:doLink(‘bo-ga:l_XX-gb:s_645’) Ah! Frames and Javascript, the combo from hell. Clicking on 645 does in fact take you to section 645 in the main frame, but the location bar still happily announces the ineffectual “FramesView.html”, so you try the “other official language dipsy-doodle” I described above, only to find that it fails miserably in Frames View, producing a URL that does nothing but take you to the swathe of Code in which s.650 is buried.

This is nonsense. Does it need to be pointed out to the people who publish our laws that documents are constructed and now shared in digital form, with the consequence that pinpoint citation demands hyperlinks to the very section of the Code under discussion?

Granted, CanLII operates under the handicap of having to make do with what it’s given. So the burden falls, as it should, on the federal government. There is probably a good reason why frames and Javascript are used — it might assist in updating the online version somehow. But there’s no reason not to have a simple list of section numbers that are hyperlinked to the very sections for the convenience of researchers.

CanLII — and, indeed, everyone who publishes statutes and caselaw — should add paragraph links automatically to every paragraph of the document. It’s not technically difficult and it needn’t be obtrusive: a hash mark link text, for example, can be made to appear only when you mouse over the end of a paragraph. This would enable us, where no tables of contents exist, to link directly to the appropriate point within a document.

(And while I’m on this topic, let me say that it’s time for the courts to hyperlink the references in their judgments. It hasn’t been a big deal to create digital text for decades now, so the laurels are getting a bit crushed. Time to catch up.)

Because the difficulty of getting a URL for a Criminal Code section struck me as silly, I’ve taken the un-numbered federal TOC and added section numbers to it. It’s not perfect because it doesn’t have all of the section numbers, but I have simplified the URLs and outlined the fairly easy method of modifying them so as to get your target link easily. I’ve put this on a page in Slaw [3], where you’ll also find a link to a PDF file of the table suitable for downloading. I’ve no idea how long this hack will be effective; a change in the Code structure may make parts of this unworkable. But I hope that things can be properly mended by the powers that be before that happens.