我正在研究 XSLT 转换。我被困在某一时刻。
源 XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Content xmlns="uuid:4522eb85-0a47-45f9-8e2b-1f82c78fa920">
<first xmlns="uuid:4522eb85-0a47-45f9-8e2b-1f82c78fa920">Hello World.This is Fisrt field</first>
<second xmlns="uuid:4522eb85-0a47-45f9-8e2b-1f82c78fa920">Hello World.This is second field2</second>
</Content>
所需的输出格式:
<aaa>Hello World.This is Fisrt field</aaa>
<bbb>Hello World.This is second field</bbb>
请为此提出解决方案。
我试过这个
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="uuid:4522eb85-0a47-45f9-8e2b-1f82c78fa920">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<aaa>
<xsl:value-of select="Content/first"/>
</aaa>
</xsl:template>
</xsl:stylesheet>
我得到的输出是
<?xml version="1.0" encoding="utf-8"?>
<aaa xmlns="uuid:4522eb85-0a47-45f9-8e2b-1f82c78fa920"></aaa>
所需的输出是
<aaa>Hello World.This is Fisrt field</aaa>