Control Order for XSLT in MARC21slim2English.xsl

I’ve tried to use MARC21slim2English.xsl to show USMARC in user-friendly form. I found that the xsl doesn’t give a possibility to change order of items, but just copied the order of original MARC21 record.


I had to add a lot of apply-templates to be able to set the order as I want, e.g. show title first, then Authors etc.


The extra XSLT commands were added to modified MARC21slim2English.xsl , but it should be possible to use import command to keep existing MARC21slim2English.xsl and my code in separate files.
The added templates can be viewed here.

Advertisements

Control Order for XSLT in MARC21slim2English.xsl

I’ve tried to use MARC21slim2English.xsl to show USMARC in user-friendly form. I found that the xsl doesn’t give a possibility to change order of items, but just copied the order of original MARC21 record.

I had to add a lot of apply-templates to be able to set the order as I want, e.g. show title first, then Authors etc.

The extra XSLT commands were added to modified MARC21slim2English.xsl , but it should be possible to use import command to keep existing MARC21slim2English.xsl and my code in separate files.
The additional XSLT templates are the following:

      <xsl:template match=/>

            <html>

      <xsl:apply-templates select=marc:record />

    </html>

      </xsl:template>

 

  <xsl:template match=marc:record>

    <!– change the order of fields as required–>

    <!–TITLE STATEMENT–>

    <xsl:apply-templates select=marc:datafield[@tag=245] />

    <!–MAIN ENTRY- -PERSONAL NAME–>

    <xsl:apply-templates select=marc:datafield[@tag=100] />

 

    <!–NOTE for the following apply templates description is shown below the command   –>

   

    <xsl:apply-templates select=marc:datafield[@tag=110] />

    <!–MAIN ENTRY – CORPORATE NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=111] />

    <!–MAIN ENTRY – MEETING NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=700] />

    <!–ADDED ENTRY – PERSONAL NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=710] />

    <!–ADDED ENTRY – CORPORATE NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=711] />

    <!–ADDED ENTRY – MEETING NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=720] />

    <!–ADDED ENTRY – UNCONTROLLED NAME  –>

 

    <!–    TODO: re-sort them in USER-friendly order –>

   

    <xsl:apply-templates select=marc:datafield[@tag=010] />

    <!–LIBRARY OF CONGRESS CONTROL NUMBER–>

    <xsl:apply-templates select=marc:datafield[@tag=011] />

    <!–LINKING LIBRARY OF CONGRESS CONTROL NUMBER                          –>

    <xsl:apply-templates select=marc:datafield[@tag=013] />

    <!–PATENT CONTROL INFORMATION  –>

    <xsl:apply-templates select=marc:datafield[@tag=014] />

    <!–LINKAGE NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=015] />

    <!–NATIONAL BIBLIOGRAPHY NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=016] />

    <!–NATIONAL BIBLIOGRAPHIC AGENCY CONTROL NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=017] />

    <!–COPYRIGHT REGISTRATION NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=018] />

    <!–COPYRIGHT ARTICLE-FEE CODE  –>

    <xsl:apply-templates select=marc:datafield[@tag=020] />

    <!–INTERNATIONAL STANDARD BOOK NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=022] />

    <!–INTERNATIONAL STANDARD SERIAL NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=024] />

    <!–OTHER STANDARD IDENTIFIER  –>

    <xsl:apply-templates select=marc:datafield[@tag=025] />

    <!–OVERSEAS ACQUISITION NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=027] />

    <!–STANDARD TECHNICAL REPORT NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=028] />

    <!–PUBLISHER NUMBER FOR MUSIC  –>

    <xsl:apply-templates select=marc:datafield[@tag=030] />

    <!–CODEN DESIGNATION  –>

    <xsl:apply-templates select=marc:datafield[@tag=032] />

    <!–POSTAL REGISTRATION NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=033] />

    <!–DATE/TIME AND PLACE OF AN EVENT  –>

    <xsl:apply-templates select=marc:datafield[@tag=034] />

    <!–CODED CARTOGRAPHIC MATHEMATICAL DATA  –>

    <xsl:apply-templates select=marc:datafield[@tag=036] />

    <!–ORIGINAL STUDY NUMBER FOR COMPUTER DATA FILES  –>

    <xsl:apply-templates select=marc:datafield[@tag=037] />

    <!–SOURCE OF ACQUISITION  –>

    <xsl:apply-templates select=marc:datafield[@tag=039] />

    <!–LEVEL OF BIBLIOGRAPHIC CONTROL AND CODING DETAIL  –>

    <xsl:apply-templates select=marc:datafield[@tag=040] />

    <!–CATALOGING SOURCE  –>

    <xsl:apply-templates select=marc:datafield[@tag=041] />

    <!–LANGUAGE CODE  –>

    <xsl:apply-templates select=marc:datafield[@tag=042] />

    <!–AUTHENTICATION CODE  –>

    <xsl:apply-templates select=marc:datafield[@tag=043] />

    <!–GEOGRAPHIC AREA CODE  –>

    <xsl:apply-templates select=marc:datafield[@tag=044] />

    <!–COUNTRY OF PUBLISHING/PRODUCING ENTITY CODE  –>

    <xsl:apply-templates select=marc:datafield[@tag=045] />

    <!–TIME PERIOD OF CONTENT  –>

    <xsl:apply-templates select=marc:datafield[@tag=046] />

    <!–SPECIAL CODED DATES  –>

    <xsl:apply-templates select=marc:datafield[@tag=047] />

    <!–FORM OF MUSICAL COMPOSITION CODE  –>

    <xsl:apply-templates select=marc:datafield[@tag=048] />

    <!–NUMBER OF MUSICAL INSTRUMENTS OR VOICES CODE  –>

    <xsl:apply-templates select=marc:datafield[@tag=050] />

    <!–LIBRARY OF CONGRESS CALL NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=051] />

    <!–LIBRARY OF CONGRESS COPY, ISSUE, OFFPRINT STATEMENT  –>

    <xsl:apply-templates select=marc:datafield[@tag=052] />

    <!–GEOGRAPHIC CLASSIFICATION  –>

    <xsl:apply-templates select=marc:datafield[@tag=055] />

    <!–CALL NUMBERS/CLASS NUMBERS ASSIGNED IN CANADA  –>

    <xsl:apply-templates select=marc:datafield[@tag=058] />

    <!–OTHER GEOGRAPHIC CLASSIFICATION CODE  –>

    <xsl:apply-templates select=marc:datafield[@tag=060] />

    <!–NATIONAL LIBRARY OF MEDICINE CALL NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=061] />

    <!–NATIONAL LIBRARY OF MEDICINE COPY STATEMENT  –>

    <xsl:apply-templates select=marc:datafield[@tag=066] />

    <!–CHARACTER SETS PRESENT  –>

    <xsl:apply-templates select=marc:datafield[@tag=070] />

    <!–NATIONAL AGRICULTURAL LIBRARY CALL NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=071] />

    <!–NATIONAL AGRICULTURAL LIBRARY COPY STATEMENT  –>

    <xsl:apply-templates select=marc:datafield[@tag=072] />

    <!–SUBJECT CATEGORY CODE  –>

    <xsl:apply-templates select=marc:datafield[@tag=073] />

    <!–TYPE OF PROGRAM OR ORGANIZATION CODE  –>

    <xsl:apply-templates select=marc:datafield[@tag=074] />

    <!–GPO ITEM NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=080] />

    <!–UNIVERSAL DECIMAL CLASSIFICATION NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=082] />

    <!–DEWEY DECIMAL CALL NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=084] />

    <!–OTHER CLASSIFICATION NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=086] />

    <!–GOVERNMENT DOCUMENT CLASSIFICATION NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=088] />

    <!–REPORT NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=090] />

    <!–LOCAL CALL NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=091] />

    <!–MICROFILM SHELF LOCATION  –>

    <xsl:apply-templates select=marc:datafield[@tag=130] />

    <!–MAIN ENTRY – UNIFORM TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=210] />

    <!–ABBREVIATED TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=211] />

    <!–ACRONYM OR SHORTENED TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=212] />

    <!–VARIANT ACCESS TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=214] />

    <!–AUGMENTED TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=222] />

    <!–KEY TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=240] />

    <!–UNIFORM TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=241] />

    <!–ROMANIZED TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=242] />

    <!–TRANSLATION OF TITLE BY CATALOGING AGENCY  –>

    <xsl:apply-templates select=marc:datafield[@tag=243] />

    <!–COLLECTIVE UNIFORM TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=246] />

    <!–VARYING FORM OF TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=247] />

    <!–FORMER TITLE OR TITLE VARIATIONS  –>

    <xsl:apply-templates select=marc:datafield[@tag=250] />

    <!–EDITION STATEMENT  –>

    <xsl:apply-templates select=marc:datafield[@tag=254] />

    <!–MUSICAL PRESENTATION STATEMENT  –>

    <xsl:apply-templates select=marc:datafield[@tag=255] />

    <!–CARTOGRAPHIC MATHEMATICAL DATA  –>

    <xsl:apply-templates select=marc:datafield[@tag=256] />

    <!–COMPUTER FILE CHARACTERISTICS  –>

    <xsl:apply-templates select=marc:datafield[@tag=257] />

    <!–COUNTRY OF PRODUCING ENTITY FOR ARCHIVAL FILMS  –>

    <xsl:apply-templates select=marc:datafield[@tag=260] />

    <!–PUBLICATION, DISTRIBUTION, ETC. (IMPRINT)  –>

    <xsl:apply-templates select=marc:datafield[@tag=263] />

    <!–PROJECTED PUBLICATION DATE  –>

    <xsl:apply-templates select=marc:datafield[@tag=265] />

    <!–SOURCE FOR ACQUISITION/SUBSCRIPTION ADDRESS  –>

    <xsl:apply-templates select=marc:datafield[@tag=270] />

    <!–ADDRESS  –>

    <xsl:apply-templates select=marc:datafield[@tag=300] />

    <!–PHYSICAL DESCRIPTION  –>

    <xsl:apply-templates select=marc:datafield[@tag=301] />

    <!–PHYSICAL DESCRIPTION FOR FILMS (PRE-AACR 2)  –>

    <xsl:apply-templates select=marc:datafield[@tag=302] />

    <!–PAGE OR ITEM COUNT  –>

    <xsl:apply-templates select=marc:datafield[@tag=303] />

    <!–SUBORDINATE ENTITIES  –>

    <xsl:apply-templates select=marc:datafield[@tag=304] />

    <!–LINEAR FOOTAGE  –>

    <xsl:apply-templates select=marc:datafield[@tag=305] />

    <!–PHYSICAL DESCRIPTION FOR SOUND RECORDINGS (Pre-AACR 2)  –>

    <xsl:apply-templates select=marc:datafield[@tag=306] />

    <!–PLAYING TIME  –>

    <xsl:apply-templates select=marc:datafield[@tag=307] />

    <!–HOURS, ETC.  –>

    <xsl:apply-templates select=marc:datafield[@tag=308] />

    <!–PHYSICAL DESCRIPTION FOR FILMS (ARCHIVAL)  –>

    <xsl:apply-templates select=marc:datafield[@tag=310] />

    <!–CURRENT PUBLICATION FREQUENCY  –>

    <xsl:apply-templates select=marc:datafield[@tag=311] />

    <!–MEETING ROOMS AND FACILITIES AVAILABLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=312] />

    <!–EQUIPMENT AVAILABLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=315] />

    <!–FREQUENCY  –>

    <xsl:apply-templates select=marc:datafield[@tag=321] />

    <!–FORMER PUBLICATION FREQUENCY  –>

    <xsl:apply-templates select=marc:datafield[@tag=340] />

    <!–PHYSICAL MEDIUM  –>

    <xsl:apply-templates select=marc:datafield[@tag=342] />

    <!–GEOSPATIAL REFERENCE DATA  –>

    <xsl:apply-templates select=marc:datafield[@tag=343] />

    <!–PLANAR COORDINATE DATA  –>

    <xsl:apply-templates select=marc:datafield[@tag=351] />

    <!–ORGANIZATION AND ARRANGEMENT OF MATERIALS  –>

    <xsl:apply-templates select=marc:datafield[@tag=352] />

    <!–DIGITAL GRAPHIC REPRESENTATION  –>

    <xsl:apply-templates select=marc:datafield[@tag=355] />

    <!–SECURITY CLASSIFICATION CONTROL  –>

    <xsl:apply-templates select=marc:datafield[@tag=357] />

    <!–ORIGINATOR DISSEMINATION CONTROL  –>

    <xsl:apply-templates select=marc:datafield[@tag=359] />

    <!–RENTAL PRICE  –>

    <xsl:apply-templates select=marc:datafield[@tag=362] />

    <!–DATES OF PUBLICATION AND/OR SEQUENTIAL DESIGNATION  –>

    <xsl:apply-templates select=marc:datafield[@tag=440] />

    <!–SERIES STATEMENT/ADDED ENTRY – TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=490] />

    <!–SERIES STATEMENT  –>

    <xsl:apply-templates select=marc:datafield[@tag=500] />

    <!–GENERAL NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=501] />

    <!–WITH NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=502] />

    <!–DISSERTATION NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=503] />

    <!–BIBLIOGRAPHIC HISTORY NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=504] />

    <!–BIBLIOGRAPHY, ETC. NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=505] />

    <!–FORMATTED CONTENTS NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=506] />

    <!–RESTRICTIONS ON ACCESS NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=507] />

    <!–SCALE NOTE FOR GRAPHIC MATERIAL  –>

    <xsl:apply-templates select=marc:datafield[@tag=508] />

    <!–CREATION/PRODUCTION CREDITS NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=510] />

    <!–CITATION/REFERENCES NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=511] />

    <!–PARTICIPANT OR PERFORMER NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=512] />

    <!–EARLIER OR LATER VOLUMES SEPARATELY CATALOGED NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=513] />

    <!–TYPE OF REPORT AND PERIOD COVERED NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=514] />

    <!–DATA QUALITY NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=515] />

    <!–NUMBERING PECULIARITIES NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=516] />

    <!–TYPE OF COMPUTER FILE OR DATA NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=517] />

    <!–CATEGORIES OF FILMS NOTE (ARCHIVAL)  –>

    <xsl:apply-templates select=marc:datafield[@tag=518] />

    <!–DATE/TIME AND PLACE OF AN EVENT NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=520] />

    <!–SUMMARY, ETC.  –>

    <xsl:apply-templates select=marc:datafield[@tag=521] />

    <!–TARGET AUDIENCE NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=522] />

    <!–GEOGRAPHIC COVERAGE NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=523] />

    <!–TIME PERIOD OF CONTENT NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=524] />

    <!–PREFERRED CITATION OF DESCRIBED MATERIALS NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=525] />

    <!–SUPPLEMENT NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=526] />

    <!–STUDY PROGRAM INFORMATION NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=527] />

    <!–CENSORSHIP NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=530] />

    <!–ADDITIONAL PHYSICAL FORM AVAILABLE NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=531] />

    <!–ELIGIBILITY, FEES, PROCEDURES NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=533] />

    <!–REPRODUCTION NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=534] />

    <!–ORIGINAL VERSION NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=535] />

    <!–LOCATION OF ORIGINALS/DUPLICATES NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=536] />

    <!–FUNDING INFORMATION NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=537] />

    <!–SOURCE OF DATA NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=538] />

    <!–SYSTEM DETAILS NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=540] />

    <!–TERMS GOVERNING USE AND REPRODUCTION NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=541] />

    <!–IMMEDIATE SOURCE OF ACQUISITION NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=543] />

    <!–SOLICITATION INFORMATION NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=544] />

    <!–LOCATION OF OTHER ARCHIVAL MATERIALS NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=545] />

    <!–BIOGRAPHICAL OR HISTORICAL DATA  –>

    <xsl:apply-templates select=marc:datafield[@tag=546] />

    <!–LANGUAGE NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=547] />

    <!–FORMER TITLE COMPLEXITY NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=550] />

    <!–ISSUING BODY NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=552] />

    <!–ENTITY AND ATTRIBUTE INFORMATION NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=555] />

    <!–CUMULATIVE INDEX/FINDING AIDS NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=556] />

    <!–INFORMATION ABOUT DOCUMENTATION NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=561] />

    <!–OWNERSHIP AND CUSTODIAL HISTORY  –>

    <xsl:apply-templates select=marc:datafield[@tag=562] />

    <!–COPY AND VERSION IDENTIFICATION NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=565] />

    <!–CASE FILE CHARACTERISTICS NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=567] />

    <!–METHODOLOGY NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=570] />

    <!–EDITOR NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=571] />

    <!–VOLUNTEERS NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=572] />

    <!–AFFILIATION AND OTHER RELATIONSHIPS NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=573] />

    <!–CREDENTIALS NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=574] />

    <!–TRANSPORTATION AND DIRECTIONS NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=575] />

    <!–ACCOMMODATIONS FOR THE DISABLED NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=576] />

    <!–SERVICES AVAILABLE NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=580] />

    <!–LINKING ENTRY COMPLEXITY NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=581] />

    <!–PUBLICATIONS ABOUT DESCRIBED MATERIALS NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=582] />

    <!–RELATED COMPUTER FILES NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=583] />

    <!–ACTION NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=584] />

    <!–ACCUMULATION AND FREQUENCY OF USE NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=585] />

    <!–EXHIBITIONS NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=586] />

    <!–AWARDS NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=587] />

    <!–OTHER INFORMATION AVAILABLE NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=590] />

    <!–LOCAL NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=600] />

    <!–SUBJECT ADDED ENTRY – PERSONAL NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=610] />

    <!–SUBJECT ADDED ENTRY – CORPORATE NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=611] />

    <!–SUBJECT ADDED ENTRY – MEETING NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=630] />

    <!–SUBJECT ADDED ENTRY – UNIFORM TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=650] />

    <!–SUBJECT ADDED ENTRY – TOPICAL TERM  –>

    <xsl:apply-templates select=marc:datafield[@tag=651] />

    <!–SUBJECT ADDED ENTRY – GEOGRAPHIC NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=652] />

    <!–SUBJECT ADDED ENTRY – REVERSED GEOGRAPHIC  –>

    <xsl:apply-templates select=marc:datafield[@tag=653] />

    <!–INDEX TERM – UNCONTROLLED  –>

    <xsl:apply-templates select=marc:datafield[@tag=654] />

    <!–SUBJECT ADDED ENTRY – FACETED TOPICAL TERMS  –>

    <xsl:apply-templates select=marc:datafield[@tag=655] />

    <!–INDEX TERM – GENRE/FORM/PHYSICAL CHARACTERISTICS  –>

    <xsl:apply-templates select=marc:datafield[@tag=656] />

    <!–INDEX TERM – OCCUPATION  –>

    <xsl:apply-templates select=marc:datafield[@tag=657] />

    <!–INDEX TERM – FUNCTION  –>

    <xsl:apply-templates select=marc:datafield[@tag=658] />

    <!–INDEX TERM – CURRICULUM OBJECTIVE  –>

    <xsl:apply-templates select=marc:datafield[@tag=705] />

    <!–ADDED ENTRY – PERSONAL NAME (PERFORMER)  –>

    <xsl:apply-templates select=marc:datafield[@tag=715] />

    <!–ADDED ENTRY – CORPORATE NAME-PERFORMING GROUP  –>

    <xsl:apply-templates select=marc:datafield[@tag=730] />

    <!–ADDED ENTRY – UNIFORM TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=740] />

    <!–ADDED ENTRY – UNCONTROLLED RELATED/ANALYTICAL TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=752] />

    <!–ADDED ENTRY – HIERARCHICAL PLACE NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=753] />

    <!–SYSTEM DETAILS ACCESS TO COMPUTER FILES  –>

    <xsl:apply-templates select=marc:datafield[@tag=754] />

    <!–ADDED ENTRY – TAXONOMIC IDENTIFICATION  –>

    <xsl:apply-templates select=marc:datafield[@tag=755] />

    <!–ADDED ENTRY – PHYSICAL CHARACTERISTICS  –>

    <xsl:apply-templates select=marc:datafield[@tag=760] />

    <!–MAIN SERIES ENTRY  –>

    <xsl:apply-templates select=marc:datafield[@tag=762] />

    <!–SUBSERIES ENTRY  –>

    <xsl:apply-templates select=marc:datafield[@tag=765] />

    <!–ORIGINAL LANGUAGE ENTRY  –>

    <xsl:apply-templates select=marc:datafield[@tag=767] />

    <!–TRANSLATION ENTRY  –>

    <xsl:apply-templates select=marc:datafield[@tag=770] />

    <!–SUPPLEMENT/SPECIAL ISSUE ENTRY  –>

    <xsl:apply-templates select=marc:datafield[@tag=772] />

    <!–PARENT RECORD ENTRY  –>

    <xsl:apply-templates select=marc:datafield[@tag=773] />

    <!–HOST ITEM ENTRY  –>

    <xsl:apply-templates select=marc:datafield[@tag=774] />

    <!–CONSTITUENT UNIT ENTRY  –>

    <xsl:apply-templates select=marc:datafield[@tag=775] />

    <!–OTHER EDITION ENTRY  –>

    <xsl:apply-templates select=marc:datafield[@tag=776] />

    <!–ADDITIONAL PHYSICAL FORM ENTRY  –>

    <xsl:apply-templates select=marc:datafield[@tag=777] />

    <!–ISSUED WITH ENTRY  –>

    <xsl:apply-templates select=marc:datafield[@tag=780] />

    <!–PRECEDING ENTRY  –>

    <xsl:apply-templates select=marc:datafield[@tag=785] />

    <!–SUCCEEDING ENTRY  –>

    <xsl:apply-templates select=marc:datafield[@tag=786] />

    <!–ISSUED WITH ENTRY  –>

    <xsl:apply-templates select=marc:datafield[@tag=787] />

    <!–NONSPECIFIC RELATIONSHIP ENTRY  –>

    <xsl:apply-templates select=marc:datafield[@tag=800] />

    <!–SERIES ADDED ENTRY – PERSONAL NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=810] />

    <!–SERIES ADDED ENTRY – CORPORATE NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=811] />

    <!–SERIES ADDED ENTRY – MEETING NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=830] />

    <!–SERIES ADDED ENTRY – UNIFORM TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=840] />

    <!–SERIES ADDED ENTRY – TITLE  –>

    <xsl:apply-templates select=marc:datafield[@tag=841] />

    <!–HOLDINGS CODED DATA VALUES  –>

    <xsl:apply-templates select=marc:datafield[@tag=842] />

    <!–TEXTUAL PHYSICAL FORM DESIGNATOR  –>

    <xsl:apply-templates select=marc:datafield[@tag=843] />

    <!–REPRODUCTION NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=844] />

    <!–NAME OF UNIT  –>

    <xsl:apply-templates select=marc:datafield[@tag=845] />

    <!–TERMS GOVERNING USE AND REPRODUCTION NOTE  –>

    <xsl:apply-templates select=marc:datafield[@tag=850] />

    <!–HOLDING INSTITUTION  –>

    <xsl:apply-templates select=marc:datafield[@tag=851] />

    <!–LOCATION  –>

    <xsl:apply-templates select=marc:datafield[@tag=852] />

    <!–LOCATION/CALL NUMBER  –>

    <xsl:apply-templates select=marc:datafield[@tag=853] />

    <!–CAPTIONS AND PATTERN – BASIC BIBLIOGRAPHIC UNIT  –>

    <xsl:apply-templates select=marc:datafield[@tag=854] />

    <!–CAPTIONS AND PATTERN – SUPPLEMENTARY MATERIAL  –>

    <xsl:apply-templates select=marc:datafield[@tag=855] />

    <!–CAPTIONS AND PATTERN – INDEXES  –>

    <xsl:apply-templates select=marc:datafield[@tag=856] />

    <!–ELECTRONIC LOCATION AND ACCESS  –>

    <xsl:apply-templates select=marc:datafield[@tag=863] />

    <!–ENUMERATION AND CHRONOLOGY – BASIC BIBLIOGRAPHIC UNIT  –>

    <xsl:apply-templates select=marc:datafield[@tag=864] />

    <!–ENUMERATION AND CHRONOLOGY – SUPPLEMENTARY MATERIAL  –>

    <xsl:apply-templates select=marc:datafield[@tag=865] />

    <!–ENUMERATION AND CHRONOLOGY – INDEXES  –>

    <xsl:apply-templates select=marc:datafield[@tag=866] />

    <!–TEXTUAL HOLDINGS – BASIC BIBLIOGRAPHIC UNIT  –>

    <xsl:apply-templates select=marc:datafield[@tag=867] />

    <!–TEXTUAL HOLDINGS – SUPPLEMENTARY MATERIAL  –>

    <xsl:apply-templates select=marc:datafield[@tag=868] />

    <!–TEXTUAL HOLDINGS – INDEXES  –>

    <xsl:apply-templates select=marc:datafield[@tag=870] />

    <!–VARIANT PERSONAL NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=871] />

    <!–VARIANT CORPORATE NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=872] />

    <!–VARIANT CONFERENCE OR MEETING NAME  –>

    <xsl:apply-templates select=marc:datafield[@tag=873] />

    <!–VARIANT UNIFORM TITLE HEADING  –>

    <xsl:apply-templates select=marc:datafield[@tag=876] />

    <!–ITEM INFORMATION – BASIC BIBLIOGRAPHIC UNIT  –>

    <xsl:apply-templates select=marc:datafield[@tag=877] />

    <!–ITEM INFORMATION – SUPPLEMENTARY MATERIAL  –>

    <xsl:apply-templates select=marc:datafield[@tag=878] />

    <!–ITEM INFORMATION – INDEXES  –>

    <xsl:apply-templates select=marc:datafield[@tag=880] />

    <!–ALTERNATE GRAPHIC REPRESENTATION  –>

    <xsl:apply-templates select=marc:datafield[@tag=886] />

    <!–FOREIGN MARC INFORMATION FIELD  –>

 

 

 

    <!–<xsl:apply-templates select=”marc:datafield” />–>

      <xsl:apply-templates select=marc:leader />

  </xsl:template>

 

 

