User:Abou Ben Adhem/Sandbox

From dKosopedia

Jump to: navigation, search

Contents

Bill page templates

Bills imported:

Date H.Con.Res. H.Res. H.J.Res. H.R. S.Con.Res. S.Res. S.J.Res. S.
2007-01-15 H.Con.Res. 32-110 H.Res. 63-110 H.J.Res. 14-110 H.R. 471-110 S.Con.Res. 1-110 S.Res. 26-110 S.J.Res. 1-110 S. 276-110
2007-01-17 H.Con.Res. 39-110 H.Res. 68-110 H.J.Res. 15-110 H.R. 501-110 S.Con.Res. 1-110 S.Res. 30-110 S.J.Res. 2-110 S. 309-110
2007-01-19 H.Con.Res. 39-110 H.Res. 68-110 H.J.Res. 15-110 H.R. 575-110 S.Con.Res. 1-110 S.Res. 30-110 S.J.Res. 2-110 S. 309-110
2007-01-21 H.Con.Res. 39-110 H.Res. 82-110 H.J.Res. 19-110 H.R. 598-110 S.Con.Res. 3-110 S.Res. 34-110 S.J.Res. 2-110 S. 340-110
2007-01-23 H.Con.Res. 40-110 H.Res. 84-110 H.J.Res. 19-110 H.R. 630-110 S.Con.Res. 3-110 S.Res. 36-110 S.J.Res. 2-110 S. 359-110
2007-01-25 H.Con.Res. 45-110 H.Res. 101-110 H.J.Res. 19-110 H.R. 697-110 S.Con.Res. 4-110 S.Res. 39-110 S.J.Res. 2-110 S. 386-110
2007-01-30 H.Con.Res. 46-110 H.Res. 104-110 H.J.Res. 20-110 H.R. 717-110 S.Con.Res. 4-110 S.Res. 45-110 S.J.Res. 2-110 S. 426-110
2007-02-01 H.Con.Res. 52-110 H.Res. 123-110 H.J.Res. 21-110 H.R. 796-110 S.Con.Res. 7-110 S.Res. 63-110 S.J.Res. 2-110 S. 470-110
2007-02-07 H.Con.Res. 59-110 H.Res. 132-110 H.J.Res. 22-110 H.R. 865-110 S.Con.Res. 9-110 S.Res. 73-110 S.J.Res. 2-110 S. 509-110
2007-02-12 H.Con.Res. 62-110 H.Res. 151-110 H.J.Res. 24-110 H.R. 978-110 S.Con.Res. 9-110 S.Res. 76-110 S.J.Res. 2-110 S. 542-110

Since Feb. 12

Date H.Con.Res. H.Res. H.J.Res. H.R. S.Con.Res. S.Res. S.J.Res. S.
2007-02-18 H.Con.Res. 74-110 H.Res. 193-110 H.J.Res. 37-110 H.R. 1189-110 S.Con.Res. 13-110 S.Res. 85-110 S.J.Res. 2-110 S. 674-110
2007-03-03 H.Con.Res. 77-110 H.Res. 209-110 H.J.Res. 38-110 H.R. 1307-110 S.Con.Res. 16-110 S.Res. 92-110 S.J.Res. 4-110 S. 755-110
2007-03-12 H.Con.Res. 89-110 H.Res. 235-110 H.J.Res. 39-110 H.R. 1467-110 S.Con.Res. 18-110 S.Res. 104-110 S.J.Res. 9-110 S. 837-110
2007-03-20 H.Con.Res. 93-110 H.Res. 252-110 H.J.Res. 39-110 H.R. 1558-110 S.Con.Res. 21-110 S.Res. 110-110 S.J.Res. 9-110 S. 910-110
2007-03-24 H.Con.Res. 99-110 H.Res. 265-110 H.J.Res. 39-110 H.R. 1674-110 S.Con.Res. 24-110 S.Res. 122-110 S.J.Res. 9-110 S. 982-110
2007-04-15 H.Con.Res. 99-110 H.Res. 295-110 H.J.Res. 41-110 H.R. 1856-110 S.Con.Res. 27-110 S.Res. 148-110 S.J.Res. 11-110 S. 1108-110
2007-05-10 H.Con.Res. 146-110 H.Res. 391-110 H.J.Res. 42-110 H.R. 2259-110 S.Con.Res. 33-110 S.Res. 191-110 S.J.Res. 12-110 S. 1331-110
2007-05-23 H.Con.Res. 154-110 H.Res. 430-110 H.J.Res. 43-110 H.R. 2446-110 S.Con.Res. 33-110 S.Res. 213-110 S.J.Res. 13-110 S. 1452-110
2007-06-06 H.Con.Res. 164-110 H.Res. 458-110 H.J.Res. 44-110 H.R. 2575-110 S.Con.Res. 34-110 S.Res. 220-110 S.J.Res. 15-110 S. 1544-110

