Wednesday 27 January 2016

Example for XML,DDT,XSLT Document .....


1. Create an xml document to display Product Information with the following attributes
a. Product_id
b. product_name
c. product_type
d. product_price
e. product_warranty
<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->

<ps>
    <p>
        <p-id>101</p-id>
        <p_type>commercial</p_type>
        <p_name>face-cream</p_name>
        <warenty_period>2-mon</warenty_period>
        <p_price>100</p_price>
    </p>
    <p>
        <p-id>111</p-id>
        <p_type>domestric</p_type>
        <p_name>cot</p_name>
        <warenty_period>3yrs</warenty_period>
        <p_price>2000</p_price>
    </p>
    <p>
        <p-id>120</p-id>
        <p_type>commercial</p_type>
        <p_name>body-wash</p_name>
        <warenty_period>3-mon</warenty_period>
        <p_price>3000</p_price>
    </p>
     <p>
        <p-id>121</p-id>
        <p_type>commercial</p_type>
        <p_name>sofa</p_name>
        <warenty_period>3-years</warenty_period>
        <p_price>30000</p_price>
    </p>
     <p>
        <p-id>122</p-id>
        <p_type>commercial</p_type>
        <p_name>caboard</p_name>
        <warenty_period>5-years</warenty_period>
        <p_price>25000</p_price>
    </p>
     <p>
        <p-id>123</p-id>
        <p_type>domestic</p_type>
        <p_name>fridge</p_name>
        <warenty_period>5years</warenty_period>
        <p_price>30000</p_price>
    </p>
     <p>
        <p-id>124</p-id>
        <p_type>domrstic</p_type>
        <p_name>mixer</p_name>
        <warenty_period>2-year</warenty_period>
        <p_price>3000</p_price>
    </p>
      <p>
        <p-id>135</p-id>
        <p_type>comercial</p_type>
        <p_name>soap</p_name>
        <warenty_period>1-mon</warenty_period>
        <p_price>300</p_price>
    </p>
      <p>
        <p-id>154</p-id>
        <p_type>domrstic</p_type>
        <p_name>washing-machine</p_name>
        <warenty_period>5-year</warenty_period>
        <p_price>30000</p_price>
    </p>
</ps>
OUTPUT:
<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->

<ps>
    <p>
        <p-id>101</p-id>
        <p_type>commercial</p_type>
        <p_name>face-cream</p_name>
        <warenty_period>2-mon</warenty_period>
        <p_price>100</p_price>
    </p>
    <p>
        <p-id>111</p-id>
        <p_type>domestric</p_type>
        <p_name>cot</p_name>
        <warenty_period>3yrs</warenty_period>
        <p_price>2000</p_price>
    </p>
    <p>
        <p-id>120</p-id>
        <p_type>commercial</p_type>
        <p_name>body-wash</p_name>
        <warenty_period>3-mon</warenty_period>
        <p_price>3000</p_price>
    </p>
     <p>
        <p-id>121</p-id>
        <p_type>commercial</p_type>
        <p_name>sofa</p_name>
        <warenty_period>3-years</warenty_period>
        <p_price>30000</p_price>
    </p>
     <p>
        <p-id>122</p-id>
        <p_type>commercial</p_type>
        <p_name>caboard</p_name>
        <warenty_period>5-years</warenty_period>
        <p_price>25000</p_price>
    </p>
     <p>
        <p-id>123</p-id>
        <p_type>domestic</p_type>
        <p_name>fridge</p_name>
        <warenty_period>5years</warenty_period>
        <p_price>30000</p_price>
    </p>
     <p>
        <p-id>124</p-id>
        <p_type>domrstic</p_type>
        <p_name>mixer</p_name>
        <warenty_period>2-year</warenty_period>
        <p_price>3000</p_price>
    </p>
      <p>
        <p-id>135</p-id>
        <p_type>comercial</p_type>
        <p_name>soap</p_name>
        <warenty_period>1-mon</warenty_period>
        <p_price>300</p_price>
    </p>
      <p>
        <p-id>154</p-id>
        <p_type>domrstic</p_type>
        <p_name>washing-machine</p_name>
        <warenty_period>5-year</warenty_period>
        <p_price>30000</p_price>
    </p>
</ps>


2. Create a DTD document to display Product Information created in above xml document
<?xml version='1.0' encoding='UTF-8'?>

<!--
    TODO define vocabulary identification
    PUBLIC ID: -//vendor//vocabulary//EN
    SYSTEM ID: http://server/path/product-1.3b.dtd

-->

<!--
    An example how to use this DTD from your XML document:

    <?xml version="1.0"?>

    <!DOCTYPE ps SYSTEM "product-1.3b.dtd">

    <ps>
    ...
    </ps>
-->

<!--- Put your DTDDoc comment here. -->
<!ELEMENT ps (p)*>

<!--- Put your DTDDoc comment here. -->
<!ELEMENT p (p_price|warenty_period|p_name|p_type|p-id)*>

