Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Creating a schema using the Word Content Control Toolkit

From: Word 2010: Forms in Depth

Video: Creating a schema using the Word Content Control Toolkit

I've created a special version of our Letter of Agreement template that has some markup on it so that we can take a look and see what we're doing here. I'm going to slide into the Developer tab and switch into Design mode so that you can see that I actually have at the top the content controls that I'd used to capture dates, the legal name, the computer short name, and so on. But each of these appears only once in this template. Well I want to repeat for example the company short name, I've simply highlighted that in yellow and there are many places that company name will appear in this document.

Creating a schema using the Word Content Control Toolkit

I've created a special version of our Letter of Agreement template that has some markup on it so that we can take a look and see what we're doing here. I'm going to slide into the Developer tab and switch into Design mode so that you can see that I actually have at the top the content controls that I'd used to capture dates, the legal name, the computer short name, and so on. But each of these appears only once in this template. Well I want to repeat for example the company short name, I've simply highlighted that in yellow and there are many places that company name will appear in this document.

Likewise, I have a servicetype that's in here, but once I've selected this once, I want it to repeat here, here, and here in the document. So again, here's my template all ready to go with one set of content controls in it. No content control is repeated and for my ease-of-use I've marked this document up using the Highlight tool, but you don't have to. If you're working with an existing letter of agreement or contract, you probably have one that already has the short name of the company every place else.

Simply go in and the first time it occurs, replace it with your content control so someone can enter the short name for the company and you're in the same place I am, all ready to go. So I'm going to make sure that we save this template. I'm going to close it and I'm ready to create my schema. So I'm going to open the Word 2007 Content Control Toolkit and I'm going to open my template. Make sure I'm not opening the document here. I'm actually opening the template. Now the Content Control Toolkit goes and looks for all of the different content controls and says okay, this is what they look like.

It list them here on the left. On the right, it allows me to create a schema. Before we jump in and create this, I actually want to provide some information on how schemas are organized so you can think about this. There are different kinds of data here. I have legal name and company short name that I'm collecting from the user. Those are both attributes of the company. While servicetype, service startdate, Servicecity and so on are more attributes of the encounter or the actual service that's been provided.

We can organize those instead of having a flat list of all of our data like they have here. We should actually organize this so that our data looks easier to understand and to show that some kinds of data here are related to each other. That brings us to the concept of how schemas are organized for XML files. Here are the fields that we have and again, we could simply say I've got a legal name, I've got a company short name, and so on. But we know that they are in fact, rolled up into larger containers.

We don't have any content control for companyinfo and yet we can infer that it exists. We don't have a container for serviceprovided and yet because all of these items are services, servicetype, startdate, and Servicecity, we can infer that they exist. And always within an XML schema we will have at the top one large container holding it all called the root. Each of these items is called the node. This is the root node. We have the companyinfo node, the serviceprovided, the legalname node and so on.

That's just language about how schemas are organized. First, we'll click Create a new Custom XML Part and then we'll switch to Edit view. Now here's that root container. We can't do without it, and we need to create all the containers that lie underneath it. So I'll start by saying that I have a submit date. This is this tag over here. I'm going to get to match or map each item I put here, each node, with a particular tag over here belonging to a content control.

Therefore I don't have to use the same text, but it's easy if I do. In markup language like HTML or XML, we begin by typing the less than sign, then the name, and then we close it. That actually opens up the tag and we can put things in here then if we wanted to. Or we can say I'm actually done with this tag and we can close it. We close it by typing the less than again, and a forward slash and using exactly the same name and closing it again.

So now we have a start and an end tag. Now when we look at this, if I put anything between them, I'm actually putting in a default value. So in some controls for example, I might type something like today's date. In the date picker I'm not going to see much, but let's roll that back to the point where I've just closed this, okay. Now I'm going to put in the second set of fields. I'm going to go ahead and open up the tag and remember that we had companyinfo.

It's not a field that we have, but it's a grouping. It's a node. So there's my companyinfo starting tag, and now I'm going to start adding the legalname of the company and then I can close this off with another legalname. Close tag. If I put any information in here, it will actually serve as a default value or as a placeholder. Now my content controls that I have in Word have placeholders. But I will tell you that they're not going to show up once we've created this schema.

One of the unfortunate consequences of using the schema is that our placeholders are going to be overwritten and we won't be able to get them back. So it's not a bad idea to go in here and to say Enter legal name of company, or to say Enter form submit date. So there's our legalname, start tag, end tag.

Next, I have the company short name and if I don't want to use the tab, if I'm way over here on the right, I could just as easily hit the Spacebar once or twice as the Tab key once or twice. So this is the company short name, but I don't have to give it that full thing. I can just say shortname and I can say Enter short name. This will directly follow on Enter legal name of company, so folks will probably figure it out. Now as I'm doing this, I want to make sure that however I spell shortname here.

I spell it exactly the same way here. I'm going to make a mistake so that you can see it later on and I'm going to go on and enter the opening tag for info about the service. So I have things like servicetype. Or it's actually a drop-down list. I could say Choose service type and then close it off.

Now I have startdate. Now I can cut, copy, and paste in here if I wish. So if I want to just copy this and use it again in a second that's a fine thing to do. I can select it that way or I can double- click, but that will leave the tags out. So I'm just going to grab this, hang on to it for a second, okay, and then I can paste it back in and that makes it very easy for me simply to go in here and to drop the closed tag in. I also have fields like servicecity, enddate, trainingcenter.

That's another drop-down list. I am going to make another mistake here, so that we have something else to look at when we're done. I have a materials list and so on. So I'm going to paste all of the rest of this when we're done, but right now I'm going to go ahead and I'm going to check my syntax to make sure that this is all okay. And first it says, "The 'servicetype' start tag on line 7 does not match the end tag of 'serviceinfo' at position 37." So it says, the servicetype start tag in line 7.

1, 2, 3, 4, 5, 6, 7, and it says you've get a problem somewhere in here. Now it's pointing to servicetype and that's because down here I type serviceinfo. So this needs to say servicetype instead. And you begin to see why you would bother to check this. So let's check it again now and it says the traincenter start tag on line 11 does not match what you put here at the end, the end tag, all right.

I only put two more mistakes in here, so let's check in again. Now it says the serviceinfo start tag here does not match up with root. Oh my, look it. I never closed this group off. We knew that at the time. So I am going to go back and close the serviceinfo container. That's up here and one more. I never closed the companyinfo node either. So let's go put a close tag on for companyinfo.

Make sure always that you check. It's easy to type something incorrectly. It's easy to miss closing a node. Now there are no syntax errors found. So we know that this is just fine to use. If you haven't exported this to an XML document, you might want to do that. particularly if you need to stop at this point, I'm going to keep on going in the next movie, and we're going to bind each of our nodes back here to our content controls. But if you close the Word 2007 Content Control Toolkit before you do your binding, then you'll have to be able to load the XML file again.

See you in the next movie!

Show transcript

This video is part of

Image for Word 2010: Forms in Depth
Word 2010: Forms in Depth

28 video lessons · 13337 viewers

Gini Courter
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Word 2010: Forms in Depth.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.