No way to specify namespace for Typed-Dataset

I am using typed datasets in my C# library and I desided to re-structure files -move .xsd file to sub-folder.
Should it effect my code? I expected, that it shouldn’t. But  namespace of the generated typed-dataset has been changed and broke my code.


It seems there is no way to set it in the way I like – namespace is derived from folder and filename.
This is not good.

Visual Studio 2005 SP1: Unable to detach from one or more processes

I’ve just updated VS 2005 to SP1. I am using WAP project with DevServer and enabled “Edit and Continue”. My common procedure is to start debugging session, do the changes in the code if required, and if the code is blocked by VS(very annoying, but MS doesn’t want to fix it) ,I detaching the debugger from the project. In SP1 it started to show error:
Unable to detach from one or more processes. Operation not supported. Unknown error: 0x80131c32.
It is not always reproducible, but happened a few times during the day. There is similar, but probably unrelated, report in MS feedback.
The workaround is to stop process instead of detaching.

  

Encode Invalid characters in Visual SourceSafe file names.

Some time ago I had to create the utility to rename files with special characters to allow them to be inclyuded in Visual SourceSafe
I’ve used  VBeXpress generator, that had  templates with ‘%’ in file names. Unfortunately the names with ‘%’ like %%Project.Name%%.sln are not acceptable by VSS due to invalid VSS syntax.  This utility copies changed templates to files with encoded names,acceptable by VSS. It’s allowed to check-in/check out individual files(with encoded names) and view thier changes/history.

