次のxml文字列を解析しようとしています:
<qn:QueryNotification xmlns:qn="http://schemas.microsoft.com/SQL/Notifications/QueryNotification" id="307" type="change" source="data" info="insert" database_id="6" sid="0x010500000000000515000000AEA63BDE2DE94B9FF38541A8CD1A0000">
<qn:Message>Custom</qn:Message>
</qn:QueryNotification>
次の方法で XmlReader を使用しています。
using (XmlReader xmlReader = XmlReader.Create(new StringReader(z)))
{
xmlReader.Read();
}
Read() が実行されると、次の例外が発生します。
XmlException: ルート レベルのデータが無効です。行 1、位置 40。
各タグの前に qn: が好きではないと思います。このドキュメントを解析するように XmlReader を設定するにはどうすればよいですか?