Wednesday, July 18, 2012

Simplest and easiest way to edit XML file with the help HTML editor

The XML Editor is the new editor for XML files.It can be used on a stand-alone XML file,or on a file associated with a Visual Studio project. 

The XML Editor is associated with the following file extensions:.config, .dtd,.xml,.xsd,.xdr,.xsl,.xslt,and .vssettings.The XML Editor is also associated with any other file type that has no specific editor registered,and that contains XML or DTD content. 
1.To edit an XML file:-
Double-click the file you want to edit.
To add a new XML file to a project
a.From the Project menu,select Add New Item.
b.Select XML File from the Templates pane.
c.Enter the filename in the Name field and press Add.The XML file is added to the project and opened in the XML Editor. The file contains the default XML declaration, .
2.To add an existing XML file to a project:-
From the Project menu,select Add Existing Item.
a.The Add Existing Item dialog box appears.
b.Select an XML file and press Add.
3.To create a new XML or XSLT file:-
a.From the File menu,select New.
b.The New File dialog box appears.
c.Select XML File to create a new XML file,or,select XSLT File to create a new XSLT style sheet.
d.Click Open.
4.To edit an XML Schema using the XML Editor:-
a.From the File menu,select Open,and then select File.The Open File dialog box appears.
b.Select an XML Schema,click the Open arrow to see more options,and then select Open 
With.
c.Select the XML Editor from the list and click OK.


5.To create a project for XML files
a.From the File menu,select New,and then select Project.
b.The New Project dialog box appears.
c.Select the code language of your choice, d.select Empty Project,and click OK.
e.Add XML files to the project.

6.Example of XML edit:-
The replaceHere="true" attribute marks the location at which the parser is supposed to insert a replacement node. Once I have the code fully debugged,I hope to be able to post it here.(Please leave a comment if you are interested in seeing it.)If you're like me,you check the Microsoft QuickStart samples when you want to do a task for the first time.The XML file samples Microsoft provides are quite straightforward. To read the document,you call the XmlDocument .Load(fileName) method;to save it, you simply call the XmlDocument.Save (fileName)method.So to read,modify,and save the document,you should be able to write code like this:




<!-- [PROD]
<configuration>
<system.web>
<customErrors mode="On" defaultRedirect="Error.htm" replaceHere="true"/>
<authentication >
<forms loginUrl="login.aspx" name="PROD" timeout="60" path="/" replaceHere="true">
</forms>
</authentication>
<httpCookies httpOnlyCookies="false" requireSSL="false" domain="seibelsonline.com" replaceHere="true"/>
</system.web>
</configuration>
-->

<!--
[FQA]
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="Error.htm" replaceHere="true"/>
<authentication >
<forms loginUrl="login.aspx" name="FQA" timeout="60" path="/" replaceHere="true">
</forms>
</authentication>
</system.web>
</configuration>
-->

No comments:

Post a Comment