See the source code of utility file  EncodeInvalidVSSFileNames.dnml :

<dnml>

<!–This file can be run using DotNetScriptEngine.exe from http://www.codeproject.com/dotnet/DotNetScript.asp    –>

<!–Author Michael Freidgeim

    Created 17/8/2004

–>

<reference assembly=System.XML.dll />

<reference assembly=System.Windows.Forms.dll />

<reference assembly=System.Data.dll />

 

<language name=C# />

 

<scriptCode><![CDATA[

using System;

using System.IO;

namespace ValidVSSFileNames

{

      /// <summary>

      /// THe VBeXpress generation templates use ‘%’ in file names.

      /// Unfortunately the names with ‘%’ like %%Project.Name%%.sln  are not acceptable by VSS due to invalid VSS syntax.

      /// This class copies changed templates to files with encoded names,acceptable by VSS.

      /// It’s allowed to check-in/check out individual files(with encoded names) and view thier changes/history.

      /// </summary>

      /// <remarks>

      /// Current version doesn’t check out files, only reports if target file is read-only.

      /// </remarks>

      class ValidVSSFileNames

      {

            static char[] m_InvalidChars= new char[]{‘$’,’@’,'<‘,’>’,'{‘,’}’,'(‘,’)’,’:’,’;’,’=’,’^’,’|’,’*’,’!’,’/’,’\’,’%’,’?’,’,’,”’,'”‘,’t’};

       //mk:@MSITStore:C:Program%20FilesMicrosoft%20Visual%20StudioVSSSSUSEXP.CHM::/html/ssugrnaming_syntax_conventions_and_limitations.htm

            /*          Dollar sign ($)

                        At sign (@)

            Angle brackets (< >), brackets ([ ]), braces ({ }), and parentheses (( ))

            Colon (:) and semicolon (;)

            Equal sign (=)

            Caret sign (^)

            Pipe (vertical bar) (|)

            Asterisk (*)

            Exclamation point (!)

            Forward (/) and backward slash ()

            Percent sign (%)

            Question mark (?)

            Comma (,)

            Quotation mark (single or double) (‘ “)

                        Tab

            */

 

            /// <summary>

            /// The main entry point for the application.

            /// </summary>

            //[STAThread]

            public static int Main()//string[] args)

            {

//                Console.WriteLine(“Start”);       

                  int nRet=0;

//                if(args.Length>0) return nRet=ProcessArgs(args);

//            else

                  Console.WriteLine(“Start in ” + Environment.CurrentDirectory);        

                    ProcessDirectory(Environment.CurrentDirectory );

//                Console.WriteLine(“Press enter to close the application”);       

//                Console.ReadLine();       

                  return nRet;

            }

            /// <summary>

            /// The Process Arguments of command Line

            /// </summary>

            static int ProcessArgs(string[] args)

            {

                  foreach(string path in args)

                  {

                        if(File.Exists(path))

                        {

                              // This path is a file

                              ProcessFile(path);

                        }              

                        else if(Directory.Exists(path))

                        {

                              // This path is a directory

                              ProcessDirectory(path);

                        }

                        else

                        {

                              Console.WriteLine(“{0} is not a valid file or directory.”, path);

                        }       

                  }       

                  return 0;

            }

            /// <summary>

            /// Renames Files that have names with invalid in VSS characters(almost all non-alphanumeric)

            /// Process all files in the directory passed in, recurse on any directories

            /// that are found, and process the files they contain.

            /// </summary>

            //static Function RenameVSSInvalidFileNames(string dirPath)

            public static void ProcessDirectory(string targetDirectory)

            {

                  // Process the list of files found in the directory.

                  string [] fileEntries = Directory.GetFiles(targetDirectory);

                  foreach(string fileName in fileEntries)

                        ProcessFile(fileName);

 

                  // Recurse into subdirectories of this directory.

                  string [] subdirectoryEntries = Directory.GetDirectories(targetDirectory);

                  foreach(string subdirectory in subdirectoryEntries)

                        ProcessDirectory(subdirectory);

            }

        

            // Insert logic for processing found files here.

            public static void ProcessFile(string path)

            {

                        FileInfo fi= new FileInfo(path);

                  string dirPath=fi.Directory.FullName ;

                  if (IsEncodingRequired(fi.Name))

                  {

                              string EncodedName=EncodeName(fi.Name);

                        string pathEncoded=Path.Combine(dirPath,EncodedName);

                        if (File.Exists(pathEncoded))

                        {

                              FileInfo fiEncoded= new FileInfo(pathEncoded);

                              if( fi.LastWriteTime>fiEncoded.LastWriteTime)

                              {

                                    if ((fiEncoded.Attributes & FileAttributes.ReadOnly)==FileAttributes.ReadOnly)

                                    {

                                          Console.WriteLine(” file ‘{0}’ is read only. Check out for processing”, pathEncoded);       

                                    }

                                    else

                                    {

                                          fi.CopyTo (pathEncoded,true);

                                          Console.WriteLine(“Processed file ‘{0}’ into ‘{1}’.”, fi.Name,EncodedName);       

                                    }

                              }

                        }

                        else

                        {

                              fi.CopyTo (pathEncoded,false);

                              Console.WriteLine(“Processed file ‘{0}’ into ‘{1}’.”, fi.Name,EncodedName);       

                        }

                  }

            }

 

            /// <summary>

            /// Checks if name has invalid in VSS characters(almost all non-alphanumeric except ‘_’ )

            /// </summary>

            static bool IsEncodingRequired(string FileName)

            {

                  if ( FileName.IndexOfAny(m_InvalidChars) >=0 ) return true;

                  return false;

            }                                                                                                                                        

            /// <summary>

            ///Encoding is similar to  XmlConvert.EncodeName Method  help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfsystemxmlxmlconvertclassencodenametopic.htm

            ///it uses _xHHHH_ escaping

            /// </summary>

            /// <summary>

            /// Renames names with invalid in VSS characters(almost all non-alphanumeric except ‘_’ )

            /// </summary>

            static string EncodeName(string FileName)

            {

                  string sRet=FileName;

                  if (IsEncodingRequired( FileName))

                  {

                        foreach (char ch in m_InvalidChars)

                        {

                              sRet=sRet.Replace(ch.ToString() , “_x” +((int)ch).ToString(“X4”) + “_”) ;

                        }

                  }                                                                                                                                        

                  return sRet;

            }

      }

}

 

 

]]></scriptCode>

 

