<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Add an attribute</title><link>https://www.infopathdev.com:443/forums/thread/13546.aspx</link><pubDate>Thu, 08 Sep 2005 06:41:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13546</guid><dc:creator>Coita Thierry</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13546.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13546</wfw:commentRss><description>The namespaces are greats in xml he gives a lot of advantage and the flexibility! But It's very hard to manage it without making some errors...&lt;br /&gt;&lt;br /&gt;Every moment hesitated is a moment gone for life!!! Think about it</description></item><item><title>Re: Add an attribute</title><link>https://www.infopathdev.com:443/forums/thread/13545.aspx</link><pubDate>Wed, 07 Sep 2005 08:12:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13545</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13545.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13545</wfw:commentRss><description>Sorry Thierry for not responding sooner, but looks like you found and fixed your problem. The namespace issue is something that everyone hits at least once!&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: Add an attribute</title><link>https://www.infopathdev.com:443/forums/thread/13544.aspx</link><pubDate>Tue, 06 Sep 2005 12:53:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13544</guid><dc:creator>Coita Thierry</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13544.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13544</wfw:commentRss><description>I have found! It's easy no namespace no declaration:&lt;br /&gt;&lt;br /&gt;IXMLDOMElement oElement = (IXMLDOMElement)NewMut;	&lt;br /&gt;IXMLDOMAttribute Aenderung = (IXMLDOMAttribute)NewMut.&lt;br /&gt;ownerDocument.createNode((int)DOMNodeType.NODE_ATTRIBUTE, "Aenderung", "");&lt;br /&gt;Aenderung.text = "1";&lt;br /&gt;oElement.setAttributeNode(Aenderung);&lt;br /&gt;&lt;br /&gt;++&lt;br /&gt;&lt;br /&gt;Thierry&lt;br /&gt;&lt;br /&gt;Every moment hesitated is a moment gone for life!!! Think about it</description></item><item><title>Add an attribute</title><link>https://www.infopathdev.com:443/forums/thread/12556.aspx</link><pubDate>Mon, 05 Sep 2005 14:40:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12556</guid><dc:creator>Coita Thierry</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12556.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12556</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I have read this topic:&lt;br /&gt;&lt;br /&gt;&lt;a href='http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=313' target='_blank' title='http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=313'&lt;a target="_blank" href=http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=313&gt;http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=313&lt;/a&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I want to add a attribute optionnal but define by my custom schema!&lt;br /&gt;&lt;br /&gt;My Code:&lt;br /&gt;&lt;pre&gt;IXMLDOMElement oElement = (IXMLDOMElement)NewMut;	&lt;br /&gt;IXMLDOMAttribute Aenderung = (IXMLDOMAttribute)NewMut.ownerDocument.createNode((int)DOMNodeType.NODE_ATTRIBUTE, "Aenderung", "http://zefix.powernet.ch/Schema/HRG.xsd");&lt;br /&gt;Aenderung.text = "1";&lt;br /&gt;oElement.setAttributeNode(Aenderung);&lt;/pre&gt;&lt;br /&gt;But he say that is not declared to in the namespace:&lt;br /&gt;&lt;blockquote id="quote"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica" id="quote"&gt;quote:&lt;hr height="1" noshade id="quote"&gt;System.Runtime.InteropServices.COMException&lt;br /&gt;The attribute '&lt;a target="_blank" href=http://zefix.powernet.ch/Schema/HRG.xsd}Aenderung'&gt;http://zefix.powernet.ch/Schema/HRG.xsd}Aenderung'&lt;/a&gt; on the element 'Person' is not defined in the DTD/Schema.&lt;br /&gt;at Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMElement.setAttributeNode(IXMLDOMAttribute DOMAttribute)&lt;br /&gt;at Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper.setAttributeNode(IXMLDOMAttribute attribute)&lt;br /&gt;at Microsoft.Office.Interop.InfoPath.SemiTrust.DOMNodeWrapper.setAttributeNode(IXMLDOMAttribute attribute)&lt;br /&gt;at Req2.Req2.MutPers_OnClick(DocActionEvent e) in c:\documents and settings\tc\bureau\st gallen\visual studio projects\req2\formcode.cs:line 144&lt;br /&gt;at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)&lt;br /&gt;&lt;hr height="1" noshade id="quote"&gt;&lt;/font id="quote"&gt;&lt;/blockquote id="quote"&gt;&lt;br /&gt;In my schema there are an Aenderung attribute optionnal :&lt;br /&gt;&lt;br /&gt;&lt;a href='http://zefix.powernet.ch/infopath/schema.jpg' target='_blank' title='http://zefix.powernet.ch/infopath/schema.jpg'&lt;a target="_blank" href=http://zefix.powernet.ch/infopath/schema.jpg&gt;http://zefix.powernet.ch/infopath/schema.jpg&lt;/a&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So What is the namespace that I need to declare? For that work&lt;br /&gt;&lt;br /&gt;Thanks for your help!&lt;br /&gt;&lt;br /&gt;++&lt;br /&gt;&lt;br /&gt;Thierry&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Every moment hesitated is a moment gone for life!!! Think about it</description></item></channel></rss>