⚲
Project
Profile
Help
Tour this page
Frequent Planio Questions
Learning Resources
Sign in
Register
Switch Planio account
Open in Planio App
Share current page
Search
:
Projects
All Projects
Help
Tour this page
Frequent Planio Questions
Learning Resources
Sign in
Register
Switch Planio account
Open in Planio App
Share current page
Saxon
Overview
Roadmap
Issues
Calendar
Blog
Documents
Forums
Files
Repository
Download (1.44 KB)
Support #4960
» xslt3-beta-transform-ns&root.xsl
XSLT3 Identity transform -
Anonymous, 2021-04-02 06:45
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
version=
"3.0"
>
<xsl:output
method=
"xml"
indent=
"yes"
/>
<xsl:strip-space
elements=
"*"
/>
<xsl:mode
on-no-match=
"shallow-copy"
/>
<xsl:variable
name=
"product-ns"
select=
"'http://fc.fasset/product'"
/>
<xsl:variable
name=
"keep-attr"
select=
"'href','id'"
/>
<xsl:template
match=
"*"
>
<!-- <requestProduct xmlns="http://fc.fasset/product"> -->
<xsl:element
name=
"{name()}"
namespace=
"{$product-ns}"
>
<!-- conditional process node attributes -->
<xsl:for-each
select=
"@*"
>
<xsl:choose>
<xsl:when
test=
"local-name() = $keep-attr"
>
<!-- maintain attr prefix -->
<xsl:attribute
name=
"{local-name()}"
>
<xsl:value-of
select=
"."
/>
</xsl:attribute>
</xsl:when>
<!-- remove ns prefix: <xsl:otherwise> seems redundant ?-->
</xsl:choose>
</xsl:for-each>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template
match=
"comment()"
/>
</xsl:stylesheet>
« Previous
1
2
3
Next »
(1-1/3)
Loading...