</dnml>

 


Links for Code Generator/ and O/R mappers for ASP.NET application

I had a requirement to find Code Generator that will help to port existing quite big Access application to ASP.NET and support multiple databases.

 

The codegeneration.net site provides quite a big list of applications that claims to do this.

 

I also was pointed by Paul Wilson’s  posts: (How do you decide what features to add or cut?, Debate: O/R Mapping or Code Generation  and others) that Dynamic SQLs in O/R mappers allow to avoid hundreds of CRUD stored procedures and DAL classes.
Unfortunately, most of O/R Mapper tool have nothing with web site generation. And most of ASP.Net generators do not use dynamic SQL, but generate stored procedures.
Only two products seem to do both: TierDeveloper–Alachisoft and EntitySpaces.
After downloading TierDeveloper I understood that they generate static parameterized SQL, not using O/R
engine generates queries at runtime. Also tehASP.NET pages they generated are quite messy.

The demo version of EntitySpaces Template Suite for ASP.NET looks very good, and they also have DNN templates, which is important for my development.

 

So it seems that EntitySpaces is the best choice for my project. (Touch the wood, 2 years ago I choose VBExpress generator and I am not much happy with that my choise).

 

UPDATE 29/12/2007: At the moment I am using EntitySpaces and quite happy with them.
I am going to try LINQ to SQL : Related links:
Linq to Sql: The Good, The Bad & The Bottom Line

