internal void CompileSingleTemplate(Compiler compiler) {
NavigatorInput input = compiler.Input;
//
// find mandatory version attribute and launch compilation of single template
//
string version = null;
if (input.MoveToFirstAttribute()) {
do {
string nspace = input.NamespaceURI;
string name = input.LocalName;
if (Keywords.Equals(nspace, input.Atoms.XsltNamespace) &&
Keywords.Equals(name, input.Atoms.Version)) {
version = input.Value;
}
}
while(input.MoveToNextAttribute());
input.ToParent();
}
if (version == null) {
if (Keywords.Equals(input.LocalName, input.Atoms.Stylesheet) &&
input.NamespaceURI == Keywords.s_WdXslNamespace) {
throw XsltException.Create(Res.Xslt_WdXslNamespace);
}
throw XsltException.Create(Res.Xslt_WrongStylesheetElement);
}
compiler.AddTemplate(compiler.CreateSingleTemplateAction());
}