Last post Jul 29, 2011 05:13 AM by Decker Dong - MSFT
Jul 27, 2011 11:42 AM|soerenkbhg|LINK
Hi, I write a script to modify sections in configurationfiles and these must remain readable. I use a copy construct and matches sections that need to be replaced. The sections that are simply copied are expanded. For instance:
<SQLServerConnections externalFile="SqlServerConnection.config" />
This is a major issue, can it be fixed?
Jul 28, 2011 10:01 PM|Decker Dong - MSFT|LINK
Which tool are you using? How are you copying?
I think it does no matter with the copying and the application. Because the 2nd one is just the complete form of the 1st one. And 1st is the simplist.
However, if you have values between the pair of tags, you cannot do with 1st.
Jul 29, 2011 04:53 AM|soerenkbhg|LINK
Hi Decker, Late last night I finally gave up on XSLT and started building a tool that uses XPath and my own XML to designate what to replace. I havent reach to the point where I write my DOM tree back to a file (C#), but if you have any input regarding to
how to control that DOM writes tags as closed as explained above I am all ears :)
I am sorry for having inconvinienced you.
Jul 29, 2011 05:13 AM|Decker Dong - MSFT|LINK
Not very sure about DOM TREE, but I think you can have a try, this works very well on me.
XmlDocument doc = new XmlDocument();
XmlElement e = doc.CreateElement("JBase");
XmlAttribute a = doc.CreateAttribute("externalFile");
a.Value = "JBase.config";