# XML/XSLT for MS Word Content Control



## Spartz (Jun 7, 2011)

Hello!

I originally posted this under the "Business Applications" board, but I thought I might post it here as well in hopes of finding some XML expertise. I'm struggling in Word 2007, trying to make a form for a Notice (legal document). I'm trying to make it fast and easy to use by limiting user input to typing in the Defendant's name, court case number, and selecting the county from a drop-down list. Using this method with the Content Control Toolkit, I've been able to make the name and case# fields update automatically when any of them are edited (across a few pages).

The problem is that each county is in a different judicial circuit (which are numbered First through Twentieth), and have their own State Attorney's office. Ideally, I would like to have the Judicial Circuit number and State Attorney's address update to reflect the County I selected from the drop-down list.

I thought I was onto something when I found this, because all of the modifications made in Word 2007 Content Control Toolkit are called "Custom XML Parts". I'm HTML savvy, but have yet to stray into XML, so I'm lost when it comes to syntax and all.

Basically, I want to use some sort of conditional statements to make each selection from the drop-down list update fields with specific information, but I'm unsure of how to merge the XML/XSL with the Custom XML Parts in Content Control Toolkit.

The document I'm working with:









The Custom XML Part associated with this document:


> <root>
> <name>CLIENT NAME</name>
> <County>LAKE</County>
> <circuit>FIFTH</circuit>
> ...


The XML I'm trying to add:


> <xsl:choose>
> <xsl:when test="@County = Lake">
> FIFTH
> </xsl:when>
> ...


I may be way off with the whole XML thing, but any input you have will be greatly appreciated and very helpful. I'm open to different ideas if you know how to do this without the code. 

Thank you!


----------

