XmlElementPath GetElementPath() { return(XmlElementPath.Resolve( GetCurrentPath(), defaultSchemaCompletionData != null? defaultSchemaCompletionData.NamespaceUri : null, defaultNamespacePrefix ?? "" )); }
public void AssertParentPath(string doc, params QualifiedName[] qualifiedNames) { TestXmlParser.AssertState(doc, p => Assert.AreEqual( new XmlElementPath(qualifiedNames), XmlElementPath.Resolve(p.Nodes.ToArray()) ) );; }
static void AssertElementPath(string text, params QualifiedName[] qualifiedNames) { TestXmlParser.AssertState(text, p => { var arr = p.Nodes.ToArray(); Array.Reverse(arr); Assert.AreEqual( new XmlElementPath(qualifiedNames), XmlElementPath.Resolve(arr) ); }); }
public static void AssertPath(this XNode node, params QualifiedName[] qualifiedNames) { var path = new List <XNode> (); while (node != null) { path.Add(node); node = node.Parent as XNode; } path.Reverse(); Assert.AreEqual( new XmlElementPath(qualifiedNames), XmlElementPath.Resolve(path.ToArray()) ); }