How to serialize and deserialize an object in C# to a XML file

0 Comments

The following code shows how to serialize and deserialize an object in C# to a XML file.   Code using System; using System.Linq; using System.Collections.Generic; using System.Text; using System.IO; using System.Xml.Serialization; using System.Reflection; namespace MobileUI.BC

Dynamically call a xslt template

0 Comments

You cannot call a xslt template like: <xsl:variable name="templateName" select="test"></xsl:variable> <xsl:call-template name="$templateName"> <xsl:template name="test"> </xsl:template> The clossed you can get to calling a xslt template dynamically is to use the <xsl:if or <xsl:choose based on

How to copy XML nodes between documents (use ImportNode)

0 Comments

http://www.geekpedia.com/tutorial150_How-to-copy-XML-nodes-between-documents.html To copy node between XmlDocuments use importnode: // Store the root node of the destination document into an XmlNode // The 1 in ChildNodes[1] is the index of the node to be copied (where

Replace XElement with xml in string (C#)

0 Comments

If you want to replace an existing XElement by an new XElement conctructed from a string, you can use the XElement ReplaceWith method: XElement element = new XElement("MyName", "MyContent"); string newValue = "<MyNewName>Some value</MyNewName>"; element.ReplaceWith(XElement.Parse(newValue));

SketchPath XPath query tool

0 Comments

If you want to know the XPath query to an element of a XML file, but you’re new to XPath, you can use the Freeware tool: SketchPath to get show the XPath query. In mine

Using quotes in XML

0 Comments

To use quotes in xml, use “&quot;“ <exec program="CMD.EXE" commandline="/C &quot;${installPath}\DatabaseInstallation.cmd&quot;" workingdir="${installPath}"> <arg value="${Database_DataSource}" />