从XML删除所有属性的一个元素我有一个很大的XML文件的下列根元素:XSLT使用XSLT
<Interchange xmlns='http://www.e2b.no/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://www.e2b.no/XMLSchema Interchange'>
我需要得到
<Interchange>
请指教。下面是该模板的最小文件我想(我将不包括我的全部努力,因为他们是更长的时间):
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="Interchange/@xmlns|@xmlns:xsi|@xsi:schemaLocation"/>
</xsl:stylesheet>
你是什么意思“我不会举例说明我的尝试”?这正是你应该做的。 –
[如何使用XSLT从XML文件中删除不需要的元素和属性]的可能重复(http://stackoverflow.com/questions/5985756/how-to-remove-unwanted-elements-and-attributes-from-xml-file -using-xslt) –
是的,这正是我应该做的 – user3042795