Friday, 8 April 2016

XSLT Converting Lowercase to Uppercase or Vice Versa

XML Code
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
                <cd>
                                <title>Empire Burlesque</title>
                                <artist>Bob Dylan</artist>
                                <country>USA</country>
                                <company>Columbia</company>
                                <price>10.90</price>
                                <year>1985</year>
                </cd>
                <cd>
                                <title>Hide your heart</title>
                                <artist>Bonnie Tyler</artist>
                                <country>UK</country>
                                <company>CBS Records</company>
                                <price>9.90</price>
                                <year>1988</year>
                </cd>
               
</catalog>

Before XSLT
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <html>
  <body>
    <h2>My CD Collection</h2>
    <table border="1">
      <tr bgcolor="#9acd32">
        <th>Title</th>
        <th>Artist</th>
      </tr>
      <tr>
        <td><xsl:value-of select="catalog/cd/title"/></td>
        <td><xsl:value-of select="catalog/cd/artist"/></td>
      </tr>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

Added below marked lines of code
After XSLT
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
  <html>
  <body>
    <h2>My CD Collection</h2>
    <table border="1">
      <tr bgcolor="#9acd32">
        <th>Title</th>
        <th>Artist</th>
      </tr>
      <tr>
        <td><xsl:value-of select="catalog/cd/title"/></td>
        <td><xsl:value-of select="catalog/cd/artist"/></td>
<td><xsl:value-of select="translate(catalog/cd/artist, $smallcase, $uppercase)"/></td>
<td><xsl:value-of select="translate(catalog/cd/artist, $uppercase,$smallcase)"/></td>
      </tr>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>



Thursday, 7 April 2016

Open a port in Windows Firewall

http://windows.microsoft.com/en-us/windows/open-port-windows-firewall#1TC=windows-7

Wednesday, 6 April 2016

C# How to convert WSDL to SVC



Assuming you are having .wsdl file at location "E:\" for ease in access further.
Prepare the command for each .wsdl file as: E:\YourServiceFileName.wsdl
Permissions: Assuming you are having the Administrative rights to perform permissions. Open directory : C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
Right click to amd64 => Security => Edit => Add User => Everyone Or Current User => Allow all permissions => OK.
Prepare the Commands for each file in text editor as: wsdl.exe E:\YourServiceFileName.wsdl /l:CS /server.
Now open Visual studio command prompt from : C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts\VS2013 x64 Native Tools Command Prompt.
Execute above command.
Go to directory : C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64, Where respective .CS file should be generated.
Move generated CS file to appropriate location.