Last active
August 7, 2023 13:30
-
-
Save martin-honnen/00fdd29c6a33584251ecf205987b4b1d to your computer and use it in GitHub Desktop.
XSLT document('') test in Gist code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <root> | |
| <item> | |
| <value>a</value> | |
| </item> | |
| <item> | |
| <value>b</value> | |
| </item> | |
| </root> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
| version="3.0" | |
| xmlns:data="http://example.com/mh/data" | |
| expand-text="yes" | |
| exclude-result-prefixes="data"> | |
| <data:data> | |
| <map key="a">1</map> | |
| <map key="b">2</map> | |
| </data:data> | |
| <xsl:mode on-no-match="shallow-copy"/> | |
| <xsl:template match="item/value"> | |
| <xsl:copy>{document('')/xsl:stylesheet/data:data/map[@key = current()]}</xsl:copy> | |
| </xsl:template> | |
| </xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment