特定のテキストで始まらない属性値を持つすべての要素を削除しようとしています
Jon Skeetのおかげで最初の部分を取得しましたが、一部の要素にこの属性が含まれていないため、NullReferenceExpection
「オブジェクト参照がオブジェクトのインスタンスに設定されていません」というメッセージが表示されました。
null値のチェックを追加しましたが、それでも機能しませんか?
elements =(from el in xmlFile.Root.Elements(elementName)
where ( !el.Attribute(attributeName).Value.Equals(DBNull.Value)
&& !el.Attribute(attributeName).Value.StartsWith(searchBeforeStar))
select el);