문제

So I have about 100 types of XML files, most of them use a different xmlns for the same nodes. Now I want to transform these XML files using XSLT, and it workes great. Except I need one XSL for each XML, and the only difference is the xmlns, the nodes I want are the same. (I don't make the XML)

I know that I can pass parameters to my XSL from Scala, but since I need to declare the parameter, I can not use it when defining the root node.

So, is there any way to dynamically set the xmlns for the XSTL?

도움이 되었습니까?

해결책

XSLT 2.0 allows you to write e.g.

<xsl:template match="*:foo">...</xsl:template>

to match elements with local name foo in any namespace. Saxon 9 is an XSLT 2.0 processor for instance.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top