Esempio n. 1
0
		public override void PopulateTree (Tree tree)
		{
			XPathNavigator n = new XPathDocument (Path.Combine (basedir, "toc.xml")).CreateNavigator ();
			n.MoveToRoot ();
			n.MoveToFirstChild ();
			PopulateNode (n.SelectChildren ("node", ""), tree.RootNode);
		}
 /// <summary>
 /// Merges the XML.
 /// </summary>
 /// <param name="system">The system.</param>
 /// <param name="xml1">The XML1.</param>
 /// <param name="xml2">The XML2.</param>
 /// <returns></returns>
 public static string MergeXml(this IFilePathResolver system, string xml1, string xml2){
     if(xml1.noContent()||xml2.noContent()) return xml1.noContent() ? xml2 : xml1;
     var args = new XsltArgumentList();
     var src = new XPathDocument(new StringReader(xml2)).CreateNavigator();
     src.MoveToRoot();
     args.AddParam("src", String.Empty, src);
     var result = system.XsltTransform(".xmerge.xslt", xml1, args);
     result = Regex.Replace(result, @"</?m:\w+[^\>]*?>", String.Empty, RegexOptions.Compiled);
     return result;
 }