what is the difference between ".InnerXml" and ".Value"? - InfoPath Dev
in

InfoPath Dev

what is the difference between ".InnerXml" and ".Value"?

Last post 07-12-2009 01:52 PM by gerry lowry. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-11-2009 10:29 AM

    • gerry lowry
    • Not Ranked
      Male
    • Joined on 07-09-2009
    • alliston ontario canada
    • Posts 21

    what is the difference between ".InnerXml" and ".Value"?

    MessageBox.Show(myGclassLicence.InnerXml);

    MessageBox.Show(myGclassLicence.Value);

    Both of the above statements display       false
    for an unchecked checkbox,     and       true
    for a checked checkbox.

    Is there any difference between ".InnerXml" and ".Value" for a selected single node?

    (I'm guessing the answer is that there is no difference for a selected single node).

    Also, is there any difference ever, between ".InnerXml" and ".Value"?

     

    Thank you.

    Regards,
    Gerry (Lowry)

     

     

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · [email protected]
  • 07-11-2009 05:45 PM In reply to

    Re: what is the difference between ".InnerXml" and ".Value"?

    gerry lowry:
    Also, is there any difference ever, between ".InnerXml" and ".Value"?
     

    Sure is.  For XML elements, Value contains all the ordinary text between a node's starting and ending tag, and InnerXml contains everything between a node's starting and ending tag.

    So if I have an XPathNavigator positioned at this node:

    <my:group2 my:field4="Hi">
        <my:field1>Hello</my:field1>
        <my:field2 my:field5="yay">Goodbye</my:field2>
        <my:field3></my:field3>
    </my:group2>

     InnerXml would be:

                <my:field1>Hello</my:field1>
                <my:field2 my:field5="yay">Goodbye</my:field2>
                <my:field3></my:field3>
           

    And Value would be:


                Hello
                Goodbye
               
    For leaf nodes, InnerXml and Value should typically be the same, but I'd suggest using Value for getting a node's value as that's what it's intended for.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 07-12-2009 01:52 PM In reply to

    • gerry lowry
    • Not Ranked
      Male
    • Joined on 07-09-2009
    • alliston ontario canada
    • Posts 21

    Re: what is the difference between ".InnerXml" and ".Value"?

    Thank you, Jimmy.  I will follow your advice and use .Value as per your suggestion.

    I do appreciate your help.

     

    Regards,
    Gerry

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · [email protected]
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.