How to generate XML Attributes - InfoPath Dev
in

InfoPath Dev

How to generate XML Attributes

Last post 11-21-2007 08:23 AM by Matt Faus. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-14-2007 06:47 AM

    • Klaad
    • Not Ranked
    • Joined on 11-14-2007
    • Posts 2

    How to generate XML Attributes

     

    I want to generate a simple XML like this:

     

    <house rooms="4">

        <price perMonth="1000" avoidable="No" />

     

    </house>

     

    Something easy like this., I can't find the way to create the attributes (the rooms="4" thing) 

     

    Is it possible to do this? If so, how do i do it?

     

    Thanks in advance

  • 11-21-2007 08:23 AM In reply to

    Re: How to generate XML Attributes

    Hi Klaad,

    It would be easier to answer this if we could see the  code you've already written.  However, in C# you will do something like this:

    IXMLDOMDocument tempDom = thisXDocument.CreateDOM();

    tempDom.LoadXml( "<hous rooms='4'><price perMonth='1000' avoidable='No'/></house>" );

    Or you can actually create the attribute nodes by calling .CreateAttribute() on the Document object.

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.