Мне нужно преобразовать XML в Biztalk с помощью XSLT, но проблема в том, что я не знаком с ним и с трудом понимаю его.Преобразование XML с использованием XSLT в Biztalk
Что мне нужно, это XSLT-скрипт, который может преобразовать этот источник XML:
<?xml version="1.0"?>
<ns0:usp_GetStudentListResponse xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/BizTalk">
<ns0:StoredProcedureResultSet0>
<ns1:StoredProcedureResultSet0 xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/BizTalk/usp_GetStudentList">
<ns1:Subject>Math</ns1:Subject>
<ns1:TestDate>2016-11-13T00:00:00.000-00:00</ns1:TestDate>
<ns1:SectionId>1</ns1:SectionId>
<ns1:SectionName>Red</ns1:SectionName>
<ns1:StudentName>John Doe</ns1:StudentName>
</ns1:StoredProcedureResultSet0>
<ns1:StoredProcedureResultSet0 xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/BizTalk/usp_GetStudentList">
<ns1:Subject>Math</ns1:Subject>
<ns1:TestDate>2016-11-13T00:00:00.000-00:00</ns1:TestDate>
<ns1:SectionId>1</ns1:SectionId>
<ns1:SectionName>Red</ns1:SectionName>
<ns1:StudentName>Jane Doe</ns1:StudentName>
</ns1:StoredProcedureResultSet0>
<ns1:StoredProcedureResultSet0 xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/BizTalk/usp_GetStudentList">
<ns1:Subject>Math</ns1:Subject>
<ns1:TestDate>2016-11-13T00:00:00.000-00:00</ns1:TestDate>
<ns1:SectionId>1</ns1:SectionId>
<ns1:SectionName>Red</ns1:SectionName>
<ns1:StudentName>Lee Copper</ns1:StudentName>
</ns1:StoredProcedureResultSet0>
<ns1:StoredProcedureResultSet0 xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/BizTalk/usp_GetStudentList">
<ns1:Subject>Math</ns1:Subject>
<ns1:TestDate>2016-11-12T00:00:00.000-00:00</ns1:TestDate>
<ns1:SectionId>2</ns1:SectionId>
<ns1:SectionName>Blue</ns1:SectionName>
<ns1:StudentName>Mary Steel</ns1:StudentName>
</ns1:StoredProcedureResultSet0>
<ns1:StoredProcedureResultSet0 xmlns:ns1="http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/BizTalk/usp_GetStudentList">
<ns1:Subject>Math</ns1:Subject>
<ns1:TestDate>2016-11-12T00:00:00.000-00:00</ns1:TestDate>
<ns1:SectionId>2</ns1:SectionId>
<ns1:SectionName>Blue</ns1:SectionName>
<ns1:StudentName>Steve Burry</ns1:StudentName>
</ns1:StoredProcedureResultSet0>
</ns0:StoredProcedureResultSet0>
<ns0:ReturnValue>5</ns0:ReturnValue>
</ns0:usp_GetStudentListResponse>
к этому выходу XML:
<ns0:StudentListSumEnv xmlns:ns0="http://School.Subject.Schema.StudentListSumEnv">
<ns1:StudentListSumData xmlns:ns1="http://School.Subject.Schema.StudentListSumData">
<ns1:Subject>Math</ns1:Subject>
<ns1:TestDate>2016-11-13T00:00:00.000-00:00</ns1:TestDate>
<ns1:SectionId>1</ns1:SectionId>
<ns1:SectionName>Red</ns1:SectionName>
<ns1:TotalStudent>3</ns1:TotalStudent>
</ns1:StudentListSumData>
<ns1:StudentListSumData xmlns:ns1="http://School.Subject.Schema.StudentListSumData">
<ns1:Subject>Math</ns1:Subject>
<ns1:TestDate>2016-11-12T00:00:00.000-00:00</ns1:TestDate>
<ns1:SectionId>2</ns1:SectionId>
<ns1:SectionName>Blue</ns1:SectionName>
<ns1:TotalStudent>2</ns1:TotalStudent>
</ns1:StudentListSumData>
</ns0:StudentListSumEnv>
Условия являются:
- Должна быть группа по ns1: Subject AND ns1: TestDate AND ns1: SectionId
- Следует учитывать тота l ученик в группе, определенной выше (ns1: Subject AND ns1: TestDate AND ns1: SectionId)
Добро пожаловать на SO :-) Что вы пробовали до сих пор? Мы не являемся сервисом написания кода, но помогаем вам с вашим кодом, но для этого вы должны отредактировать свой вопрос, чтобы фактически показать xsl, который у вас есть. –
С помощью простого Google dig вы имеете [здесь, в MSDN] (https://social.msdn.microsoft.com/Forums/en-US/0dfd38ba-85e6-4729-96b6-54fdfddcd4e7/multiply-and-cumulative-sum -based-on-group-in-biztalk-map) аналогичная проблема с объяснением XSLT. –