public void ElementHasNoAttributes() { XmlElement element = doc.CreateElement("File", WixNamespaceManager.Namespace); WixXmlAttributeCollection attributes = schema.GetAttributes(element); Assert.IsTrue(attributes.Count > 0); Assert.IsTrue(Object.ReferenceEquals(attributes[0].Document, doc)); }
public void Init() { doc = new WixDocument(); doc.FileName = @"C:\Projects\Setup\Files.wxs"; doc.LoadXml(GetWixXml()); XmlElement productElement = doc.GetProduct(); WixXmlAttributeCollection attributes = wixSchema.GetAttributes(productElement); productIdAttribute = attributes["Id"]; productUpgradeCodeAttribute = attributes["UpgradeCode"]; XmlElement componentElement = (XmlElement)doc.SelectSingleNode("//w:Component", new WixNamespaceManager(doc.NameTable)); attributes = wixSchema.GetAttributes(componentElement); componentGuidAttribute = attributes["Guid"]; componentKeyPathAttribute = attributes["KeyPath"]; XmlElement fileElement = (XmlElement)doc.SelectSingleNode("//w:File", new WixNamespaceManager(doc.NameTable)); attributes = wixSchema.GetAttributes(fileElement); fileSourceAttribute = attributes["Source"]; fileSrcAttribute = attributes["src"]; }