출력이 생성 될 xsl 파일과 2 개의 입력 XML 파일이 하나 있습니다. 하나의 XML 파일에는 xsl 파일로 가져 오는 일부 네임 스페이스가 있습니다. 그러나 다른 XML 파일에서는 네임 스페이스가 존재하지 않습니다. XSL은 두 입력 XML 파일 모두에 공통적이므로 두 XML 파일을 모두 처리 할 수있는 방식으로 내 XSL을 처리해야합니다. 제안 해주세요. 1 XML 파일에네임 스페이스 처리
네임 스페이스 - 2 XML 파일>
<TreeList xmlns="urn:sfti:documents:BasicTreeList:1:0"
xmlns:cac="urn:sfti:CommonAggregateComponents:1:0"
xmlns:cbc="urn:oasis:names:tc:ubl:CommonBasicComponents:1:0"
xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1:0"
xmlns:cur="urn:oasis:names:tc:ubl:codelist:CurrencyCode:1:0"
xmlns:sdt="urn:oasis:names:tc:ubl:SpecializedDatatypes:1:0"
xmlns:udt="urn:oasis:names:tc:ubl:UnspecializedDatatypes:1:0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
네임 스페이스 - XSL 파일에서>
이<TreeList xmlns:cac="urn:sfti:CommonAggregateComponents:1:0"
xmlns:cbc="urn:oasis:names:tc:ubl:CommonBasicComponents:1:0"
xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1:0"
xmlns:cur="urn:oasis:names:tc:ubl:codelist:CurrencyCode:1:0"
xmlns:sdt="urn:oasis:names:tc:ubl:SpecializedDatatypes:1:0"
xmlns:udt="urn:oasis:names:tc:ubl:UnspecializedDatatypes:1:0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
네임 스페이스 ->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:abc="urn:sfti:documents:BasicTreeList:1:0"
xmlns:cac="urn:sfti:CommonAggregateComponents:1:0"
xmlns:cbc="urn:oasis:names:tc:ubl:CommonBasicComponents:1:0">
내 XSL을 실행 파일은 첫 번째 XML로 잘 실행됩니다. 하지만 네임 스페이스 문제로 인해 2 차 XML 파일과 잘 작동하지 않습니다.
:이 이와 같은 템플릿을 포함하는 스타일 시트를 사용하여 수행 할 수 있습니다! – Kundan
아마도 당신은 충분히주의 깊게 읽지 않았을 것입니다. 내 조언은 표준화 된 네임 스페이스를 사용하도록 입력을 사전 처리하는 것입니다. 그렇다면 주 처리 단계에서 불필요한 다양성을 처리 할 필요가 없습니다. –