Print

Print


Hello!

In the modsrdf.xsl XSLT file, I noticed that the variable declaration

xsl:variable name="resourceTypeClass"

line 1829 (or nearby) probably could be removed for clarity. Instead, two 
lines further down, one could replace

xsl:value-of select="concat($resourceTypeURI,$resourceTypeClass)"

with the content of the declaration of $resourceTypeParts because the 
for-each used to create

xsl:variable name="resourceTypeParts"

on lines 1824 to 1828 populates the $resourceTypeParts variable with an 
already concatenated string (not with a sequence). Furthermore, (at least) 
one of the vertical bars in the RegEx on line 1825 could be remove. I do 
not know either in which cases we need any vertical bar. In other words, 
removing the resourceTypeClass and resourceTypeParts variable 
declarations, we could write the rdf:type element similarly to:

xsl:element name="rdf:type"

xsl:attribute name="rdf:resource"

xsl:value-of select="$resourceTypeURI" /

xsl:for-each select="tokenize(.,'[\s|,\-]')"

xsl:value-of select="concat(upper-case(substring(.,1,1)),substring(.,2))" /

/xsl:for-each

/xsl:attribute

/xsl:element

In the code above, I intentionally removed the greater-than and less-than 
characters for the sake of readability in "older" e-mail user agents.

I also consider that the two following tests

xsl:if test="@collection"

and

xsl:if test="@manuscript"

could be rewritten for readability and expansibility with a for-each.

xsl:for-each select="@manuscript|@collection"

The value-of could then be rewritten similarly to:

xsl:value-of select="concat($resourceTypeURI,concat(upper-case(substring(name(.),1,1)),substring(name(.),2)))"

Regards!

SaaĊĦha,