XElement.Parse NotSuportedException

时间:2010-07-16 13:58:00

标签: c# xml exception linq-to-xml

当我用XElement解析以下字符串时,我得到一个NotSupportedException:

<ref>S. L. Vartanyan*, V. E. Garutt† & A. V. Sher‡parallel, "Holocene dwarf mammoths from Wrangel Island in the Siberian Arctic", Nature 362, 337&nbsp;– 340 (25 March 1993) [http://www.nature.com/nature/journal/v362/n6418/abs/362337a0.html Nature.com]</ref>

有谁知道我为什么会收到这个错误?

1 个答案:

答案 0 :(得分:1)

可能是&nbsp; - 这不是xml实体,除非你是html,&应该是&amp;

基本上,这不是xml ......

这有效:

@"<ref>S. L. Vartanyan*, V. E. Garutt† &amp; A. V. Sher‡parallel, ""Holocene dwarf mammoths from Wrangel Island in the Siberian Arctic"", Nature 362, 337not-nbsp;– 340 (25 March 1993) [http://www.nature.com/nature/journal/v362/n6418/abs/362337a0.html Nature.com]</ref>");
相关问题