private static XElement ResolveImportedTagElement(GraphBuildContext context, XDocument doc, string target) { var imports = from importElement in doc.Descendants("import") select SafeAttribute(importElement, "file"); foreach (var imported in imports) { XElement found = ResolveTargetElement(context, imported, target); if (found != null) { return found; } } context.AddUnresolvedTarget(target); return UnresolvedTargetElement(target); }
private static XElement ResolveTargetElement(GraphBuildContext context, string resource, string target) { if (!context.Repository.Contains(resource)) { context.AddUnresolvedTarget(target, resource); return UnresolvedTargetElement(target); } var importedDoc = XDocument.Load(context.Repository[resource]); context.RegisterScript(context.Repository.AbsolutePath(resource)); return ResolveTargetElement(context, importedDoc, target); }