XSLT를 사용하여 변환해야하는 XML이 있습니다. XML에 해결되지 않은 맞춤 태그가 있으며 그 결과를 얻지 못했습니다.XSLT 변환에서 작동하지 않는 사용자 정의 태그
<?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>
원하는 출력은 다음과 같습니다
는프로젝트 이슈는
사람은 도움을 주시기 바랍니다 수
다음 는XML 코드입니다 내가 잘못 가고있는 곳을 찾아 내고 가리키는 데. 감사
이 방법이 효과가 있지만 저는 개인적으로 사람들에게 코드에 무엇이 잘못된 것인지 알려주고 단순히 대안 솔루션을 제공하는 것보다 선호합니다. 그렇게하면 약간 다른 문제에 대해 동일한 실수를 다시 할 때 도움을 받기 위해 다시 올 가능성이 적습니다. –