CSharpArt

From ICO wiki
Jump to navigationJump to search

Meeskond

  • Kristo Roosileht (D22)
  • Mihkel Kadarik (D22)
  • Henri Kroosmann (D61)
  • Ats Rand (D22)

XML fail

<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="stiil1.xslt" ?>

<phoneBook>
  <phoneBookItem type="person" id="1">
    <personName>
      <givenNames>
        <name default="1">Paul</name>
        <name>Peeter</name>
      </givenNames>
      <familyName>Puujalg</familyName>
    </personName>
    <birthday format="YYYY-MM-DD">1919-02-27</birthday>
    <addresses>
      <address id="1" default="1">
        <country>Estonia</country>
        <county>Harjumaa</county>
        <city>Tallinn</city>
        <street>Narva mnt.</street>
        <house>5</house>
        <appartement>13</appartement>
        <zipCode>12345</zipCode>
      </address>
      <address id="2">
        <address id="1">
          <country>Estonia</country>
          <county>Harjumaa</county>
          <city>Tallinn</city>
          <street>Pärnu mnt.</street>
          <house>25</house>
          <appartement/>
          <zipCode>12345</zipCode>
        </address>
      </address>
    </addresses>
    <contactInfo>
      <phones>
        <phone type="home" areaCode="372">63440292</phone>
        <phone type="mobile" areaCode="372" default="1">55566334</phone>
        <phone type="work" areaCode="372">555234231</phone>
        <phone type="skype" areaCode="372">2340240</phone>
      </phones>
      <emails>
        <email type="personal" default="1">mail@mail.ee</email>
        <email type="work">mail@puujalg.ee</email>
      </emails>
      <other>
        <skype>paul.peeter.puujalg</skype>
        <twitter>paulpeeterpuujalg</twitter>
      </other>
    </contactInfo>
    <additionalInfo>
      <websites>
       <website type="facebook">http://www.facebook.com/paulpeeterpuujalg</website>
      </websites>
      <company id="4">
        <name>Puujalad &amp; Co.</name>
      </company>
      <notes>
        <note date="2013-02-10">Tegemist töökaaslasega minu eelmisest ettevõttest</note>
      </notes>
    </additionalInfo>
  </phoneBookItem>

  <phoneBookItem type="person" id="2">
    <personName>
      <givenNames>
        <name default="1">Karl</name>
        <name>Kristjan</name>
      </givenNames>
      <familyName>Konkskäsi</familyName>
    </personName>
    <birthday format="YYYY-MM-DD">1919-02-27</birthday>
    <addresses>
      <address id="1" default="1">
        <country>Estonia</country>
        <county>Harjumaa</county>
        <city>Tallinn</city>
        <street>Narva mnt.</street>
        <house>5</house>
        <appartement>13</appartement>
        <zipCode>12345</zipCode>
      </address>
      <address id="2">
        <address id="1">
          <country>Estonia</country>
          <county>Harjumaa</county>
          <city>Tallinn</city>
          <street>Pärnu mnt.</street>
          <house>25</house>
          <appartement/>
          <zipCode>12345</zipCode>
        </address>
      </address>
    </addresses>
    <contactInfo>
      <phones>
        <phone type="home" areaCode="372">63440292</phone>
        <phone type="mobile" areaCode="372" default="1">55566334</phone>
        <phone type="work" areaCode="372">555234231</phone>
        <phone type="skype" areaCode="372">2340240</phone>
      </phones>
      <emails>
        <email type="personal" default="1">mail@mail.ee</email>
        <email type="work">mail@konksk2si.ee</email>
      </emails>
      <other>
        <skype>karl.kristjan.konksk2si</skype>
        <twitter>karlkristjankonksk2si</twitter>
      </other>
    </contactInfo>
    <additionalInfo>
      <websites>
        <website type="facebook">http://www.facebook.com/karlkristjankonksk2si</website>
      </websites>
      <company id="3">
        <name>Konkskäed &amp; Co.</name>
      </company>
      <notes>
        <note date="2013-02-10">Tegemist töökaaslasega minu järgmisest ettevõttest</note>
      </notes>
    </additionalInfo>
  </phoneBookItem>
  
  <phoneBookItem type="organization" id="3">
    <orgName>Konkskäed &amp; Co.</orgName>
    <addresses>
      <address id="45" default="1" type="office">
        <country>Estonia</country>
        <county>Harjumaa</county>
        <city>Tallinn</city>
        <street>Tartu mnt.</street>
        <house>45</house>
        <zipCode>12345</zipCode>
      </address>
      <address id="2" type="shop">
        <country>Estonia</country>
        <county>Harjumaa</county>
        <city>Tallinn</city>
        <street>Pärnu mnt.</street>
        <house>253b</house>
        <appartement/>
        <zipCode>12345</zipCode>
      </address>
    </addresses>
    <contactInfo>
      <phones>
        <phone areaCode="372" default="1">6310456</phone>
      </phones>
      <emails>
        <email default="1">kiri@konksk2si.ee</email>
      </emails>
      <other>
        <skype>konksk2si.klienditeenindus</skype>
        <test>testkontakt</test>
      </other>
    </contactInfo>
    <additionalInfo>
      <websites>
        <website type="homepage">http://www.konksk2si.ee</website>
        <website type="shop">http://pood.konksk2si.ee</website>
        <website type="facebook">http://www.facebook.com/konksk2si</website>
      </websites>
      <notes>
        <note date="2012-12-12">See on koht, kust saab väga häid konkse kätele</note>
      </notes>
      <contactPersons>
        <person id="2">Karl Kristjan Konkskäsi</person>
      </contactPersons>
    </additionalInfo>
  </phoneBookItem>

  <phoneBookItem type="organization" id="4">
    <orgName>Puujalad &amp; Co.</orgName>
    <addresses>
      <address id="45" default="1" type="office">
        <country>Estonia</country>
        <county>Harjumaa</county>
        <city>Tallinn</city>
        <street>Tartu mnt.</street>
        <house>45</house>
        <zipCode>12345</zipCode>
      </address>
      <address id="2" type="shop">
        <country>Estonia</country>
        <county>Harjumaa</county>
        <city>Tallinn</city>
        <street>Pärnu mnt.</street>
        <house>253b</house>
        <appartement/>
        <zipCode>12345</zipCode>
      </address>
    </addresses>
    <contactInfo>
      <phones>
        <phone areaCode="372" default="1">6310456</phone>
      </phones>
      <emails>
        <email default="1">kiri@puujalad.ee</email>
      </emails>
      <other>
        <skype>puujalad.klienditeenindus</skype>
        <twitter>puujalad</twitter>
      </other>
    </contactInfo>
    <additionalInfo>
      <websites>
        <website type="homepage">http://www.puujalad.ee</website>
        <website type="shop">http://pood.puujalad.ee</website>
      </websites>
      <notes>
        <note date="2012-12-12">See on koht, kust saab väga häid puujalgu</note>
      </notes>
      <contactPersons>
        <person id="1">Paul Peeter Puujalg</person>
      </contactPersons>
    </additionalInfo>
  </phoneBookItem>
