Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / February 2007

Tip: Looking for answers? Try searching our database.

xsf and white spaces

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
esebastian@esolutionsgroup.ca - 20 Feb 2007 20:16 GMT
hello everyone,
I have kind of a wierd problem. I created a utility that will allow
the user to make an update inside the manifest.xsf file, the user
selects an xsn file, the program unpackages it, makes the change to
the manifest.xsf file and repackages the contents back to an xsn file.
Here is my problem.
I try and open the xsn file and i get errors because there are now
white spaces that the DTD file is complaining about. So if a child
node within the xsf originally looks like:

<ChildNode attribute="1"></ChildNode>

it nows looks like

<ChildNode attribute="1">   </ChildNode>

and it complains because the schema doesn't recognize the format.

how on earth can i prevent those white spaces being added to the xml??
here is the code i use to open the xsf, make changes and then save it
back.

xDoc.Load(path + MANIFEST_FILE);
XmlNodeList nodeList = xDoc.GetElementsByTagName("xsf:adoAdapter");

for (int i = 0; i < nodeList.Count; i++)
{
nodeList[i].Attributes.GetNamedItem("connectionString").InnerText =
this.txtConnectionString.Text;
}

xDoc.Save(path + MANIFEST_FILE);

thanks
esebastian@esolutionsgroup.ca - 21 Feb 2007 14:19 GMT
this is what i did to solve this problem

xDoc.PreserveWhitespace = true;
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.