首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Nodes.Current.SetValue(“.”)侥幸?

Nodes.Current.SetValue(“.”)侥幸?
EN

Stack Overflow用户
提问于 2011-04-18 23:28:22
回答 1查看 260关注 0票数 0
代码语言:javascript
复制
XPathNodeIterator nodes = nav.Select("//d:page/d:field/d:value", nsmgr);

...do stuff..

nodes.MoveNext();
nodes.Current.SetValue(i.ToString()); //<-HERE!
nodes.MoveNext();
nodes.Current.SetValue(numPages.ToString());

..do more stuff...

我在这个程序中多次使用nodes.Current.SetValue()函数,它只是在这个实例中(每次针对这个节点)才不想工作。有了断点,它将显示该节点的innerXML像它应该的那样反映i。之后,打印就不起作用了。特别是在保存导航流之前,我重新选择了该节点,但仍然什么也没有。(实际上,这并不是什么。它似乎是空格,甚至可能是行提要。我不知道为什么在这种情况下它不起作用。下面是这两个节点的有针对性的XML。

代码语言:javascript
复制
<field sid="PAGE">
      <itemlocation>
        <ae>
          <ae>absolute</ae>
          <ae>1051</ae>
          <ae>899</ae>
        </ae>
        <ae>
          <ae>extent</ae>
          <ae>47</ae>
          <ae>24</ae>
        </ae>
      </itemlocation>
      <value>
      </value>
      <borderwidth>0</borderwidth>
      <fontinfo>
        <ae>Times New Roman</ae>
        <ae>10</ae>
        <ae>plain</ae>
      </fontinfo>
      <justify>center</justify>
      <scrollhoriz>wordwrap</scrollhoriz>
      <scrollvert>fixed</scrollvert>
      <format>
        <ae>string</ae>
        <ae>optional</ae>
      </format>
      <next>OFPG</next>
      <previous>QTYFA_15</previous>
      <acclabel>asterisk.  when used as a.
hand receipt, enter hand receipt annex number.
hand receipt for quarters furniture, enter condition codes.
hand receipt annex or components receipt, enter accounting requirements code, ay r c.
enter page number.</acclabel>
    </field>
    <field sid="OFPG">
      <itemlocation>
        <ae>
          <ae>absolute</ae>
          <ae>1129</ae>
          <ae>899</ae>
        </ae>
        <ae>
          <ae>extent</ae>
          <ae>35</ae>
          <ae>24</ae>
        </ae>
      </itemlocation>
      <value>4</value>
      <borderwidth>0</borderwidth>
      <fontinfo>
        <ae>Times New Roman</ae>
        <ae>10</ae>
        <ae>plain</ae>
      </fontinfo>
      <justify>center</justify>
      <scrollhoriz>wordwrap</scrollhoriz>
      <scrollvert>fixed</scrollvert>
      <format>
        <ae>string</ae>
        <ae>optional</ae>
      </format>
      <previous>PAGE</previous>
      <next>NEXT_BUTTON</next>
      <acclabel>enter total number of pages.</acclabel>
    </field>

我很困惑为什么这不管用..。有人有什么想法吗?

编辑:更多信息:我更改了XMLDocument以保留空白。这似乎修复了它输出空格和/或行提要,但它的值仍然丢失。

EN

回答 1

Stack Overflow用户

发布于 2011-04-19 17:55:47

它不是对您发布的两个节点都有效,还是只对其中一个节点起作用?(如果是,它在为哪一个工作,哪一个不工作?)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5709988

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档