Difference between revisions of "New Citation Style HowTo"
m (→Related links) |
m (→Root Element) |
||
Line 66: | Line 66: | ||
include-default-variables="yes" | include-default-variables="yes" | ||
> | > | ||
* ''md-path'' is xpath of the publication metadata location, relative to ''source-placeholder-tag'' | |||
* ''citation-placeholder-tag'' is target tag for the generated snippet citation | |||
* ''include-global-default-variables'', i.e. variables.xml | |||
* ''include-default-variables'', i.e. Test.variables-xml | |||
==== Variables ==== | ==== Variables ==== |
Revision as of 12:14, 15 May 2010
This is a protected page.
Prerequisites[edit]
- java SDK 6
- svn
- maven
- jEdit
Preparations[edit]
$svn co https://zim02.gwdg.de/repos/common/trunk/common_services
$cd common_services/citationmanager
- check whether checkout can be compiled:
$mvn clean install
$cd src/main/resources/CitationStyles
$cp rm Default Test; rm -rf Test/.svn
- add new citation style
Test
in thesrc/main/resources/Schemas/explain-styles.xml
, defineoutput-formats
- get nice items-list XML from PubMan live, create src/test/resources/testFiles/Test directory, and save the XML into it under name
TestCollection.xml
. - changes in
src/test/java/test/TestCitationManager.java
:- define path to the new item list in the
itemListsFIleNames
hash- put("Test", "target/test-classes/testFiles/Test/TestCollection.xml");
- create new JUnit test new ctation style
testCitationStyleTest
. - set
testCitationStyles
to@Ignore
- define path to the new item list in the
Citation Style specifications[edit]
See APA and AJP pages as platform for citation style specifications and discussions.
The test item list XML has two types of publication items, namely Article and Book Chapter, thus Test citation style will have two different layout representations (so-called Citation Style Layout Definitions, CSLDs). Authors and Year blocks will be basic for both CSLDs.
Authors[edit]
- family name, initials (blank separated), e.g.: Morfill, G. E.
- if there are two authors, connect them with " and ", e.g.: Morfill, G. E. and Khrapak S. A.
- if there are more than 3 authors: commas separate author names, while the last author name is preceded by ", and ". E.g.: Kernis, M. H., Cornell, D. P., Sun, C. R., Berry, A., and Harlow, T.
Year[edit]
issued or published online. issued has higher priority.
Article[edit]
Author, A. A., Author, B. B., and Author, C. C. (Year). Title of article. Title of Periodical, volume(issue number), pages.
Book Chapter[edit]
Author, A. A. and Author, B. B. (Year). Title of book chapter. In Title of book. Source.Place of Publication: Source.Name of Publisher.
Citation style configuration[edit]
Citation style is configured by means of set of XML files, they are located in src/main/resources/CitationStyles/
directory
- global XMLs, i.e. all specified elements can be used overall in citation styles:
font-styles.xml
: list of available font style definitions.functions.xml
: global function definitionsvariables.xml
: global variables
- citation style specific XMLs:
Test/CitationStyle.xml
: main citation style configuration fileTest/variables.xml
: local variables xml, available only in Test citation style
CitationStyle.xml structure[edit]
Root Element[edit]
<citation-style xmlns="http://www.escidoc.de/citationstyle" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.escidoc.de/citationstyle ../../Schemas/citation-style.xsd" name="Test" read-only="no" element-specific="no" md-xpath="../../mdr:md-records/mdr:md-record" source-placeholder-tag="prop:content-model-specific" citation-placeholder-tag="dcterms:bibliographicCitation" include-global-default-variables="yes" include-default-variables="yes" >
- md-path is xpath of the publication metadata location, relative to source-placeholder-tag
- citation-placeholder-tag is target tag for the generated snippet citation
- include-global-default-variables, i.e. variables.xml
- include-default-variables, i.e. Test.variables-xml
Variables[edit]
Predefined Layout Elements[edit]
Citation Style Layout Definitions[edit]
Debugging procedure[edit]
Plain tests[edit]
Debugging life circle consists of 3 consequent steps: validation, compilation and output. Compilation should always take place after any changes in citation style configuration file in order to have a correct output.
- start test with
$mvn -Dtest=TestCitationManager test
- check console output and
target/surefire-reports/test.TestCitationManager.txt
for errors. - check generated outputs in formats: pdf and escidoc_snippet in
target/
directory. The outputs should not be empty and have list of rendered citations.
Substantial tests[edit]
make possible to check the citations content. It helps to avoid some by-effects due to changes in the global functions and variables. It makes sense to run the tests after the plain tests.
- update
- generate escidoc_snippet output
- copy
- update items in testFiles/Test/TestCollection.xml
- start test with
$mvn -Dtest=TestCitationStylesSubstantial test
Related links[edit]
- CitationStyleConfigurationConcept
- APA and AJP specifications
- XML Schema