public QName [] ParseQNameListAttribute (string localName, string ns)
{
string s = GetAttribute (localName, ns);
- if (s == null || s == "") return null;
+ if (s == null) return null;
string [] names = s.Split (new char [] {' ', '\r', '\n', '\t'});
QName [] ret = new QName [names.Length];
string s = GetAttribute (localName, ns);
switch (s) {
- case "": return defaultVal;
+ case null: return defaultVal;
case "yes": return true;
case "no": return false;
default: throw new Exception ("invalid value for " + localName);
public string GetAttribute (string localName, string ns)
{
- return Input.GetAttribute (localName, ns);
+ if (!Input.MoveToAttribute (localName, ns))
+ return null;
+
+ string ret = Input.Value;
+ Input.MoveToParent ();
+ return ret;
}
public XslAvt ParseAvtAttribute (string localName)
{
}
public void AssertAttribute (string localName, string ns)
{
- if (Input.GetAttribute (localName, ns) == String.Empty)
+ if (Input.GetAttribute (localName, ns) == null)
throw new Exception ("Was expecting the " + localName + " attribute.");
}
public XslAvt ParseAvt (string s)
{
- if (s == null || s == string.Empty) return null;
+ if (s == null) return null;
return new XslAvt (s, this);
}
nav.NamespaceURI == (isXslt ? String.Empty : XsltNamespace))
{
foreach (string ns in nav.Value.Split (' ')) {
- if ((string)ret [ns] == nsScope.GetNamespace (ns == "#default" ? "" : ns))
- ret.Remove (ns);
+ string realNs = ns == "#default" ? "" : ns;
+
+ if ((string)ret [realNs] == nsScope.GetNamespace (realNs))
+ ret.Remove (realNs);
}
}
} while (nav.MoveToNextAttribute ());