</phoneBook>

Stiilifail1

Stiilifail, mis väljastab kõik isikud.

<?xml version="1.0" encoding="utf-8"?>
<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"
>
    <xsl:template match="/">
      <html>
        <body bgcolor="#eeeeee">
          <h2>Kontakt! Isikud</h2>
          <table border="1">
          <xsl:for-each select="phoneBook/phoneBookItem">
            <xsl:if test="@type = 'person'">
              <tr bgcolor="#9acd32">
                <th>Sünnipäev</th>
                <th>Eesnimi</th>
                <th>Perekonnanimi</th>
                <th>Aadress</th>
                <th>Telefon</th>
                <th>e-Mail</th>
                <th>Muu</th>
                <th>Veebilehed</th>
              </tr>
              <tr>
                <td>
                  <xsl:value-of select="birthday"/>
                </td>
                <xsl:for-each select="personName">
                  <td>
                    <xsl:value-of select="familyName"/>
                  </td>
                  <xsl:for-each select="givenNames">
                    <td>
                      <xsl:value-of select="name"/>
                    </td>
                  </xsl:for-each>
                </xsl:for-each>
                <td>
                <xsl:for-each select="addresses/address">
                    <xsl:value-of select="country"/>
                    <br />
                    <xsl:value-of select="county"/>
                    <br />
                    <xsl:value-of select="city"/>
                    <br />
                    <xsl:value-of select="street"/>
                    <xsl:value-of select="house"/>
                    <br />
                    <xsl:value-of select="appartement"/>
                    <br />
                    <xsl:value-of select="zipCode"/>
                </xsl:for-each>
                </td>
              <xsl:for-each select ="contactInfo">
                  <xsl:for-each select ="phones">
                    <td>
                    <ul>
                      <li>
                    <xsl:value-of select="phone[1]/@type"/>: 
                  <xsl:value-of select ="phone[1]"/>
                      </li>
                      <li>
                  <xsl:value-of select="phone[2]/@type"/>: 
                  <xsl:value-of select ="phone[2]"/>
                      </li>
                      <li>
                  <xsl:value-of select="phone[3]/@type"/>: 
                  <xsl:value-of select ="phone[3]"/>
                      </li>
                      <li>
                  <xsl:value-of select="phone[4]/@type"/>: 
                  <xsl:value-of select ="phone[4]"/>
                      </li>
                    </ul>
                    </td>
                </xsl:for-each>
                  <td>
                <xsl:for-each select="emails">
                  <xsl:value-of select="email[1]/@type"/>: 
                  <xsl:value-of select ="email[1]"/>
                  <br />
                  <xsl:value-of select="email[2]/@type"/>: 
                  <xsl:value-of select ="email[2]"/>
                </xsl:for-each>
                  </td>
                <td>
                <xsl:for-each select="other">
                  Skype: <xsl:value-of select="skype"/>
                  <br />
                  Twitter: 
                  <xsl:value-of select="twitter"/>
                </xsl:for-each>
                </td>
              </xsl:for-each>
              <xsl:for-each select="additionalInfo">
                <td>
                  <xsl:for-each select="websites">
                    <xsl:value-of select="website"/>
                  </xsl:for-each>
                </td>
              </xsl:for-each>
              </tr>
            </xsl:if>
          </xsl:for-each>
          </table>
        </body>
      </html>
    </xsl:template>
