私は次のXMLを持っています
<?xml version="1.0" encoding="UTF-8" ?>
<GovTalkMessage xsi:schemaLocation="http://www.govtalk.gov.uk/CM/envelope http://xmlgw.companieshouse.gov.uk/v1-0/schema/Egov_ch-v2-0.xsd" xmlns="http://www.govtalk.gov.uk/CM/envelope" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:gt="http://www.govtalk.gov.uk/schemas/govtalk/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<EnvelopeVersion>1.0</EnvelopeVersion>
<Header>
<MessageDetails>
<Class>NumberSearch</Class>
<Qualifier>response</Qualifier>
<TransactionID>4c5cf4a9e1a44cbbbe800ad9ea9f06fd</TransactionID>
<GatewayTimestamp>2012-09-27T18:34:19-00:00</GatewayTimestamp>
</MessageDetails>
<SenderDetails>
<IDAuthentication>
<SenderID>XMLGatewayTestUserID</SenderID>
<Authentication>
<Method>CHMD5</Method>
<Value></Value>
</Authentication>
</IDAuthentication>
</SenderDetails>
</Header>
<GovTalkDetails>
<Keys/>
</GovTalkDetails>
<Body>
<NumberSearch xmlns="http://xmlgw.companieshouse.gov.uk/v1-0/schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlgw.companieshouse.gov.uk/v1-0/schema http://xmlgw.companieshouse.gov.uk/v1-0/schema/NumberSearch.xsd">
<SearchRows>1</SearchRows>
<CoSearchItem>
<CompanyName>MILLENNIUM STADIUM PLC</CompanyName>
<CompanyNumber>03176906</CompanyNumber>
<DataSet>LIVE</DataSet>
<CompanyIndexStatus></CompanyIndexStatus>
<CompanyDate></CompanyDate>
</CoSearchItem>
</NumberSearch>
</Body>
</GovTalkMessage>
そして、XSLTを使用して次のように変換したいと思います。
<?xml version="1.0"?>
<CompanySearchResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<RegistrationNumber>03176906</RegistrationNumber>
<RegisteredName>MILLENNIUM STADIUM PLC</RegisteredName>
</CompanySearchResult>
現在、次のXSLTファイルがあります
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ev="http://www.govtalk.gov.uk/CM/envelope"
xmlns:gt="http://www.govtalk.gov.uk/schemas/govtalk/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sr="http://xmlgw.companieshouse.gov.uk/v1-0/schema/NumberSearch.xsd">
<xsl:template match="/">
<CompanySearchResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<RegistrationNumber>
<xsl:value-of select="ev:GovTalkMessage/ev:Body/ev:NumberSearch/ev:CoSearchItem/ev:CompanyNumber"/>
</RegistrationNumber>
<RegisteredName>
<xsl:value-of select="ev:GovTalkMessage/ev:Body/ev:NumberSearch/ev:CoSearchItem/ev:CompanyName"/>
</RegisteredName>
</CompanySearchResult>
</xsl:template>
</xsl:stylesheet>
ただし、RegistrationNumberとRegistrationNameが空白になっています-
これらを正しく取得するには、何を変更する必要がありますか。
前もって感謝します