首页 > 解决方案 > Read XML-Stylesheet attribute in a XSLT file

问题描述

I need to know if a XML file does have the href attribute from < ?xml-stylesheet type="text/xsl" href="recibo.xsl"? > to determine what kind of Invoice it is (in my XSLT file). I´ve spend quite the time searching but couldn´t find any information on it. Is it even possible to read/acces those attributes in a XSLT?

标签: xmlxslt

解决方案


Reading the processing instruction is easy enough: string(/processing-instruction('xml-stylesheet')). But that won't parse out the "pseudo-attributes" (type and href) in its value. You have to do that yourself, unless your processor provides a vendor extension such as saxon:get-pseudo-attribute.


推荐阅读