thomas2wiki.xsl

<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <xsl:output method="xml" omit-xml-declaration="yes" />
    <xsl:param name="lastHConRes" select="0" />
    <xsl:param name="lastSConRes" select="0" />
    <xsl:param name="lastHJRes" select="0" />
    <xsl:param name="lastSJRes" select="0" />
    <xsl:param name="lastHRes" select="0" />
    <xsl:param name="lastSRes" select="0" />
    <xsl:param name="lastHR" select="0" />
    <xsl:param name="lastS" select="0" />
    <xsl:template match="/">
        <mediawiki xmlns="http://www.mediawiki.org/xml/export-0.3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.3/ http://www.mediawiki.org/xml/export-0.3.xsd" version="0.3" xml:lang="en">
            <xsl:apply-templates select="//*[@id='content']/xhtml:p[./*[1] = xhtml:b]" />
        </mediawiki>
    </xsl:template>
    <xsl:template match="xhtml:p" xmlns="http://www.mediawiki.org/xml/export-0.3/" xml:space="preserve">
        <xsl:variable name="congress" select="./xhtml:a[1]/substring(@href, 21, 3)" />
        <xsl:variable name="billname" select="./xhtml:a[1]/normalize-space(text())" />
        <xsl:variable name="billtype" xml:space="default">
            <xsl:choose>
                <xsl:when test="starts-with($billname, 'H.CON.RES.')">H.Con.Res.</xsl:when>
                <xsl:when test="starts-with($billname, 'S.CON.RES.')">S.Con.Res.</xsl:when>
                <xsl:when test="starts-with($billname, 'H.J.RES.')">H.J.Res.</xsl:when>
                <xsl:when test="starts-with($billname, 'S.J.RES.')">S.J.Res.</xsl:when>
                <xsl:when test="starts-with($billname, 'H.RES.')">H.Res.</xsl:when>
                <xsl:when test="starts-with($billname, 'S.RES.')">S.Res.</xsl:when>
                <xsl:when test="starts-with($billname, 'H.R.')">H.R.</xsl:when>
                <xsl:when test="starts-with($billname, 'S.')">S.</xsl:when>
                <xsl:otherwise><xsl:message terminate="yes">Bill type not recognized.</xsl:message></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <xsl:variable name="billtype" select="normalize-space($billtype)" />
        <xsl:variable name="billnumber" select="substring($billname, string-length($billtype)+1)" />
        <xsl:variable name="billtitle" select="./xhtml:a[1]/(following-sibling::text())[1]" />
        <xsl:variable name="billtitle" select="normalize-space(substring($billtitle, 3))" />
        <xsl:variable name="sponsor" select="./xhtml:b[./text()='Sponsor:']/(following-sibling::xhtml:a/text())[1]" />
        <xsl:variable name="sponsor" select="normalize-space($sponsor)" />
        <xsl:variable name="committees" select="./xhtml:b[./text()='Committees:']/following-sibling::text()[1]" />
        <xsl:variable name="committees" select="tokenize(normalize-space($committees), '; ')" />
        <xsl:variable name="recent" select="./xhtml:b[./text()='Latest Major Action:']/following-sibling::text()[1]" />
        <xsl:variable name="recent" select="normalize-space($recent)" />
        <xsl:variable name="date" select="tokenize(substring-before($recent, ' '), '/')" />
        <xsl:variable name="monthnumber" select="number($date[1])" />
        <xsl:variable name="monthname" select="tokenize('January February March April May June July August September October November December', ' ')[$monthnumber]" />
        <xsl:variable name="billname" select="concat($billtype, ' ', $billnumber, '-', $congress)" />
        <xsl:if test="($billtype='H.Con.Res.' and number($billnumber) > ($lastHConRes)) or
            ($billtype='S.Con.Res.' and number($billnumber) > number($lastSConRes)) or
            ($billtype='H.J.Res.' and number($billnumber) > number($lastHJRes)) or
            ($billtype='S.J.Res.' and number($billnumber) > number($lastSJRes)) or
            ($billtype='H.Res.' and number($billnumber) > number($lastHRes)) or
            ($billtype='S.Res.' and number($billnumber) > number($lastSRes)) or
            ($billtype='H.R.' and number($billnumber) > number($lastHR)) or
            ($billtype='S.' and number($billnumber) > number($lastS))">