ScottGu’s tutorials parts 1-9: LINQ to SQL  

See also Linq to Entities

Pro LINQ Object Relational Mapping with C# 2008 Book Review   

 

Below are differnet links that I’ve used for this research.

 

 

1         Overviews

  http://c2.com/cgi/wiki?ObjectRelationalToolComparisonDotNet

 

http://www.codeproject.com/dotnet/CodeGenResource.asp

 

The Code Project Survey: Which .NET data-tier generator do you use?

http://www.codegeneration.net/generators-by-platform.php?target=12&lang=20

http://www.123aspx.com/Directory.aspx?dir=303&ob=ratings&obd=desc&pNo=2

 

“How-To-Select an Object-Relational Mapping Tool for .NET” guide

 

1         Web Site ORM and Generators

 

1.1       EntitySpaces

 

http://www.entityspaces.net/

a free 45 day Trial Version

EntitySpaces Template Suite for ASP.NET

How to purchase

 

1.2       TierDeveloper–Alachisoft

TierDeveloper–Alachisoft

http://www.alachisoft.com/tdev/index.html

an object-to-relational mapping and code generation tool.

Enterprise $1495

Negative comment ,Negative comment

Dynamic SQL –actually generated in Data.Persistence.Factory.

Templates ASPX, not asmx

 