<!--- Put your DTDDoc comment here. -->
<!ELEMENT p-id (#PCDATA)>

<!--- Put your DTDDoc comment here. -->
<!ELEMENT p_type (#PCDATA)>

<!--- Put your DTDDoc comment here. -->
<!ELEMENT p_name (#PCDATA)>

<!--- Put your DTDDoc comment here. -->
<!ELEMENT warenty_period (#PCDATA)>

<!--- Put your DTDDoc comment here. -->
<!ELEMENT p_price (#PCDATA)>
OUTPUT:
<?xml version='1.0' encoding='UTF-8'?>

<!--
    TODO define vocabulary identification
    PUBLIC ID: -//vendor//vocabulary//EN
    SYSTEM ID: http://server/path/product-1.3b.dtd

-->

<!--
    An example how to use this DTD from your XML document:

    <?xml version="1.0"?>

    <!DOCTYPE ps SYSTEM "product-1.3b.dtd">

    <ps>
    ...
    </ps>
-->

<!--- Put your DTDDoc comment here. -->
<!ELEMENT ps (p)*>

<!--- Put your DTDDoc comment here. -->
<!ELEMENT p (p_price|warenty_period|p_name|p_type|p-id)*>

<!--- Put your DTDDoc comment here. -->
<!ELEMENT p-id (#PCDATA)>

<!--- Put your DTDDoc comment here. -->
<!ELEMENT p_type (#PCDATA)>

<!--- Put your DTDDoc comment here. -->
<!ELEMENT p_name (#PCDATA)>

<!--- Put your DTDDoc comment here. -->
<!ELEMENT warenty_period (#PCDATA)>

<!--- Put your DTDDoc comment here. -->
<!ELEMENT p_price (#PCDATA)>


3. Create an XSL document to display Product Information created in exercise 1 and display it as a table in a browser using XSLT.

<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : product-1.3c.xsl
    Created on : December 8, 2015, 2:33 PM
    Author     : Administrator
    Description:
        Purpose of transformation follows.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>

    <!-- TODO customize transformation rules
         syntax recommendation http://www.w3.org/TR/xslt
    -->
    <xsl:template match="/">
        <html>
            <head>
                <title>product-1.3c.xsl</title>
            </head>
            <body>
             
           <p align="center"><b>Product details</b>
                <table border="1" >
                    <th bgcolor="pink">p-id</th>
                    <th bgcolor="white">p_type</th>
                    <th bgcolor="pink">p_name</th>
                    <th bgcolor="white">warenty_period</th>
                    <th bgcolor="pink">p_price</th>
                <xsl:for-each select="ps/p">
                    <tr>
                    <td bgcolor="pink"><xsl:value-of select="p-id"></xsl:value-of></td>
                    <td bgcolor="white"><xsl:value-of select="p_type"></xsl:value-of></td>
                    <td bgcolor="pink"><xsl:value-of select="p_name"></xsl:value-of></td>
                    <td bgcolor="white"><xsl:value-of select="warenty_period"></xsl:value-of></td>
                    <td bgcolor="pink"><xsl:value-of select="p_price"></xsl:value-of></td>
                    </tr>
                </xsl:for-each> </table>
           </p>
</body>

        </html>
    </xsl:template>

</xsl:stylesheet>

FINAL  OUTPUT:


Puzzle 2...

Five girls took part in a race.
Alison finished before Bunty but behind Clare. Debby finished before Emma but behind Bunty.
What was the finishing order?


HINT:
Clare finished first.

ANSWER:
Clare
 Alison
  Bunty
   Debby
    Emma

Puzzle 1...



A large volume of water is gushing through a pipe which narrows at the outlet. At which point, A, B, C or D will the water flow fastest?


ANSWER:

Ans: C.
Sol.
The water flows fastest at the narrowest point.

Sunday 24 January 2016

Sincere Prayer

God, I don’t know you,” - be frank with Him - “but this is my prayer to you. I hope it reaches you. I am going to meditate, so whoever you are, whatever you are, I would like to experience your essence.” Have this sentiment in your heart.
                                                                                                                                                    
   

பாதையின் குறிகோள்.....

பிரபன்ஜத்தை   படைத்தவன்   பரம்பொருள்
அப்பரம்பொருளின்   பாசத்திற்கு  இனங்க
பாரில்  பிறந்து....




பிடிகொடுத்து  பரம்பொருளை  மறந்து
 பொய்யான பாசத்திற்காக   பறந்து
பயன்யற்ற  ஆசைக்காக  அடிபணிந்தும்
பணத்திற்காக  பிணம்திண்ணி கழுகாய் பறந்து...


பதிவு  என்னும்  போதிமுட்டைகலை  சுமந்தும்...





பனைய  கைதிகளாய்  இருந்து
இப்பாரென்னும் பினவரை  விட்டு
பிரிய  மனம் இன்றி....




படைத்தவன்  இடம் மே   பொய் குறி
அவன் மீதே பழியும் சுமத்தி
அவற்றை எல்லாம் தாண்டி
பிடிகொடுத்தவன்   பிடியையே
படிபடியாய் பறித்து பழிவாங்க என்னும் மான்னி டனே ......



படைத்தவன் பரம்பொருள் !
இந்த பரம்பொருளே
எல்லையற்ற பாதையின்   குறிகோள்   எனஉணர்ந்து....




பயனத்தை  தொட ங்கி 
பாதையை வெல்.....