コンテンツへスキップ
ものがたり
戻る

XPathAtomicValue: all hype?

一方で、以下のコードは正しく1エラーになるので、

new XPathAtomicValue (qname, XmlTypeCode.QName).Value
System.InvalidCastException: The QName 'test' cannot be represented as a String.  

  A prefix for namespace '' cannot be found.

このクラスはセクション17に準拠している、かのように見える。

しかし、同じXmlQualifiedName型にマップされたXML Schema型にNOTATIONという過去の遺物がある。これで試してみると…

new XPathAtomicValue (qname, XmlTypeCode.Notation).Value
System.InvalidCastException: The QName 'test' cannot be represented as a String.  

  A prefix for namespace '' cannot be found.

…ダメじゃん(こっちは正しくxs:stringに変換してくれないとおかしい)。

Footnotes

  1. と言えるかどうかは微妙なメッセージだが


この記事を共有:

前の記事
V801SA…
次の記事
XmlValueConverter: What For?