Querying the CTAN Database with XML – Author
The information about a single author can be obtained under the URL like
The last element in the URl is the key of the author as used by CTAN. Those keys are also listed in the list of authors.
The result is an XML file as in the following listing:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE authors SYSTEM 'http://www.ctan.org/xml/1.2/catalogue.dtd'> <author key="knuth" givenname="Donald E." familyname="Knuth" />
The entry has the outer tag <author>
.
This tag has several attributes:
key
- This attribute contains the key of the author. This attribute is mandatory.
-
givenname
- This attribute contains the given name. It is optional and can be empty.
-
familyname
- This attribute is the family name. It is optional and can be empty.
-
female
-
This attribute is the boolean indicator that the author is
female. It is optional and can be empty. The default is
false
. -
died
- This attribute is the indicator that the author is deceased. It is optional and can be empty. The default is empty.
Note that the authors information does not contain the email address of the author to protect the privacy.
References
You can request that more information about the authors is provided.
This information is the list of packages in which the author is mentioned.
This is accomplished with the parameter ref
. It can be set to
true
as in the following example:
This results in an XML file like in the following listing;
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE author SYSTEM 'http://www.ctan.org/xml/1.2/catalogue.dtd'> <author key="knuth" givenname="Donald E." familyname="Knuth"> <package key="ada" /> <package key="cmtest" /> <package key="gkpmac" /> <package key="graphbase" /> … </author
In this case the <author>
tag contains a list of inner
tags for the packages. Each package is contained in the tag
<package>
which has the following attributes:
key
- This attribute contains the key of the package. This attribute is mandatory.
Omitting Or Enforcing the Doctype Declaration
The list of licenses may include a doctype declaration. This declaration can
be suppressed with the URL parameter no-dtd
which should be set
to true
as in
A doctype declaration can be enforced with the URL parameter
no-dtd
which should be set to false
in this case.
The default is no-dtd
=false.
Omitting the XML Declaration
The list of licenses starts with an XML declaration. This declaration can
be suppressed with the URL parameter no-xml
which should be
set to true
as in