Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Apply following .xslt: </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"&gt; &lt;xsl:output method="xml" indent="yes"/&gt; &lt;xsl:variable name="vQ"&gt;Mr. &lt;/xsl:variable&gt; &lt;xsl:template match="@*|node()"&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="@*|node()"/&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;xsl:template match="employee/firstname"&gt; &lt;xsl:element name="firstname"&gt; &lt;xsl:value-of select="concat($vQ, .)"/&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>Input is: </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?&gt; &lt;root&gt; &lt;employee&gt; &lt;firstname&gt;Kaushal&lt;/firstname&gt; &lt;lastname&gt;Parik&lt;/lastname&gt; &lt;/employee&gt; &lt;employee&gt; &lt;firstname&gt;Abhishek&lt;/firstname&gt; &lt;lastname&gt;Swarnkar&lt;/lastname&gt; &lt;/employee&gt; &lt;/root&gt; </code></pre> <p>Out put is: </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?&gt; &lt;root&gt; &lt;employee&gt; &lt;firstname&gt;Mr. Kaushal&lt;/firstname&gt; &lt;lastname&gt;Parik&lt;/lastname&gt; &lt;/employee&gt; &lt;employee&gt; &lt;firstname&gt;Mr. Abhishek&lt;/firstname&gt; &lt;lastname&gt;Swarnkar&lt;/lastname&gt; &lt;/employee&gt; &lt;/root&gt; </code></pre> <p>and C# function is like this: </p> <pre><code>private void button3_Click(object sender, EventArgs e) { XslTransform xslt = new XslTransform(); xslt.Load("transform.xslt"); xslt.Transform("books.xml", "books1.xml"); } </code></pre> <p>Hope this will help you... </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload