As I’ve mentioned before, I have worked with Bruce D’Arcus in the past, and we are once again teaming up on some more work that I’m pretty excited about. We have been trading emails over the last few weeks, and since his return from South America a week ago the email volume and overall results has been increasing and improving respectively.
This morning he shot me a ping and asked if I could look into whether or not his recently discovered reference to an APA.xsl file was, in fact, something that was accessible to the end user, and if so, what did it look like.
I hadn’t realized that MS was using XSLT inside of Word 2007, so to see this question from Bruce, as you can imagine, got me pretty excited.
As it turns out, its not just the citation stuff, as they have implemented their entire Bibliography XML processing support in XSLT.
WooHoooooooooooooooooooooooooooooooooooooooooooooooooooo!!!!!!!!!!!!!!!!!! :D
Bruce agrees:
darcusblog � Blog Archive � Citation Formatting in Word 2007
Yesterday I examined the encoding of citations and bibliographic data in Microsoft’s Open XML formats. Today I’d like to discuss another crucial piece of the puzzle, which is citation style configuration and formatting.
Examining the contents of an example document, I came across the following attribute: SelectedStyle=”\APA.XSL”. This naturally suggested to me they’re using XSLT to do the formatting. A quick ping to M. David Peterson confirmed it.
In general, this is a very good thing. They’re using a W3C standard technology in such a way that it ought to be possible to easily enhance it, or substitute alternate implementations. So if that’s all true, kudos to Microsoft!
I agree with Bruce… +1 Microsoft.
Hell, +100 Microsoft from my viewpoint :D
Now for the mentioned “Words of Wisdom”.
Not surprisingly, though, given that I have a little experience using XSLT for these purposes, I have some thoughts/observations.
The first is that bibliographic and citation formatting is pretty complicated, and fully supporting a style like APA using XSLT 1.0 is going to be really difficult. Just take a close look at the output example from citeproc for the APA style. This is hard to do even with the much more advanced capabilities of XSLT 2.0. I’d venture to say it is impossible to fully implement n XSLT 1.0 without extensions.
Even if an XSLT expert manages to program it, it will be almost impossible for even tech-savvy users to create or edit styles in any significant way. I consider my XSLT skills strong, and I find understanding how I’d modify or implement a style really difficult. The code is really complicated.
Bruce is speaking from some seriously hard core “using XSLT to write state of the art software” experience. So when he states “‘d venture to say it is impossible to fully implement n XSLT 1.0 without extensions.” I would tend to listen to his view point if I wasn’t someone who didn’t already agree with his viewpoint.
That said, when you combine the fact that MS has implemented this in XSLT, and add to this the fact that there just so happens to be existing support for XSLT 2.0 as part of the .NET platform, and furthermore add the fact that I am in the middle of writing an entire library of web Read/Write/Copy/Paste/Deploy/Message functionality using this same mentioned XSLT 2.0 support…
Well, as you can imagine… As usual, there’s a Big PHAT smile on my face.
Today, however, that Big PHAT smile is Big PHAT PHATTER.
Giddie’ up… :D


It's worth emphasizing that while I am speaking from practical experience implementing this sort of software, more importantly, I am speaking from the perespective of an end user. I was only motivated to solve the technical puzzle because frustrated with existing tools. Am really hoping to avoid MS making some of the same mistakes.
You write there is "existing support for XSLT 2.0 as part of the .NET platform," but your link is to a third party open source product that is not part of the .NET platform at all. Also, how, from inside Office 2007, do you select to use a third-party XSLT engine?
@Rick > "existing support for XSLT 2.0 as part of the .NET platform,"
Yikes! I completely misphrased that. For what I assume is an obvious reason (I developed the Saxon.NET project before handing it over to Dr. Kay who has since designed and integrated the existing JAXP-influenced native .NET API and is now releasing this side-by-side with the native Java product) I have come to think of Saxon.NET (now Saxon on .NET) as part of the .NET platform given thats its been a part of my personal toolset for 2 years now. Thats actually not was caused the slip-up... I didn't mean to imply it was actually a part of the MS-blessed .NET platform... just poor selection of words.
Regarding the usage of a third-party transformation engine. No, there are no hooks that I am aware of... But -
a) With the Open XML format, The XML internals are available to edit, update, etc...
b) Writing an extension and adding this to the ribbon is mind-numbingly simple.
c) a + b = third-party extension to process the XML is in the works. Need to finish out my current task list first, but this is then next.
Of course, the ability for this to happen transparently via a native interface would obviously be the preference. But maybe its not to late?
I'll see what I can find out :D
By the way... Been spending some quality time with Schematron as of late...
I've only dabbled with it before, but a conversation with Uche about 2 months back convinced me it was time to start digging in to see what I was missing.
If posssible, can you please add me to the list of official converts? (if such a list exist :D)
Actually, what I've really come to discover is that Schematron fills a rules processing space that XML Schema nor RelaxNG can even come close to, where as XML Schema pretty much owns the object serialization space for OOP-based Web Services.
RelaxNG is obviously a much cleaner, simpler notation, but I don't think XML Schema is going to be dethroned from the Web Services space anytime soon.
Thoughts?
@Bruce > "Am really hoping to avoid MS making some of the same mistakes."
Obviously theres no one better to tell the story, so if anybody can pursuade the MS Office insiders not to make the same mistakes, its obviously you.
Let's hope that the current "signs of life" are in fact just that! :D