<page>
<title><xsl:value-of select="$billname" /></title>
    <revision>
        <timestamp><xsl:value-of select="$date[3]" />-<xsl:value-of select="format-number($monthnumber, '00')" />-<xsl:value-of select="format-number(number($date[2]), '00')" />T12:00:00Z</timestamp>
    <contributor><username>*thomas.gov import*</username></contributor>
    <text>
{{stub}}
{{<xsl:value-of select="concat($billtype, 'Info|bill=', $billnumber, '|congress=', $congress)" />
|title=<xsl:value-of select="$billtitle" />
|sponsor=[[<xsl:value-of select="$sponsor" />]]
|committees=<xsl:for-each select="$committees">[[<xsl:value-of select="." />]] </xsl:for-each>
}}
==Bill Text==
[<xsl:value-of select="concat('http://thomas.loc.gov/cgi-bin/query/z?c', $congress, ':', upper-case($billtype), $billnumber, ': Text of ', $billname)" />]
==Update Status==
{{Status of <xsl:value-of select="$billname" />}}
==External Links==
{{<xsl:value-of select="concat($billtype, 'Links|bill=', $billnumber, '|congress=', $congress)" />}}
Source: [http://thomas.loc.gov/bss/<xsl:value-of select="$congress" />search.html thomas.gov search]</text>
    </revision>
</page>
<page>
    <title><xsl:value-of select="concat($billtype, $billnumber, '-', $congress)" /></title>
    <revision>
        <timestamp><xsl:value-of select="$date[3]" />-<xsl:value-of select="format-number($monthnumber, '00')" />-<xsl:value-of select="format-number(number($date[2]), '00')" />T12:00:00Z</timestamp>
      <contributor><username>*thomas.gov import*</username></contributor>
      <text>#REDIRECT [[<xsl:value-of select="concat($billtype, ' ', $billnumber, '-', $congress)" />]]
      </text>
    </revision>
</page>
</xsl:if>
<page>
    <title>Template:Status of <xsl:value-of select="$billname" /></title>
    <revision>
        <timestamp><xsl:value-of select="$date[3]" />-<xsl:value-of select="format-number($monthnumber, '00')" />-<xsl:value-of select="format-number(number($date[2]), '00')" />T12:00:00Z</timestamp>
        <contributor><username>*thomas.gov import*</username></contributor>
        <text>{{billstatus|bill=<xsl:value-of select="$billname" />
            |title=<xsl:value-of select="$billtitle" />
            |year=<xsl:value-of select="$date[3]" />
            |monthday=<xsl:value-of select="concat($monthname, ' ', $date[2])" />
            |status=<xsl:value-of select="substring-after($recent, ' ')" />
            }}</text>
    </revision>
</page>
    </xsl:template>
</xsl:stylesheet>
Personal tools