2         Web Site Generators

 

Overviews: http://sharptoolbox.com/categories/code-generators

 

2.1     CodeCharge

 

http://www.yessoftware.com/products/product_detail.php?product_id=1

 

Cost CodeCharge Studio  3.1  $499

Downloaded.

Tried to run against the database.. It stops for each table without primary key and asks to uncheck the table. It was too annoying to continue.

           

2.2       ASP.NET Maker 

 

http://www.hkvstore.com/aspnetmaker/demo.asp%20USD59.95   

Start from US$99.95

Fully working version for 30 days Downloaded

 

)

 

2.3       . Codejay

http://www.codejay.com/products.asp?p=database%20tool

 

 

 

2.4       GenWise Studio

Template-based code generator / IDE for ASP.NET with NHibernate support.

For use with o.a. SQL Server, Oracle, Sybase and MySql.

 

2.5       Iron Speed Designer

http://www.ironspeed.com/products/

an application generator that builds database-driven Web applications for .NET

$595

 

2.6      Web Application Code Generator by Gigaframe

http://www.codegenerator.ca/

No templates, no trial download $129

2.7       IronWorks

 

http://www.esolutionspr.com/IronWorks/

Use templates, Code Generator

2.8       CodeSmith -netTiers Application Framework

http://www.nettiers.com/

 

 

