我有一个 XML,我需要使用 XSLT 对其进行隐蔽。XML 有自定义标签,没有得到解决,我没有得到结果。
以下是 XML 代码:
<?xml version="1.0" encoding="UTF-16"?>
<di:itg_dataImport xmlns:di="http://www.mercury.com/itg/data_import/1.0"
xmlns = "http://www.mercury.com/itg/dm/2.0/types"
xmlns:common = "http://www.mercury.com/itg/common/2.0/types"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mercury.com/itg/data_import/1.0 data_import.xsd">
<request>
<requestType>Project Issue</requestType>
<identifier>3</identifier>
<common:simpleField>
<common:token>REQ.ASSIGNED_TO_USER_ID</common:token>
<common:stringValue>Admin User (DEV)</common:stringValue>
</common:simpleField>
<common:simpleField>
<common:token>REQ.DESCRIPTION</common:token>
<common:stringValue>Test - Pls Ignore</common:stringValue>
</common:simpleField>
<common:simpleField>
<common:token>REQ.KNTA_ESCALATION_LEVEL</common:token>
<common:stringValue>Project</common:stringValue>
</common:simpleField>
<common:simpleField>
<common:token>REQ.KNTA_MASTER_PROJ_REF</common:token>
<common:stringValue>P0912002 IPTV Residential Phase 1</common:stringValue>
</common:simpleField>
<common:simpleField>
<common:token>REQ.PRIORITY_CODE</common:token>
<common:stringValue>Normal</common:stringValue>
</common:simpleField>
<common:simpleField>
<common:token>REQ.WORKFLOW_ID</common:token>
<common:stringValue>Issue Management Process</common:stringValue>
</common:simpleField>
</request>
</di:itg_dataImport>
以下是被调用的 XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:di="http://www.mercury.com/itg/data_import/1.0"
xmlns = "http://www.mercury.com/itg/dm/2.0/types"
xmlns:common = "http://www.mercury.com/itg/common/2.0/types"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mercury.com/itg/data_import/1.0 data_import.xsd" >
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<requests>
<request>
<requestType>
<xsl:copy-of select="di:itg_dataImport/request/requestType"/>
</requestType>
</request>
</requests>
</xsl:template>
</xsl:stylesheet>
所需的输出是:
项目问题
任何人都可以帮助解决并指出我哪里出错了。谢谢