</xsl:stylesheet>

Stiilifail2

Stiilifail, mis väljastab kõi ettevõtted.

<?xml version="1.0" encoding="utf-8"?>
<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"
>
    <xsl:template match="/">
        <html>
            <body bgcolor="#eeeeee">
              <h2>Kontakt! - Ettevõtted</h2>
              <table border="1">
                  <tr bgcolor="#9acd32">
                    <th>Nimi</th>
                    <th>Aadressid</th>
                    <th>Telefonid</th>
                    <th>e-Mailid</th>
                    <th>Muu kontaktinfo</th>
                    <th>Veebilehed</th>
                    <th>Kontaktisikud</th>
                  </tr>
                <xsl:for-each select="phoneBook/phoneBookItem">
                    <xsl:if test="@type = 'organization'">
                        <tr>
                            <td><xsl:value-of select="orgName"/></td>
                            <td>
                                <table>
                                <xsl:for-each select="addresses/address">
                                    <tr>
                                        <td>
                                            <xsl:value-of select="country" /><br />
                                            <xsl:value-of select="county" /><br />
                                            <xsl:value-of select="city" />, <xsl:value-of select="zipCode" /><br />
                                            <xsl:value-of select="street" /> <xsl:value-of select="house" /> <xsl:value-of select="appartement" />
                                        </td>
                                    </tr>
                                </xsl:for-each>
                                </table>
                            </td>
                            <td>
                                <table>
                                    <xsl:for-each select="contactInfo/phones">
                                        <tr>
                                            <td><xsl:value-of select="phone/@type"/>: +<xsl:value-of select="phone/@areaCode" /><xsl:value-of select="phone" /></td>
                                        </tr>
                                    </xsl:for-each>
                                </table>
                            </td>
                            <td>
                                <table>
                                    <xsl:for-each select="contactInfo/emails/email">
                                        <tr>
                                            <td><xsl:value-of select="." /></td>
                                        </tr>
                                    </xsl:for-each>
                                </table>
                            </td>
                            <td>
                                <table>
                                    <xsl:for-each select="contactInfo/other">
                                        <tr>
                                            <td>
                                                <table>
                                                    <xsl:if test="skype">
                                                        <tr>
                                                            <td>Skype: <xsl:value-of select="skype" /></td>
                                                        </tr>
                                                    </xsl:if>
                                                    <xsl:if test="test">
                                                        <tr>
                                                            <td>Test: <xsl:value-of select="test" /></td>
                                                        </tr>
                                                    </xsl:if>
                                                </table>
                                            </td>
                                        </tr>
                                    </xsl:for-each>
                                </table>
                            </td>
                            <td>
                                <table>
                                    <xsl:for-each select="additionalInfo/websites/website">
                                        <tr>
                                            <td><xsl:value-of select="./@type" />: <br /><xsl:value-of select="." /></td>
                                        </tr>
                                    </xsl:for-each>
                                </table>
                            </td>
                            <td>
                                <table>
                                    <xsl:for-each select="additionalInfo/contactPersons/person">
                                        <tr>
                                            <td>(<xsl:value-of select="./@id" />) <xsl:value-of select="." /></td>
                                        </tr>
                                    </xsl:for-each>
                                </table>
                            </td>
                        </tr>
                    </xsl:if>
                </xsl:for-each>
              </table>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>

Skeemifail

Logi

19.03.2013 11:30 - Moodustasime Tiimi

19.03.2013 15:00 - Alustasime Wiki lehega