我正在處理這個片段,但是,我正在獲得預期的輸出。XML沒有正確生成
這裏是我的輸入
<?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>
請人幫忙哪裏出了問題。
而你的*實際*輸出是...? –
期望的輸出? – Sid