3          O/R mappers

 

See Paul Wilson’s .NET Blog:  The Best O/R Mappers: NHibernate, LLBLGen Pro, and EntityBroker

Also see http://www.mcse.ms/message1405638.html

Blog overview “looking for a good ORM” http://www.bzdz.com/topic/view/14/

Discussions here http://www.theserverside.net/news/thread.tss?thread_id=29914

Overviews: http://www.answers.com/topic/object-relational-mapping , http://www.theserverside.net/news/thread.tss?thread_id=40204#207699

http://madgeek.com/Articles/ORMapping/EN/mapping.htm

 

 

3.1       LLBLGen

http://www.llblgen.com/

Price per license EUR 229.00

Good Comments

Bad comment

3.2       Wilson WebPortal ORMapper

http://www.wilsonwebportal.com/

ORMapper

 

3.3       NHibernate

 

Lesser GPL Licence –is it acceptable?

http://nhibernate.sourceforge.net/

See NHibernate Quick Start Guide.

Support for ASP.NET -No, objects do not have a temporal primary key, they only get a primary key when saved so it is hard (impossible?) to reference them from controls like the Web DataGrid?, you have to add manually support for temporal primary key… or save to the database on each request/response cycle.

Manual creation of Business Objects.

3.4       EntityBroker

 

