How to edit the DOM of the main data source? - InfoPath Dev
in

InfoPath Dev

How to edit the DOM of the main data source?

Last post 08-25-2006 10:23 AM by Greg Collins. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 08-22-2006 09:11 AM

    How to edit the DOM of the main data source?

    According the help, DOM can be edited by function removeChild() etc.
    While the GetDOM() of XDocument object applies to the data objects which means that only DOM of secondary data source can be got by this funtion, and DOM property of XDocument object is read-only, how can I edit (mainly remove some nodes) the DOM of the main data source and get the view of the form refreshed accordingly?

    Thanks!
  • 08-22-2006 12:30 PM In reply to

    Re: How to edit the DOM of the main data source?

    DOM is not readonly. You can get the nodes from DOM and modify values of those nodes.
  • 08-22-2006 04:04 PM In reply to

    Re: How to edit the DOM of the main data source?

    The main DOM might be read-only in specific situations (like during OnBeforeChange or OnValidate events), but in general it is not read-only as Agni says.
  • 08-23-2006 01:08 AM In reply to

    Re: How to edit the DOM of the main data source?

    Hi,

    What I want is not to modify values of the nodes, but to remove some nodes of the DOM of the main data source, is it possible?

    Thanks!
  • 08-23-2006 09:31 AM In reply to

    Re: How to edit the DOM of the main data source?

    It is possible if the nodes are set to have minOccurs="0" in the schema. If that is not the case then you will not be able to remove them. If it is the case you should be able to remove them using code.
  • 08-24-2006 12:14 AM In reply to

    Re: How to edit the DOM of the main data source?

    Hi Greg,

    I looked through the InfoPath SDK document as well as InfoPath help document, but didn't get any solution.
    According to the document, DOM of the secondary data source can be got and thus nodes can be remove by the function "removeChild()".
    But if we get the DOM of the main data source by "XDocument.DOM", it is read-only, which means nodes of the DOM can't be removed.

    If I am not on the right way, would you be so kind enough to show me how to get the nodes of the DOM of the main data source removed?

    Many thanks!

    quote:
    Originally posted by Greg Collins

    It is possible if the nodes are set to have minOccurs="0" in the schema. If that is not the case then you will not be able to remove them. If it is the case you should be able to remove them using code.

  • 08-24-2006 04:58 AM In reply to

    Re: How to edit the DOM of the main data source?

    Thanks Greg,

    The DOM of the main data source can be modified, although the document says that XDocument.DOM is a read-only attribute.

    quote:
    Originally posted by larniel

    Hi Greg,

    I looked through the InfoPath SDK document as well as InfoPath help document, but didn't get any solution.
    According to the document, DOM of the secondary data source can be got and thus nodes can be remove by the function "removeChild()".
    But if we get the DOM of the main data source by "XDocument.DOM", it is read-only, which means nodes of the DOM can't be removed.

    If I am not on the right way, would you be so kind enough to show me how to get the nodes of the DOM of the main data source removed?

    Many thanks!

    quote:
    Originally posted by Greg Collins

    It is possible if the nodes are set to have minOccurs="0" in the schema. If that is not the case then you will not be able to remove them. If it is the case you should be able to remove them using code.



  • 08-25-2006 10:23 AM In reply to

    Re: How to edit the DOM of the main data source?

    Yes the DOM property itself is read-only... but the actual nodes you select beneath the DOM are not read-only. Subtle difference.

    Glad you got it worked out!
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.