I have played around with transforming EAD documents validated by DTDs and both of the schema types available. Schemas are highly dependent on namespaces, and yes, the ead: prefix has to precede all elements references in the XPath statements. This is also true for stylesheets for schema-validated TEI documents, which require all steps in the XPath to be referenced by tei:
Bill Walker
Imaging Field Services Officer
Amigos Library Services,
14400 Midway Road, Dallas, TX 75244-3509
800-843-8482 x2853
972-340-2853 (direct)
972-991-6061 (fax)
www.amigos.org
Email: [log in to unmask]
-----Original Message-----
From: Encoded Archival Description List [mailto:[log in to unmask]] On Behalf Of EAD automatic digest system
Sent: Wednesday, November 09, 2011 11:00 PM
To: [log in to unmask]
Subject: EAD Digest - 8 Nov 2011 to 9 Nov 2011 (#2011-114)
There are 8 messages totalling 483 lines in this issue.
Topics of the day:
1. none of my value-of statements work (7)
2. Sv: Re: none of my value-of statements work
----------------------------------------------------------------------
Date: Wed, 9 Nov 2011 10:56:07 -0500
From: Eric Lease Morgan <[log in to unmask]>
Subject: Re: none of my value-of statements work
Michele Combs:
> Someday perhaps someone will write a nice concise guide for the EAD
> Help =
Pages that lays out the step-by-step process for switching your style sheet= s from DTD to schema, including troubleshooting of things like this...
Is it true then, that other people have had problems migrating their styles= heets as they move from DTD-based EAD files to schema-based ones?
Second, please tell me. Is this the minimum ead declaration I can have to m= ake an EAD file validate against the schema:
<ead
xsi:schemaLocation =3D "http://www.loc.gov/ead/ead.xsd"
xmlns:ns2 =3D "http://www.w3.org/1999/xlink"
xmlns =3D "urn:isbn:1-931666-22-9"
xmlns:xsi =3D "http://www.w3.org/2001/XMLSchema-instance">
If I remove the urn:isbn namespace, then I am able to use my original style= sheet, but then EAD file does not validate.=20
--=20
Eric Lease Morgan
University of Notre Dame
------------------------------
Date: Wed, 9 Nov 2011 18:17:49 +0100
From: Karin Bredenberg <[log in to unmask]>
Subject: Sv: Re: none of my value-of statements work
Hi Eric,
Try to add urn:isbn:1-931666-22-9 in the schemalocation so it looks like =
this: xsi:schemaLocation=3D"urn:isbn:1-931666-22-9 http://www.loc.gov/ead/e= ad.xsd"
You need to have which namespace first and then where the schema is = located to make it find the schema associated with the namespace.
Regards,
Karin Bredenberg
>>> Eric Lease Morgan <[log in to unmask]> 2011-11-09 16:56 >>>
Michele Combs:
> Someday perhaps someone will write a nice concise guide for the EAD
> Help =
Pages that lays out the step-by-step process for switching your style = sheets from DTD to schema, including troubleshooting of things like = this...
Is it true then, that other people have had problems migrating their = stylesheets as they move from DTD-based EAD files to schema-based ones?
Second, please tell me. Is this the minimum ead declaration I can have to = make an EAD file validate against the schema:
<ead
xsi:schemaLocation =3D "http://www.loc.gov/ead/ead.xsd"
xmlns:ns2 =3D "http://www.w3.org/1999/xlink"
xmlns =3D "urn:isbn:1-931666-22-9"
xmlns:xsi =3D "http://www.w3.org/2001/XMLSchema-instance">
If I remove the urn:isbn namespace, then I am able to use my original = stylesheet, but then EAD file does not validate.=20
--=20
Eric Lease Morgan
University of Notre Dame
------------------------------
Date: Wed, 9 Nov 2011 18:35:07 +0000
From: Michele R Combs <[log in to unmask]>
Subject: Re: none of my value-of statements work
Well, I know I had trouble the one time I tried it :) And if the next ver=
sion of EAD is released as a schema only, lots of people will need to do it= so seems like a step by step guide would be helpful.
Michele
-----Original Message-----
From: Encoded Archival Description List [mailto:[log in to unmask]] On Be= half Of Eric Lease Morgan
Sent: Wednesday, November 09, 2011 10:56 AM
To: [log in to unmask]
Subject: Re: none of my value-of statements work
Michele Combs:
> Someday perhaps someone will write a nice concise guide for the EAD
> Help =
Pages that lays out the step-by-step process for switching your style sheet= s from DTD to schema, including troubleshooting of things like this...
Is it true then, that other people have had problems migrating their styles= heets as they move from DTD-based EAD files to schema-based ones?
------------------------------
Date: Wed, 9 Nov 2011 13:40:52 -0500
From: "De Catanzaro, Christine D" <[log in to unmask]>
Subject: Re: none of my value-of statements work
I second Michele's remark. Not everyone who is conversant with the EAD DTD is also conversant with XSLT, so the need is there. Also, a clear definition of the differences between a DTD and a schema (and why the decision has been made to switch to the schema) would be very helpful.
Thanks,
Christine
----- Original Message -----
From: "Michele R Combs" <[log in to unmask]>
To: [log in to unmask]
Sent: Wednesday, November 9, 2011 1:35:07 PM
Subject: Re: none of my value-of statements work
Well, I know I had trouble the one time I tried it :) And if the next version of EAD is released as a schema only, lots of people will need to do it so seems like a step by step guide would be helpful.
Michele
-----Original Message-----
From: Encoded Archival Description List [mailto:[log in to unmask]] On Behalf Of Eric Lease Morgan
Sent: Wednesday, November 09, 2011 10:56 AM
To: [log in to unmask]
Subject: Re: none of my value-of statements work
Michele Combs:
> Someday perhaps someone will write a nice concise guide for the EAD Help Pages that lays out the step-by-step process for switching your style sheets from DTD to schema, including troubleshooting of things like this...
Is it true then, that other people have had problems migrating their stylesheets as they move from DTD-based EAD files to schema-based ones?
------------------------------
Date: Wed, 9 Nov 2011 19:52:54 +0100
From: Martijn van Egdom <[log in to unmask]>
Subject: Re: none of my value-of statements work
Oke as computer scientist some corrections:
XSLT -> EXtensible Stylesheet Language is a language to process XML = files. They can be used to transform XML into another xml file. It = rewrite the syntax
DTD -> Document Type Definition, is a language to define the structure = of a XML file. So it serves a completely different goal. DTD helps to = valid if a XML is according to it's standards.
XSD -> XML Schema, is also a language to define the structure of an XML = file. XSD is again XML.
-- What the discussion is about is to use XSD or DTD. XSLT has nothing = to do with!
----------
XSD vs DTD - So what's the difference?
Here are a number of differences. Some are not important, some are real = important and easy to understand, some are real important and hard to = understand. This list is not exhaustive.
DTD's are not namespace aware.
DTD's have #define, #include, and #ifdef -- or, less C-oriented, the = ability to define shorthand abbreviations, external content, and some = conditional parsing.
A DTD describes the entire XML document (even if it leaves "holes"); a = schema can define portions.
XSD has a type system.
XSD has a much richer language for describing what element or attribute = content "looks like." This is related to the type system.
You can put a DTD inline into an XML document, you cannot do this with = XSD. This means DTD's are more secure (you only have to protect one = bytestream -- the xml/dtd -- and not multiple).
The official definition of "valid XML" requires a DTD. Since this may = be impractical, if not impossible, you often have to settle for = schema-valid, which is not quite the same.
--
Hope this is helpful
Op 9 nov 2011, om 19:40 heeft De Catanzaro, Christine D het volgende =
geschreven:
> I second Michele's remark. Not everyone who is conversant with the EAD
> =
DTD is also conversant with XSLT, so the need is there. Also, a clear = definition of the differences between a DTD and a schema (and why the = decision has been made to switch to the schema) would be very helpful.
>=20
> Thanks,
> Christine=20
>=20
> ----- Original Message -----
> From: "Michele R Combs" <[log in to unmask]>
> To: [log in to unmask]
> Sent: Wednesday, November 9, 2011 1:35:07 PM
> Subject: Re: none of my value-of statements work
>=20
> Well, I know I had trouble the one time I tried it :) And if the =
next version of EAD is released as a schema only, lots of people will = need to do it so seems like a step by step guide would be helpful.
>=20
> Michele
>=20
>=20
> -----Original Message-----
> From: Encoded Archival Description List [mailto:[log in to unmask]]
>=
On Behalf Of Eric Lease Morgan
> Sent: Wednesday, November 09, 2011 10:56 AM
> To: [log in to unmask]
> Subject: Re: none of my value-of statements work
>=20
> Michele Combs:
>=20
>> Someday perhaps someone will write a nice concise guide for the EAD =
Help Pages that lays out the step-by-step process for switching your = style sheets from DTD to schema, including troubleshooting of things = like this...
>=20
>=20
> Is it true then, that other people have had problems migrating their =
stylesheets as they move from DTD-based EAD files to schema-based ones?
------------------------------
Date: Wed, 9 Nov 2011 19:01:28 +0000
From: Michele Rothenberger <[log in to unmask]>
Subject: Re: none of my value-of statements work
> -- What the discussion is about is to use XSD or DTD. XSLT has nothing to do with!
Actually it does. When you are switching from DTD to XSD you may very well need to make changes to your XSLT!
Michele
---- Martijn van Egdom <[log in to unmask]> wrote:
> Oke as computer scientist some corrections:
>
> XSLT -> EXtensible Stylesheet Language is a language to process XML
> files. They can be used to transform XML into another xml file.
> It rewrite the syntax
>
> DTD -> Document Type Definition, is a language to define the structure
> of a XML file. So it serves a completely different goal.
> DTD helps to valid if a XML is according to it's standards.
>
> XSD -> XML Schema, is also a language to define the structure of an
> XML file. XSD is again XML.
>
> -- What the discussion is about is to use XSD or DTD. XSLT has nothing to do with!
------------------------------
Date: Wed, 9 Nov 2011 20:13:49 +0100
From: Martijn van Egdom <[log in to unmask]>
Subject: Re: none of my value-of statements work
Op 9 nov 2011, om 20:01 heeft Michele Rothenberger het volgende =
geschreven:
>> -- What the discussion is about is to use XSD or DTD. XSLT has =
nothing to do with!
>=20
>=20
> Actually it does. When you are switching from DTD to XSD you may very
>=
well need to make changes to your XSLT!
>=20
> Michele
>=20
That's a side effect... Worth to debate about but has nothing to do with = the fundamental choice between XSD vs DTD
------------------------------
Date: Wed, 9 Nov 2011 15:49:28 -0500
From: "Custer, Mark" <[log in to unmask]>
Subject: Re: none of my value-of statements work
Thank you for chiming in, Martijn.=20
The confusion and discussion of XSLT, as far as I understand it, is primari= ly due to this: many in the EAD community often start with a set of XSLT s= tyle sheets that were written to transform DTD-valid EAD files. As you've = mentioned, though, DTDs are not namespace-aware. Once these EAD files are = updated to be compliant with the XSD or RNG schema, this introduces a names= pace to their files which, even though that namespace seems to be invisible= (it's declared at the top element only, but it then trickles all the way d= own the tree), it is nevertheless very important to the parser and the XSLT= stylesheet. So, they then need to update their XSLT (and there are a varie= ty of options for doing this, as Joseph, Xavier, and Richard mentioned a fe= w).
In short, Eric, I would suggest that you encode your EAD elements like so i= f you want to validate them against the XSD schema:
<ead xsi:schemaLocation=3D"urn:isbn:1-931666-22-9 http://www.loc.gov/ead/ea= d.xsd" xmlns:xlink=3D"http://www.w3.org/1999/xlink" xmlns=3D"urn:isbn:1-931= 666-22-9" xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance">
This is very common. The only major exception of which I'm aware is the fa= ct that Archivists' Toolkit slaps on a "ns2" namespace for xlink instead, s= o by default it comes out as "xmlns:ns2" rather than what you see above. I= also wouldn't suggest that you use "xmlns:e" in your style sheet, as you m= entioned in a previous message, since most other EAD style sheets will use = "xlmns:ead". Of course, if you have control over these things, it really s= houldn't matter what you call the namespaces as long as it doesn't conflict= with another.
More information about upgrading from the DTD to the EAD schema is also alr= eady available on the EAD website, http://www.loc.gov/ead/eadschema.html, i= ncluding a dtd2schema XSLT stylesheet. Additionally, as mentioned by Marti= jn in regards to having a type system, this page also lists out which attri= butes are more rigorously validated against in the upgrade due to the datat= ype constraints made available by the schema:
=20
"The following attributes are impacted by the imposition of datatype constr=
aints:
@normal on <unitdate> and <date>: constrained to date and date range sub= set of ISO 8601
@repositorycode: constrained to ISO 15511 (ISIL)
@mainagencycode: constrained to ISO 15511 (ISIL)
@langcode: constrained to ISO 639-2 alpha-3 code list
@scriptcode: constrained to ISO 15924 code list
@countrycode: constrained to ISO 3166-1 alpha-2 code list"
So, yes, I would say that those are all very good reasons to use the schema= in lieu of the DTD. Also, it sounds like EAD v. 3 will likewise start wit= h an RNG schema, as I think was done with EAD 2002, and then have an XSD sc= hema created from that (but I don't know if they talked about even botherin= g with a DTD for the next release).
Mark
-----Original Message-----
From: Encoded Archival Description List [mailto:[log in to unmask]] On Be= half Of Martijn van Egdom
Sent: Wednesday, November 09, 2011 1:53 PM
To: [log in to unmask]
Subject: Re: none of my value-of statements work
Oke as computer scientist some corrections:
XSLT -> EXtensible Stylesheet Language is a language to process XML files. = They can be used to transform XML into another xml file. It rewrite the syn= tax
DTD -> Document Type Definition, is a language to define the structure of a= XML file. So it serves a completely different goal. DTD helps to valid if = a XML is according to it's standards.
XSD -> XML Schema, is also a language to define the structure of an XML fil= e. XSD is again XML.
-- What the discussion is about is to use XSD or DTD. XSLT has nothing to = do with!
----------
XSD vs DTD - So what's the difference?
Here are a number of differences. Some are not important, some are real im= portant and easy to understand, some are real important and hard to underst= and. This list is not exhaustive.
DTD's are not namespace aware.
DTD's have #define, #include, and #ifdef -- or, less C-oriented, the abilit= y to define shorthand abbreviations, external content, and some conditional= parsing.
A DTD describes the entire XML document (even if it leaves "holes"); a sche= ma can define portions.
XSD has a type system.
XSD has a much richer language for describing what element or attribute con= tent "looks like." This is related to the type system.
You can put a DTD inline into an XML document, you cannot do this with XSD.=
This means DTD's are more secure (you only have to protect one bytestream=
-- the xml/dtd -- and not multiple).
The official definition of "valid XML" requires a DTD. Since this may be i= mpractical, if not impossible, you often have to settle for schema-valid, w= hich is not quite the same.
--
Hope this is helpful
Op 9 nov 2011, om 19:40 heeft De Catanzaro, Christine D het volgende geschr=
even:
> I second Michele's remark. Not everyone who is conversant with the EAD
> DT=
D is also conversant with XSLT, so the need is there. Also, a clear definit= ion of the differences between a DTD and a schema (and why the decision has= been made to switch to the schema) would be very helpful.
>=20
> Thanks,
> Christine=20
>=20
> ----- Original Message -----
> From: "Michele R Combs" <[log in to unmask]>
> To: [log in to unmask]
> Sent: Wednesday, November 9, 2011 1:35:07 PM
> Subject: Re: none of my value-of statements work
>=20
> Well, I know I had trouble the one time I tried it :) And if the next v=
ersion of EAD is released as a schema only, lots of people will need to do = it so seems like a step by step guide would be helpful.
>=20
> Michele
>=20
>=20
> -----Original Message-----
> From: Encoded Archival Description List [mailto:[log in to unmask]]
>On =
Behalf Of Eric Lease Morgan
> Sent: Wednesday, November 09, 2011 10:56 AM
> To: [log in to unmask]
> Subject: Re: none of my value-of statements work
>=20
> Michele Combs:
>=20
>> Someday perhaps someone will write a nice concise guide for the EAD
>> Help=
Pages that lays out the step-by-step process for switching your style shee= ts from DTD to schema, including troubleshooting of things like this...
>=20
>=20
> Is it true then, that other people have had problems migrating their
>styl=
esheets as they move from DTD-based EAD files to schema-based ones?
------------------------------
End of EAD Digest - 8 Nov 2011 to 9 Nov 2011 (#2011-114)
********************************************************
|