我正在处理这个片段,但是,我得到了预期的输出。
这是我的输入
<?xml version="1.0" encoding="UTF-8" ?>
<GovTalkMessage xmlns="http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader">
<EnvelopeVersion>1.0</EnvelopeVersion>
<GovTalkDetails>
<Keys/>
</GovTalkDetails>
<Body>
<NameSearch>
<ContinuationKey>fcb844eELdiGt/AO3sMH2IGP8Amoxy+wewviAdon</ContinuationKey>
<RegressionKey>fcb844eJyt0ttO20moxy+wewviAdon</RegressionKey>
<SearchRows>100</SearchRows>
<CoSearchItem>
<CompanyName>WILLIAM ROSE LTD</CompanyName>
<CompanyNumber>07905646</CompanyNumber>
<DataSet>LIVE</DataSet>
<CompanyIndexStatus>DISSOLVED</CompanyIndexStatus>
<CompanyDate></CompanyDate>
</CoSearchItem>
</NameSearch>
</Body>
</GovTalkMessage>
而且,这是我的 xslt
<?xml version="1.0"?>
<xsl:stylesheet xmlns="http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="GovTalkMessage/Body/NameSearch/CoSearchItem">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
我的预期输出是
<CoSearchItem>
<CompanyName>WILLIAM ROSE LTD</CompanyName>
<CompanyNumber>07905646</CompanyNumber>
<DataSet>LIVE</DataSet>
<CompanyIndexStatus>DISSOLVED</CompanyIndexStatus>
<CompanyDate></CompanyDate>
</CoSearchItem>
求大神帮忙看看哪里有问题。