can’t believe this is the easiest way to resolve a QName in XSLT 1.0
<variable name="dcmitype">
<for-each select="rdf:type/@rdf:resource">
<variable name="datatypeelt">
<element name="{.}"/>
</variable>
<if test="namespace-uri(exsl:node-set($datatypeelt)//*[1])='http://purl.org/dc/dcmitype/'">
<value-of select="local-name(exsl:node-set($datatypeelt)//*[1])"/>
<text>,</text>
</if>
</for-each>
</variable>
<choose>
<when test="contains($dcmitype, ',')">
<value-of select="substring-before($dcmitype, ',')"/>
</when>
<otherwise>
<text>???</text>
</otherwise>
</choose>
can’t believe this is the easiest way to resolve a QName in XSLT 1.0
@Lady@glitch.cat.family @rdf@glitch.cat.family how intuitive!
re: can’t believe this is the easiest way to resolve a QName in XSLT 1.0
@jdp23 they fixed a lot of this stuff in later versions (i know that XPath 3 has a function for this for example), but browsers never implemented anything beyond the first version (and would love to get rid of that too, but can’t because too much enterprise software depends on it)
honestly i’m just glad (and kind of surprised) there’s any way to do it at all
re: can’t believe this is the easiest way to resolve a QName in XSLT 1.0
@jdp23 i really like it conceptually and it has a lot of applicability for the kinds of things i do, but your tolerance for things just being unnecessarily complex sometimes has to be really high if you ever want to get anything interesting done
re: can’t believe this is the easiest way to resolve a QName in XSLT 1.0
@Lady@glitch.cat.family 💯. When I first learned about it I thought "how elegant!" But the reality is ... less elegant.