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 (Ref.Equal(nspace, input.Atoms.UriXsl) &&
Ref.Equal(name, input.Atoms.Version))
{
version = input.Value;
}
}while (input.MoveToNextAttribute());
input.ToParent();
}
if (version == null)
{
if (Ref.Equal(input.LocalName, input.Atoms.Stylesheet) &&
input.NamespaceURI == XmlReservedNs.NsWdXsl)
{
throw XsltException.Create(SR.Xslt_WdXslNamespace);
}
throw XsltException.Create(SR.Xslt_WrongStylesheetElement);
}
compiler.AddTemplate(compiler.CreateSingleTemplateAction());
}