About the OakLeaf XML Web Services
The OakLeaf Systems demonstration Web site provides the following XML Web services:
\
= light backward shill) that aren't available in the HTML 4.01/XML 1.0 entity
lists. Special tags, such as <E T="8401">
, are for
typesetting. DTDs, entity lists, and sample documents for the SGML and XML
versions are available from the GPO's
Vendor Information Page. The upshot of these issues with the
GPO's SGML is that creating well-formed, structured XML documents from the SGML
source isn't a piece of cake. Transformation to XML requires sequential text
processing, because XSL transforms aren't practical for documents whose
structure varies greatly. Transformation of the SGML text to XML requires
approximately 1,100 lines of Visual Basic .NET code. Examples of SGML text for a
simple section and the resulting XML document follow. Click
here to return the XML document for a CFR section, which appears as
unformatted text. Choose View, Source in IE to view the XML
source document in Notepad. Notice the use of XML/XHTML entities to represent
special characters.
Note: Transformation isn't perfect in OakLeaf CFR beta version 0.9. Approximately 0.1% (175 out of 181,500 sections) have XML parse errors at this point. A few TOCs also are missing. All parse errors and missing TOCs should be gone in version 1.0.
Note: The current XHTML transformation code creates well-formed XML documents (verified by the W3C HTML Validation Service). Like the current set of XHTML pages for this site, the documents verify as well-formed XML, but do not conform to XHTML 1.0 Transitional or Strict specifiecations. Conformance to the XHTML 1.x Strict DTD (except custom attribute names for DHTML behaviors) is scheduled for the next version. Code in the Visual Basic .NET client application translates special e-CFR SGML character references to their equivalents in the Latin 1, Special, and Symbols for XHTML//EN entity lists.
The component that acquires the the section text from the e-CFR database and performs the SGML to XML transformation is implemented as a conventional middle-tier COM or .NET component (for scalability). This component could be implemented as an internal XML Web service, but adding a SOAP wrapper introduces a significant amount of overhead.
A conventional (fat-client) Windows application (CFRClient.exe) manages the database and handles routine operations, such as processing CFR updates and regenerating TOCs. The figures below are screen captures of the two windows of the client application.
Important Notice: OakLeaf XML Web Services, the CFR database, and this private Web site are intended as examples for developers using Microsoft .NET technologies. This is not a commercial application nor is the site and its content intended for production use.
The main window of the client management application (Visual Basic. NET)
The Web client emulation window for testing COM and .NET components
Sample XML TOC document at the part level (indentation reduced for readability):
<?xml version="1.0" encoding = "UTF-8" ?> <CFRToc xmlns:CFRContents="http://localhost/CFR/Contents" > <Titles> <Title id='ti1st_' TitleID='1' > 1 - GENERAL PROVISIONS <Chapters> <Chapter id='ti1st_ch1sc_' TitleID='1' SubtitleID='-' ChapterID='1' > I - Administrative Committee of the Federal Register (Parts 1 - 49) <Subchapters> <Subchapter id='ti1st_ch1scA ' TitleID='1' SubtitleID='-' ChapterID='1' SubchapterID='A' > A - GENERAL <Parts> <Part id='ti1st_ch1scApn2' TitleID='1' SubtitleID='-' ChapterID='1' SubchapterID='A' PartID='2' > 2 - General Information <Sections> <Section id='ti1st_ch1scApn2sn1' TitleID='1' PartID='2' SectionID='1' Citation='1CFR2.1' HasText='Yes' > 2.1 - Scope and purpose. </Section> <Section id='ti1st_ch1scApn2sn2' TitleID='1' PartID='2' SectionID='2' Citation='1CFR2.2' HasText='Yes' > 2.2 - Administrative Committee of the Federal Register. </Section> <Section id='ti1st_ch1scApn2sn3' TitleID='1' PartID='2' SectionID='3' Citation='1CFR2.3' HasText='Yes' > 2.3 - Office of the Federal Register; location; office hours. </Section> <Section id='ti1st_ch1scApn2sn4' TitleID='1' PartID='2' SectionID='4' Citation='1CFR2.4' HasText='Yes' > 2.4 - General authority of Director. </Section> <Section id='ti1st_ch1scApn2sn5' TitleID='1' PartID='2' SectionID='5' Citation='1CFR2.5' HasText='Yes' > 2.5 - Publication of statutes, regulations, and related documents. </Section> <Section id='ti1st_ch1scApn2sn6' TitleID='1' PartID='2' SectionID='6' Citation='1CFR2.6' HasText='Yes' > 2.6 - Unrestricted use. </Section> </Sections> </Part> </Parts> </Subchapter> </Subchapters> </Chapter> </Chapters> </Title> </Titles> </CFRToc>
Sample XHTML presentation code for a TOC at the part level:
<?xml version="1.0" encoding = "UTF-8" ?> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en' > <head> <title> Table of Contents for the U.S. Code of Federal Regulations </title> <link rel='stylesheet' href='CFRToc.css' type='text/css' /> </head> <body> <table width='100%' border='0' cellpadding='0' cellspacing = '0' align='center'> <tr><td height='80px' width='70px' padding-left='0px' padding-right='0px'> <img src='OakLeaf.gif' height='80px' width='70px' border='0' /></td><td> OakLeaf Systems<br />Tables of Contents for the Online U.S. Code of Federal Regulations Delivered by<br />An XML Web Service from <i>XML Web Services with Visual Basic .NET</i> </td></tr> </table> <table width='100%' border='0' align='center'> <th colspan='2'>Sections of the U.S. Code of Federal Regulations (Click a Citation for Section Text)</th> <tbody style='behavior:url(CFRToc.htc)' slColor='#d0d0e0' hlColor='e8e8f8' txColor='#266294'> <tr id='titles' class='Header'> <td>TITLES</td><td>Return to Titles Table of Contents</td> </tr> <tr id='ti1st_' class='Header'> <td>TITLE 1</td><td>GENERAL PROVISIONS</td> </tr> <tr id='ti1st_ch1sc_' class='Header'> <td width='20%'>Chapter I</td><td>Administrative Committee of the Federal Register (Parts 1 - 49)</td> </tr> <tr id='ti1st_ch1scA' class='Header'> <td width='20%'>SUBCHAPTER A</td><td>GENERAL</td> </tr> <tr id='ti1st_ch1scApn2' class='Header'> <td width='15%'>Part 2</td><td>General Information</td> </tr> <tr id='ti1st_ch1scApn2sn1' class='Normal'> <td width='15%'>1CFR2.1</td><td>Scope and purpose.</td> </tr> <tr id='ti1st_ch1scApn2sn2' class='Normal'> <td width='15%'>1CFR2.2</td><td>Administrative Committee of the Federal Register.</td> </tr> <tr id='ti1st_ch1scApn2sn3' class='Normal'> <td width='15%'>1CFR2.3</td><td>Office of the Federal Register; location; office hours.</td> </tr> <tr id='ti1st_ch1scApn2sn4' class='Normal'> <td width='15%'>1CFR2.4</td><td>General authority of Director.</td> </tr> <tr id='ti1st_ch1scApn2sn5' class='Normal'> <td width='15%'>1CFR2.5</td><td>Publication of statutes, regulations, and related documents.</td> </tr> <tr id='ti1st_ch1scApn2sn6' class='Normal'> <td width='15%'>1CFR2.6</td><td>Unrestricted use.</td> </tr> </tbody> </table> </body> </html>
Sample SGML text retrieved from the e-CFR database (line-breaks added):
<SECTION CHRCNT='1364'> <BIBINF> <BTI>1 CFR</BTI> <BTISB>General Provisions </BTISB> <BCH>CHAPTER I</BCH> <BCHSB>ADMINISTRATIVE COMMITTEE OF THE FEDERAL REGISTER </BCHSB> <BSUBCH>SUBCHAPTER A</BSUBCH> <BSUBCHSB>GENERAL </BSUBCHSB> <BPT>PART 2</BPT> <BPTSB>GENERAL INFORMATION</BPTSB> <BIBSRT>01000000002</BIBSRT> <BSEC>Sec. 2.5</BSEC> <BSECCT>1364</BSECCT> </BIBINF> <SECTNO>§&thnsp;2.5</SECTNO> <SUBJECT>Publication of statutes, regulations, and related documents. </SUBJECT> <P>(a) The Director of the Federal Register is responsible for the central filing of the original acts enacted by Congress and the original documents containing Executive orders and proclamations of the President, other Presidential documents, regulations, and notices of proposed rulemaking and other notices, submitted to the Director by officials of the executive branch of the Federal Government. </P> <P>(b) Based on the acts and documents filed under paragraph (a) of this section, the Office of the Federal Register publishes the “slip laws,” the “United States Statutes at Large,” the daily <E T="04">Federal Register</E> and the “Code of Federal Regulations.” </P> <P>(c) Based on source materials that are officially related to the acts and documents filed under paragraph (a) of this section, the Office also publishes “The United States Government Manual,” the “Public Papers of the Presidents of the United States,” the “Weekly Compilation of Presidential Documents,” the “Federal Register Index,” and the “LSA (List of CFR Sections Affected)”. </P> <CITA TYPE="N">[37 FR 23603, Nov. 4, 1972, as amended at 54 FR 9676, Mar. 7, 1989]</CITA> </SECTION>
OakLeaf XML document for the preceding sample SGML text:
<?xml version="1.0" encoding = "UTF-8" ?> <CFRSect xmlns:CFRSections="http://localhost/CFR/Sections" > <Header> <Volume>Title 1 from Electronic CFR (eCFR Beta)</Volume> <Revised>Current as of September 15, 2001</Revised> <Citation>1CFR2.5</Citation> <Title>1 - GENERAL PROVISIONS</Title> <Subtitle></Subtitle> <Chapter>Chapter I - Administrative Committee of the Federal Register</Chapter> <Subchapter>SUBCHAPTER A - GENERAL</Subchapter> <Part>Part 2 - General Information</Part> <Subpart></Subpart> <Section>Sec. 2.5 - Publication of statutes, regulations, and related documents.</Section> </Header> <Body> <Para1> <Para2> (a) The Director of the Federal Register is responsible for the central filing of the original acts enacted by Congress and the original documents containing Executive orders and proclamations of the President, other Presidential documents, regulations, and notices of proposed rulemaking and other notices, submitted to the Director by officials of the executive branch of the Federal Government. </Para2> <Para2> (b) Based on the acts and documents filed under paragraph (a) of this section, the Office of the Federal Register publishes the 'slip laws,' the 'United States Statutes at Large,' the daily Federal Register and the 'Code of Federal Regulations.' </Para2> <Para2> (c) Based on source materials that are officially related to the acts and documents filed under paragraph (a) of this section, the Office also publishes 'The United States Government Manual,' the 'Public Papers of the Presidents of the United States,' the 'Weekly Compilation of Presidential Documents,' the 'Federal Register Index,' and the 'LSA (List of CFR Sections Affected)'. </Para2> </Para1> </Body> <FedReg> [37 FR 23603, Nov. 4, 1972, as amended at 54 FR 9676, Mar. 7, 1989] </FedReg> </CFRSect>
Sample XHTML presentation code for section text:
<?xml version="1.0" encoding = "UTF-8" ?> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en' > <head> <title> Title 1 from Electronic CFR (eCFR Beta) </title> <link rel='stylesheet' href='CFRSect.css' type='text/css' /> </head> <body> <table width='93%' border='0' cellpadding='0' cellspacing = '0' align='center'> <tr><td height='80px' width='70px' padding-left='0px' padding-right='0px'> <img src='OakLeaf.gif' height='80px' width='70px' border='0' /></td><td> OakLeaf Systems<br />Sections of the Online U.S. Code of Federal Regulations Delivered by<br />An XML Web Service from <i>XML Web Services with Visual Basic. NET</i></td></tr> </table> <table width='93%' border='0' align='center'> <th colspan='2'>Title 1 from Electronic CFR (eCFR Beta)</th> <tr id='noTag' valign='top'><td>Revised</td><td>Current as of January 1, 2001</td></tr> <tr id='noTag' valign='top'><td>Citation</td><td>1CFR2.5</td> </tr> <tbody style='behavior:url(CFRToc.htc)' slColor='#d0d0e0' hlColor='e8e8f8' txColor='#266294'> <tr id='ti1st_' valign='top'><td>TITLE</td><td>1 - GENERAL PROVISIONS</td></tr> <tr id='ti1st_ch1sc_' valign='top'><td>Chapter</td><td>I - Administrative Committee of the Federal Register</td></tr> <tr id='ti1st_ch1scA' valign='top'><td>SUBCHAPTER</td><td>A - GENERAL</td></tr> <tr id='ti1st_ch1scApn2' valign='top'><td>Part</td><td>2 - General Information</td></tr> </tbody> <tr id='noTag' valign='top'><td>Section</td><td>2.5 - Publication of statutes, regulations, and related documents.</td></tr> </table><br /> <div class='Body'> <p class='Para2'>(a) The Director of the Federal Register is responsible for the central filing of the original acts enacted by Congress and the original documents containing Executive orders and proclamations of the President, other Presidential documents, regulations, and notices of proposed rulemaking and other notices, submitted to the Director by officials of the executive branch of the Federal Government. </p> <p class='Para2'>(b) Based on the acts and documents filed under paragraph (a) of this section, the Office of the Federal Register publishes the 'slip laws,' the 'United States Statutes at Large,' the daily Federal Register and the 'Code of Federal Regulations.' </p> <p class='Para2'>(c) Based on source materials that are officially related to the acts and documents filed under paragraph (a) of this section, the Office also publishes 'The United States Government Manual,' the 'Public Papers of the Presidents of the United States,' the 'Weekly Compilation of Presidential Documents,' the 'Federal Register Index,' and the 'LSA (List of CFR Sections Affected)'.</p> </div> <div class='FedReg'> <hr width='93%' color='#266294' align='center' /> <p class='Para1'><b>Federal Register:</b> 37 FR 23603, Nov. 4, 1972, as amended at 54 FR 9676, Mar. 7, 1989</p> </div> <hr width='93%' color='#266294' align='center' /> </body> </html>
Contents of the CFRTocWS.wsdl Web service description file for the SOAP Toolkit versions
The SOAP Toolkit versions of the TOC XML Web service expose two functions of the
CCFRToc.dll component, CFRToc.GetTocById
and CFRToc.GetTocByLevel
.
Both functions return either XML or XHTML, depending on the value of the strTOCType
argument. GetTocById
accepts an argument in ti#st#[ch#[sc#[pn#]]]
format. GetTocByLevel
requires individual values for title,
subtitle, chapter, and so on. In this version, strConnect requires a full ADODB.Connection.ConnectionString
for SQL Server, which is stored in the Global.asa[x] file. A commercial version
would require only an SQL Server user name and password for each CFR
subscriber.
<?xml version='1.0' encoding='UTF-8' ?> <!-- Generated 10/05/01 by Microsoft SOAP Toolkit WSDL File Generator, Version 1.02.813.0 --> <definitions name ='CFRTocWS' targetNamespace = 'http://oakleaf.ws/wsdl/' xmlns:wsdlns='http://oakleaf.ws/wsdl/' xmlns:typens='http://oakleaf.ws/type' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:stk='http://schemas.microsoft.com/soap-toolkit/wsdl-extension' xmlns='http://schemas.xmlsoap.org/wsdl/'> <types> <schema targetNamespace='http://oakleaf.ws/type' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' elementFormDefault='qualified'> </schema> </types> <message name='CFRToc.GetTocById'> <part name='strConnect' type='xsd:string'/> <part name='strURL' type='xsd:string'/> <part name='strTOCType' type='xsd:string'/> <part name='strId' type='xsd:string'/> </message> <message name='CFRToc.GetTocByIdResponse'> <part name='Result' type='xsd:string'/> </message> <message name='CFRToc.GetTocByLevel'> <part name='strConnect' type='xsd:string'/> <part name='strTitleID' type='xsd:string'/> <part name='strSubtitleId' type='xsd:string'/> <part name='strChapterId' type='xsd:string'/> <part name='strSubchapterId' type='xsd:string'/> <part name='strPartID' type='xsd:string'/> <part name='strTOCType' type='xsd:string'/> </message> <message name='CFRToc.GetTocByLevelResponse'> <part name='Result' type='xsd:string'/> </message> <portType name='CFRTocSoapPort'> <operation name='GetTocById' parameterOrder='strConnect strURL strTOCType strId'> <input message='wsdlns:CFRToc.GetTocById' /> <output message='wsdlns:CFRToc.GetTocByIdResponse' /> </operation> <operation name='GetTocByLevel' parameterOrder='strConnect strTitleID strSubtitleId strChapterId strSubchapterId strPartID strTOCType'> <input message='wsdlns:CFRToc.GetTocByLevel' /> <output message='wsdlns:CFRToc.GetTocByLevelResponse' /> </operation> </portType> <binding name='CFRTocSoapBinding' type='wsdlns:CFRTocSoapPort' > <stk:binding preferredEncoding='UTF-8'/> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http' /> <operation name='GetTocById' > <soap:operation soapAction='http://oakleaf.ws/action/CFRToc.GetTocById' /> <input> <soap:body use='encoded' namespace='http://oakleaf.ws/message/' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' /> </input> <output> <soap:body use='encoded' namespace='http://oakleaf.ws/message/' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' /> </output> </operation> <operation name='GetTocByLevel' > <soap:operation soapAction='http://oakleaf.ws/action/CFRToc.GetTocByLevel' /> <input> <soap:body use='encoded' namespace='http://oakleaf.ws/message/' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' /> </input> <output> <soap:body use='encoded' namespace='http://oakleaf.ws/message/' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' /> </output> </operation> </binding> <service name='CFRTocWS' > <port name='CFRTocSoapPort' binding='wsdlns:CFRTocSoapBinding' > <soap:address location='http://localhost/cfr/CFRTocWS.WSDL' /> </port> </service> </definitions>
The SOAP Toolkit's WSDL file for the CCFRSect.dll component's CFRSect.GetSectByID
and CFRSect.GetSection
functions is similar to that for TOC, so
the contents of CFRSectWS.wsdl aren't shown here.
Contents of the CFRSearchWS.wsdl Web service description file for the SOAP Toolkit versions
CFRSearchWS.wsdl exposes only the CFRSearch.GetSearchResults
function
of the CCFRSearch.dll component, but requires seven arguments of three data
types (String
, Short
, and Int32
) to
specify the search conditions.
<?xml version='1.0' encoding='UTF-8' ?> <!-- Generated 10/05/01 by Microsoft SOAP Toolkit WSDL File Generator, Version 1.02.813.0 --> <definitions name ='CFRSearchWS' targetNamespace = 'http://oakleaf.ws/wsdl/' xmlns:wsdlns='http://oakleaf.ws/wsdl/' xmlns:typens='http://oakleaf.ws/type' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:stk='http://schemas.microsoft.com/soap-toolkit/wsdl-extension' xmlns='http://schemas.xmlsoap.org/wsdl/'> <types> <schema targetNamespace='http://oakleaf.ws/type' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' elementFormDefault='qualified'> </schema> </types> <message name='CFRSearch.GetSearchResults'> <part name='strConnect' type='xsd:string'/> <part name='strSearch' type='xsd:string'/> <part name='intMaxHits' type='xsd:short'/> <part name='intMinLevel' type='xsd:short'/> <part name='intMaxLevel' type='xsd:short'/> <part name='strTitleID' type='xsd:string'/> <part name='lngTOCItems' type='xsd:int'/> <part name='lngSectItems' type='xsd:int'/> <part name='strSearchType' type='xsd:string'/> </message> <message name='CFRSearch.GetSearchResultsResponse'> <part name='Result' type='xsd:string'/> </message> <portType name='CFRSearchSoapPort'> <operation name='GetSearchResults' parameterOrder='strConnect strSearch intMaxHits intMinLevel intMaxLevel strTitleID lngTOCItems lngSectItems strSearchType'> <input message='wsdlns:CFRSearch.GetSearchResults' /> <output message='wsdlns:CFRSearch.GetSearchResultsResponse' /> </operation> </portType> <binding name='CFRSearchSoapBinding' type='wsdlns:CFRSearchSoapPort' > <stk:binding preferredEncoding='UTF-8'/> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http' /> <operation name='GetSearchResults' > <soap:operation soapAction='http://oakleaf.ws/action/CFRSearch.GetSearchResults' /> <input> <soap:body use='encoded' namespace='http://oakleaf.ws/message/' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' /> </input> <output> <soap:body use='encoded' namespace='http://oakleaf.ws/message/' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' /> </output> </operation> </binding> <service name='CFRSearchWS' > <port name='CFRSearchSoapPort' binding='wsdlns:CFRSearchSoapBinding' > <soap:address location='http://localhost/cfr/CFRSearchWS.WSDL' /> </port> </service> </definitions>