EntityBroker: Yes objects do have a temporal primary key, they get it when they are created in memory so it is easy to reference them from controls like the Web DataGrid?, and save only when the business transaction is ready.

3.5       TechTalk’s Genome

http://www.genom-e.com/

Support for Microsoft SQL, Oracle and IBM DB2
can switch to LINQ

€ 1800

Eval Downloaded

 

3.6       Frameworks included in the Object Relational Tool Comparison

 

From Object Relational Tool Comparison Dot Net

39. Support for ASP.NET (It means it plays well with the request/response cycle, allows saving objects in the session, unsaved objects have temporary in memory primary keys that allow transactions spanning multiple requests/responses without writing the transaction into the database, etc)(Visually?, Out of the box).

    • AtomsFramework: Unknown
    • GentleNet: Yes, although objects are uniquely identified by the primary key fields, which can be initialized from code or on insert. However, there is special support for caching and uniqing to ensure safe operation in ASP.NET environments.
    • NeoFramework: Unknown
    • OJB.NET: Unknown
    • LLBLGen Pro: Yes, fully supports ASP.NET 2.0 with own datasource control and 2-way databinding. Also fully support for ASP.NET 1.x and object serialization in viewstate/session.
    • NHibernateLibrary: No, objects do not have a temporal primary key, they only get a primary key when saved so it is hard (impossible?) to reference them from controls like the Web DataGrid?, you have to add manually support for temporal primary key… or save to the database on each request/response cycle.
    • Vanatec OpenAccess: Yes

 

 

3.7       EasyObjects.NET

http://www.easyobjects.net/
An Object/Relational Mapper (ORM) library written entirely in C# and built on top of Microsoft’s Enterprise Library and and MyGeneration’s dOOdads,
BL and Database only.

 

3.8       DataObjects.NET

http://www.x-tensive.com/Products/DataObjects.NET/

development of data and business tiers of the database application

 

  3.9      Castle ActiveRecord

http://www.castleproject.org/activerecord/index.html

Castle ActiveRecord is built on top of NHibernate, but its attribute-based mapping free the developer of writing XML for database-to-object mapping, which is needed when using NHibernate directly