我正在尝试将 xml 转换为 xsl。这是我的 xml 文件。
<?xml version="1.0" encoding="UTF-8"?>
<ml_root>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xml:base="http://ta-nb-manill.totalamber.com:7048/DynamicsNAV90/OData/"
m:etag="W/"'28%3BDgAAAAJ7%2F0IATABVAEUAAAAAAA%3D%3D6%3B1604150%3B'"">
<id>http://ta-nb-manill.totalamber.com:7048/DynamicsNAV90/OData/Company('CRONUS%20International%20Ltd.')/Location('BLUE')
</id>
<category term="NAV.Location"
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<link rel="edit" title="Location"
href="Company('CRONUS%20International%20Ltd.')/Location('BLUE')" />
<title />
<updated>2018-01-09T05:55:24Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:Code>BLUE</d:Code>
<d:Name>Blue Warehouse</d:Name>
<d:ETag>28;DgAAAAJ7/0IATABVAEUAAAAAAA==6;1604150;</d:ETag>
</m:properties>
</content>
</entry>
</ml_root>
我尝试使用以下 XSLT 对其进行转换。
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="UTF-8" method="xml" indent="yes"/>
<xsl:template match="/">
<ROWS>
<COMPANY_SITE_TAB>
<xsl:for-each select="ml_root/entry/content/properties">
<ROW>
<COMPANY>TCO</COMPANY>
<CONTRACT><xsl:value-of select="Code"/></CONTRACT>
<COUNTRY>UNITED KINGDOM</COUNTRY>
<DESCRIPTION><xsl:value-of select="Name"/></DESCRIPTION>
</ROW>
</xsl:for-each>
</COMPANY_SITE_TAB>
</ROWS>
</xsl:template>
</xsl:stylesheet>
但它只给出以下输出。
<ROWS>
<COMPANY_SITE_TAB/>
</ROWS>
你能帮我理解错误吗?