-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildDocBook.xsl
1122 lines (1091 loc) · 44.9 KB
/
buildDocBook.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0"?>
<!--
'$RCSfile: buildDocBook.xsl,v $'
Copyright: 1997-2002 Regents of the University of California,
University of New Mexico, and
Arizona State University
Sponsors: National Center for Ecological Analysis and Synthesis and
Partnership for Interdisciplinary Studies of Coastal Oceans,
University of California Santa Barbara
Long-Term Ecological Research Network Office,
University of New Mexico
Center for Environmental Studies, Arizona State University
Other funding: National Science Foundation (see README for details)
The David and Lucile Packard Foundation
For Details: http://knb.ecoinformatics.org/
'$Author: obrien $'
'$Date: 2009-02-26 21:10:21 $'
'$Revision: 1.62 $'
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:doc="eml://ecoinformatics.org/documentation-2.1.1"
version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:output doctype-public="-//OASIS//DTD DocBook XML V4.1.2//EN"
doctype-system="http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"/>
<xsl:template match="/">
<book>
<bookinfo>
<title>Ecological Metadata Language (EML) Specification</title>
</bookinfo>
<chapter id="preface">
<title>Preface</title>
<section id="introduction">
<title>Introduction</title>
<para>
The Ecological Metadata Language (EML) is a metadata standard developed by
the ecology discipline and for the ecology discipline. It is based on
prior work done by the Ecological Society of America and associated
efforts (Michener et al., 1997, Ecological Applications). EML is
implemented as a series of XML document types that can by used in a
modular and extensible manner to document ecological data. Each EML
module is designed to describe one logical part of the total metadata
that should be included with any ecological dataset.
</para>
</section>
<section id="purpose">
<title>Purpose Statement</title>
<para>
To provide the ecological community with an extensible, flexible,
metadata standard for use in data analysis and archiving that will
allow automated machine processing, searching and retrieval.
</para>
</section>
<section id="features">
<title>Features</title>
<para>
The architecture of EML was designed to serve the needs of the
ecological community, and has benefitted from previous work in other
related metadata languages. EML has adopted the strengths of many of
these languages, but also addresses a number of short-comings that
have proved to inhibit the automated processing and integration of
dataset resources via their metadata.
</para>
<para>
The following list represents some of the features of EML:
</para>
<itemizedlist>
<listitem>
<para>
Modularity: EML was designed as a collection of modules rather than
one large standard to facilitate future growth of the language in both
breadth and depth. By implementing EML with an extensible
architecture, groups may choose which of the core modules are
pertinent to describing their data, literature, and software
resources. Also, if EML falls short in a particular area, it may be
extended by creating a new module that describes the resource (e.g. a
detailed soils metadata profile that extends eml-dataset). The intent
is to provide a common set of core modules for information exchange,
but to allow for future customizations of the language without the
need of going through a lengthy 'approval' process.
</para>
</listitem>
<listitem>
<para>
Detailed Structure: EML strives to balance the tradeoff of too much
detail with enough detail to enable advanced services in terms of
processing data through the parsing of accompanied metadata.
Therefore, a driving question throughout the design was: 'Will this
particular piece of information be machine-processed, just human
readable, or both?' Information was then broken down into more highly
structured elements when the answer involved machine processing.
</para>
</listitem>
<listitem>
<para>
Compatibility: EML adopts much of it's syntax from the other metadata
standards that have evolved from the expertise of groups in other
disciplines. Whenever possible, EML adopted entire trees of
information in order to facilitate conversion of EML documents into
other metadata languages. EML was designed with the following
standards in mind: Dublin Core Metadata Initiative, the Content
Standard for Digital Geospatial Metadata (CSDGM from the US geological
Survey's Federal Geographic Data Committee (FGDC)), the Biological
Profile of the CSDGM (from the National Biological Information
Infrastructure), the International Standards Organization's Geographic
Information Standard (ISO 19115), the ISO 8601 Date and Time Standard,
the OpenGIS Consortiums's Geography Markup Language (GML), the
Scientific, Technical, and Medical Markup Language (STMML), and the
Extensible Scientific Interchange Language (XSIL).
</para>
</listitem>
<listitem>
<para>
Strong Typing: EML is implemented in an Extensible Markup Language
(XML) known as <ulink url="http://www.w3.org/XML/Schema">XML
Schema</ulink>, which is a language that defines the rules
that govern the EML syntax. XML Schema is an internet recommendation
from the <ulink url="http://www.w3.org">World Wide Web Consortium</ulink>,
and so a
metadata document that is said to comply with the syntax of EML will
structurally meet the criteria defined in the XML Schema documents for
EML. Over and above the structure (what elements can be nested within
others, cardinality, etc.), XML Schema provides the ability to use
strong
data typing within elements. This allows for finer validation of the
contents of the element, not just it's structure. For instance, an
element may be of type 'date', and so the value that is inserted in
the field will be checked against XML Schema's definition of a date.
Traditionally, XML documents (including previous versions of EML)
have been validated against Document Type
Definitions (DTDs), which do not provide a means to employ strong
validation on field values through typing.
</para>
</listitem>
<listitem>
<para>
There is a distinction between the content model (i.e. the concepts
behind the structure of a document - which fields go where, cardinality,
etc.) and the syntactic implementation of that model (the technology
used to express the concepts defined in the content model).
The normative sections below define the content model and the
XML Schema documents distributed with EML define the syntactic
implementation. For the foreseeable future, XML Schema will be the
syntactic specification, although it may change later.
</para>
</listitem>
</itemizedlist>
</section>
</chapter>
<chapter id="moduleOverview">
<title>Overview of EML modules and their use</title>
<section>
<title>Module Overview Foreword</title>
<para>
The following section briefly describes each EML module and how they
are logically designed in order to document ecological resources.
Some of the modules are dependent on others, while others may be used
as stand-alone descriptions. This section describes the modules using
a "top down" approach, starting from the top-level eml wrapper
module, followed by modules of increasing detail. However, there are
modules that may be used at many levels, such as eml-access.
These modules are described when it is appropriate.
</para>
</section>
<section>
<title>
Root-level structure
</title>
<!-- Get the eml module description from the xsd file -->
<xsl:apply-templates
select="document('eml.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-resource module description from the xsd file -->
<xsl:apply-templates
select="document('eml-resource.xsd')//doc:moduleDescription/*"
mode="copy"/>
</section>
<section>
<title>
Top-level resources
</title>
<para>
The following four modules are used to describe separate resources:
datasets, literature, software, and protocols. However, note that
the dataset module makes use of the other top-level modules by
importing them at different levels. For instance, a dataset may
have been produced using a particular protocol, and that protocol
may come from a protocol document in a library of protocols.
Likewise, citations are used throughout the top-level resource
modules by importing the literature module.
</para>
<!-- Get the eml-dataset module description from the xsd file -->
<xsl:apply-templates
select="document('eml-dataset.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-literature module description from the xsd file -->
<xsl:apply-templates
select="document('eml-literature.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-software module description from the xsd file -->
<xsl:apply-templates
select="document('eml-software.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-protocol module description from the xsd file -->
<xsl:apply-templates
select="document('eml-protocol.xsd')//doc:moduleDescription/*"
mode="copy"/>
</section>
<section>
<title>
Supporting Modules - Adding detail to top-level resources
</title>
<para>
The following six modules are used to qualify the resources being
described in more detail. They are used to describe access control
rules, distribution of the metadata and data themselves, parties
associated with the resource, the geographic, temporal, and
taxonomic extents of the resource, the overall research context of
the resource, and detailed methodology used for creating the
resource. Some of these modules are imported directly into the
top-level resource modules, often in many locations in order to
limit the scope of the description. For instance, the eml-coverage
module may be used for a particular column of a dataset, rather
than the entire dataset as a whole.
</para>
<!-- Get the eml-access module description from the xsd file -->
<xsl:apply-templates
select="document('eml-access.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-physical module description from the xsd file -->
<xsl:apply-templates
select="document('eml-physical.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-party module description from the xsd file -->
<xsl:apply-templates
select="document('eml-party.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-coverage module description from the xsd file -->
<xsl:apply-templates
select="document('eml-coverage.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-project module description from the xsd file -->
<xsl:apply-templates
select="document('eml-project.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-methods module description from the xsd file -->
<xsl:apply-templates
select="document('eml-methods.xsd')//doc:moduleDescription/*"
mode="copy"/>
</section>
<section>
<title>
Data organization - Modules describing dataset structures
</title>
<para>
The following three modules are used to document the logical layout
of a dataset. Many datasets are comprised of multiple entities
(e.g. a series of tabular data files, or a set of GIS features, or a
number of tables in a relational database). Each entity within a
dataset may contain one or more attributes (e.g. multiple columns in
a data file, multiple attributes of a GIS feature, or multiple
columns of a database table). Lastly, there may be both simple or
complex relationships among the entities within a dataset. The
relationships, or the constraints that are to be enforced in the
dataset, are described using the eml-constraint module. All
entities share a common set of information (described using
eml-entity), but some discipline specific entities have
characteristics that are unique to that entity type. Therefore, the
eml-entity module is extended for each of these types (dataTable,
spatialRaster, spatialVector, etc...) which are described
in the next section.
</para>
<!-- Get the eml-entity module description from the xsd file -->
<xsl:apply-templates
select="document('eml-entity.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-attribute module description from the xsd file -->
<xsl:apply-templates
select="document('eml-attribute.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-constraint module description from the xsd file -->
<xsl:apply-templates
select="document('eml-constraint.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!--section>
<title>
The stmml module - Definitions for creating a unit
dictionary in EML
</title>
<para>
<emphasis>This section is not yet complete.</emphasis>
</para>
</section-->
</section>
<section>
<title>
Entity types - Detailed information for discipline specific entities
</title>
<para>
The following six modules are used to describe a number of common
types of entities found in datasets. Each entity type uses the
eml-entity module elements as it's base set of elements, but then
extends the base with entity-specific elements. Note that the
eml-spatialReference module is not an entity type, but is rather a
common set of elements used to describe spatial reference systems
in both eml-spatialRaster and eml-spatialVector. It is described
here in relation to those two modules.
</para>
<!-- Get the eml-dataTable module description from the xsd file -->
<xsl:apply-templates
select="document('eml-dataTable.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-spatialRaster module description from the xsd file -->
<xsl:apply-templates
select="document('eml-spatialRaster.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-spatialVector module description from the xsd file -->
<xsl:apply-templates
select="document('eml-spatialVector.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-spatialReference module description from the xsd file -->
<xsl:apply-templates
select="document('eml-spatialReference.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-storedProcedure module description from the xsd file -->
<xsl:apply-templates
select="document('eml-storedProcedure.xsd')//doc:moduleDescription/*"
mode="copy"/>
<!-- Get the eml-view module description from the xsd file -->
<xsl:apply-templates
select="document('eml-view.xsd')//doc:moduleDescription/*"
mode="copy"/>
</section>
<section>
<title>
Utility modules - Metadata documentation enhancements
</title>
<para>
The following modules are used to highlight the information being
documented in each of the above modules where prose may be needed to
convey the critical metadata. The eml-text module provides a number
of text-based constructs to enhance a document (including sections,
paragraphs, lists, subscript, superscript, emphasis, etc.)
</para>
<xsl:apply-templates
select="document('eml-text.xsd')//doc:moduleDescription/*"
mode="copy"/>
<section>
<title>Dependency Chart</title>
<para>
The multiple modules in EML all depend on each other in complex
ways. To easily see these dependencies see the
<ulink url="eml-dependencies.html">EML Dependency Chart.</ulink>
</para>
</section>
</section>
<section>
<title>
Internationalization - Metadata in multiple languages
</title>
<para>
EML supports internationalization using the i18nNonEmptyStringType.
Fields defined as this type include:
<itemizedlist>
<listitem>
<para>Title</para>
</listitem>
<listitem>
<para>Keyword</para>
</listitem>
<listitem>
<para>Contact information (e.g. names, organizations, addresses)</para>
</listitem>
</itemizedlist>
</para>
<para>
TextType fields also support language translations. These fields include:
<itemizedlist>
<listitem>
<para>Abstract</para>
</listitem>
<listitem>
<para>Methods</para>
</listitem>
<listitem>
<para>Protocol</para>
</listitem>
</itemizedlist>
</para>
<example>
<title>Internationalization techniques</title>
<para>
Core metadata should be provided in English.
The core elements can be augmented with translations in a native language.
Detailed metadata can be provided in the native language as declared using the xml:lang attribute.
Authors can opt to include English translations of this detailed metadata as they see fit.
</para>
<para>
The following example metadata document is provided primarily in Portuguese but includes English translations
of core metadata fields.
The xml:lang="pt_BR" attribute at the root of the EML document indicates that, unless otherwise specified,
the content of the document is supplied in Portuguese (Brazil).
The xml:lang="en_US" attributes on child elements denote that the content of that element is provided in English.
Core metadata (i.e. title) is provided in English, supplemented with a Portuguese translation using the
value tag with an xml:lang attribute. Note that child elements can override the
root language declaration of the document as well as the language declaration of their containing elements.
The abstract element is primarily given in Portuguese (as inherited from the root language declaration),
with an English translation.
</para>
<para>
Many EML fields are repeatable (i.e. keyword) so that multiple values can be provided for the same concept.
Translations for these fields should be included as nested value tags to indicate that they are equivalent concepts
expressed in different languages rather than entirely different concepts.
</para>
<literalLayout>
<?xml version="1.0"?>
<eml:eml
packageId="eml.1.1" system="knb"
xml:lang="pt_BR"
xmlns:eml="eml://ecoinformatics.org/eml-2.1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="eml://ecoinformatics.org/eml-2.1.1 eml.xsd">
<dataset id="ds.1">
<!-- English title with Portuguese translation -->
<title xml:lang=""en_US">
Sample Dataset Description
<value xml:lang="pt_BR">Exemplo Descrição Dataset</value>
</title>
...
<!-- Portuguese abstract with English translation -->
<abstract>
<para>
Neste exemplo, a tradução em Inglês é secundário
<value xml:lang="en_US">In this example, the English translation is secondary</value>
<para>
</abstract>
...
<!-- two keywords, each with an equivalent translation -->
<keywordSet>
<keyword keywordType="theme">
árvore
<value xml:lang="en_US">tree</value>
<keyword>
<keyword keywordType="theme">
água
<value xml:lang="en_US">water</value>
<keyword>
</keywordSet>
...
</dataset>
</eml:eml>
</literalLayout>
</example>
</section>
</chapter>
<chapter id="technicalArch">
<title>Technical Architecture (Normative)</title>
<section>
<title>Introduction</title>
<para>
This section explains the rules of EML. There are some rules that cannot
be written directly into the XML Schemas nor enforced by an XML parser.
These are guidelines that every EML package must follow in order for
it to be considered EML compliant.
</para>
</section>
<section>
<title>Module Structure</title>
<para>
Each EML module, with the exception of "eml" itself, has a top level
choice between the structured content of that modules or a
"references" field. This enables the reuse of content
previously defined elsewhere in the document. Methods for defining
and referencing content are described in the
<link linkend="reusableContent">next</link> section
</para>
</section>
<section id="reusableContent">
<title>Reusable Content</title>
<para>
EML allows the reuse of previously defined structured content (DOM
sub-trees) through the use of key/keyRef type references. In order
for an EML package to remain cohesive and to allow for the cross
platform compatibility of packages, the following rules with respect
to packaging must be followed.
</para>
<itemizedlist>
<listitem>
<para>
An ID is required on the eml root element.
</para>
</listitem>
<listitem>
<para>
IDs are optional on all other elements.
</para>
</listitem>
<listitem>
<para>
If an ID is not provided, that content must be interpreted as
representing a distinct object.
</para>
</listitem>
<listitem>
<para>
If an ID is provided for content then that content is distinct from
all other content except for that content that references its ID.
</para>
</listitem>
<listitem>
<para>
If a user wants to reuse content to indicate the repetition of an
object, a reference must be used. Two identical ids with the same system
attribute cannot exist in a single document.
</para>
</listitem>
<listitem>
<para>
"Document" scope is defined as identifiers unique only to a
single instance document (if a document does not have a system
attribute or if scope is set to 'document' then all IDs are defined
as distinct content).
</para>
</listitem>
<listitem>
<para>
"System" scope is defined as identifiers unique to an entire data
management system (if two documents share a system string, then
any IDs in those two documents that are identical refer to the
same object).
</para>
</listitem>
<listitem>
<para>
If an element references another element, it must not have an
ID itself. The system attribute must have the same value in both the
target and referencing elements or it must be absent in both.
</para>
</listitem>
<listitem>
<para>
All EML packages must have the 'eml' module as the root.
</para>
</listitem>
<listitem>
<para>
The system and scope attribute are always optional except for at the
'eml' module where the scope attribute is fixed as 'system'. The scope
attribute defaults to 'document' for all other modules.
</para>
</listitem>
</itemizedlist>
<section>
<section>
<title>EML Parser</title>
<para>
Because some of these rules cannot be enforced in XML-Schema, we have
written a parser which checks the validity of the references and IDs
used in your document. This parser is included with the 2.1.0 release
of EML. To run the parser, you must have Java 1.3.1 or higher. To
execute it change into the lib directory of the release and run
the 'runEMLParser' script passing your EML instance file as a
parameter. There is also an <ulink url="@server@/@servletdir@">online
version</ulink> of this parser which is publicly accessible. The online
parser will both validate your XML document against the schema as
well as check the integrity of your references.
</para>
</section>
<title>ID and Scope Examples</title>
<section>
<title>Example Documents</title>
<example>
<title>Invalid EML due to duplicate identifiers</title>
<literalLayout>
<?xml version="1.0"?>
<eml:eml
packageId="eml.1.1" system="knb"
xmlns:eml="eml://ecoinformatics.org/eml-2.1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="eml://ecoinformatics.org/eml-2.1.1 eml.xsd">
<dataset id="ds.1">
<title>Sample Dataset Description</title>
<!-- the two creators have the same id. this should be an error-->
<creator id="23445" scope="document">
<individualName>
<surName>Smith</surName>
</individualName>
</creator>
<creator id="23445" scope="document">
<individualName>
<surName>Myer</surName>
</individualName>
</creator>
...
</dataset>
</eml:eml>
</literalLayout>
<section>
<para>This instance document is invalid because both creator
elements have the same id. No two elements can have the
same string as an id.</para>
</section>
</example>
<example>
<title>Invalid EML due to a non-existent reference</title>
<literalLayout>
<?xml version="1.0"?>
<eml:eml
packageId="eml.1.1" system="knb"
xmlns:eml="eml://ecoinformatics.org/eml-2.1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="eml://ecoinformatics.org/eml-2.1.1 eml.xsd">
<dataset id="ds.1">
<title>Sample Dataset Description</title>
<creator id="23445" scope="document">
<individualName>
<surName>Smith</surName>
</individualName>
</creator>
<creator id="23446" scope="document">
<individualName>
<surName>Myer</surName>
</individualName>
</creator>
...
<contact>
<references>23447</references>
</contact>
</dataset>
</eml:eml>
</literalLayout>
<section>
<para>This instance document is invalid because the contact
element references an id that does not exist. Any referenced
id must exist.</para>
</section>
</example>
<example>
<title>Invalid EML due to a conflicting id attribute and a
<references> element</title>
<literalLayout>
<?xml version="1.0"?>
<eml:eml
packageId="eml.1.1" system="knb"
xmlns:eml="eml://ecoinformatics.org/eml-2.1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="eml://ecoinformatics.org/eml-2.1.1 eml.xsd">
<dataset id="ds.1">
<title>Sample Dataset Description</title>
<creator id="23445" scope="document">
<individualName>
<surName>Smith</surName>
</individualName>
</creator>
<creator id="23446" scope="document">
<individualName>
<surName>Meyer</surName>
</individualName>
</creator>
...
<contact id="522">
<references>23445</references>
</contact>
</dataset>
</eml:eml>
</literalLayout>
<section>
<para>This instance document is invalid because the contact
element both references another element and has an id itself.
If an element references another element, it may not have
an id. This prevents circular references.</para>
</section>
</example>
<example>
<title>A valid EML document</title>
<literalLayout>
<?xml version="1.0"?>
<eml:eml
packageId="eml.1.1" system="knb"
xmlns:eml="eml://ecoinformatics.org/eml-2.1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="eml://ecoinformatics.org/eml-2.1.1 eml.xsd">
<dataset id="ds.1">
<title>Sample Dataset Description</title>
<creator id="23445" scope="document">
<individualName>
<surName>Smith</surName>
</individualName>
</creator>
<creator id="23446" scope="document">
<individualName>
<surName>Smith</surName>
</individualName>
</creator>
...
<contact>
<references>23446</references>
</contact>
<contact>
<references>23445</references>
</contact>
</dataset>
</eml:eml>
</literalLayout>
<section>
<para>This instance document is valid. Each contact is
referencing one of the creators above and all the ids are
unique.</para>
</section>
</example>
</section>
</section>
</section>
</chapter>
<chapter id="moduleDescriptions">
<title>Module Descriptions (Normative)</title>
<xsl:for-each select="//doc:module">
<xsl:variable name="moduleNameVar">
<!-- save the name of the module we are in in this loop-->
<xsl:value-of select="document(.)//doc:moduleName"/>.xsd
</xsl:variable>
<xsl:variable name="importedByList">
<!--this is the variable that will be sent to the template-->
<xsl:for-each select="/xs:schema/xs:annotation/xs:appinfo/doc:moduleDocs/doc:module">
<xsl:variable name="currentModuleName">
<!--save the name of the module that we are in this loop-->
<xsl:value-of select="."/>
</xsl:variable>
<xsl:for-each select="document(.)//xs:import">
<!-- go through each import statement and see if the current module is there -->
<xsl:if test="normalize-space($moduleNameVar)=normalize-space(./@schemaLocation)">
<!-- if it is put it in the variable -->
<xsl:value-of select="substring($currentModuleName, 0,
string-length($currentModuleName) - 3)"/>
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:variable>
<xsl:apply-templates select="document(.)//doc:moduleDocs">
<!--send the importedBy variable to this stylesheet-->
<xsl:with-param name="importedBy" select="$importedByList"/>
</xsl:apply-templates>
</xsl:for-each>
</chapter>
<index id="index">
<title>Index</title>
<indexdiv>
<title>A</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:sort select="@name" data-type="text"/>
<xsl:if test="starts-with(@name, 'a')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>B</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'b')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>C</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'c')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>D</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'd')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>E</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'e')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>F</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'f')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>G</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'g')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>H</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'h')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>I</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'i')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>J</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'j')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>k</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'k')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>L</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'l')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>M</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'm')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>N</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'n')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>O</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'o')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>P</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'p')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>Q</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'q')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'r')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>S</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 's')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>T</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 't')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>U</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'u')">
<xsl:apply-templates select="." mode="indexentry"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</indexdiv>
<indexdiv>
<title>V</title>
<xsl:for-each select="//doc:module">
<xsl:for-each select="document(.)//xs:element">
<xsl:if test="starts-with(./@name, 'v')">