xslt
Hello guys, I hope everyone is well.
I didnt know where to post this particular problem so I just put it under general, I apologize if its the wrong place.
this is one of my first few attempts to get the xml data to a specific xml format.
Its not returning the format I want
Heres my xslt
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:n1="http://www.web.xds.co.za/XDSConnectWS" xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/" >
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xsl:element name="Gender"><xsl:call-template name="ConnectGetCreditReport"/></xsl:element>
</xsl:template>
<xsl:template name="ConnectGetCreditReport">
<xsl:for-each select="/">
<xsl:for-each select="tns:Envelope">
<xsl:for-each select="Body">
<xsl:for-each select="n1:ConnectGetCreditReportResponse">
<xsl:for-each select="ConnectGetCreditReportResult">
<xsl:for-each select="Consumer">
<xsl:for-each select="ConsumerDetail">
<xsl:for-each select="Gender">
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
I am tryin to create a “Gender” element and get the value from the xml below.
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ConnectGetCreditReportResponse xmlns="http://www.web.xds.co.za/XDSConnectWS">
<ConnectGetCreditReportResult>
<Consumer>
<ReportInformation>
<ReportID>tt</ReportID>
<ReportName>ree</ReportName>
</ReportInformation>
<ConsumerDetail>
<DisplayText>eew</DisplayText>
<ConsumerID>www</ConsumerID>
<Initials>www</Initials>
<FirstName>wwq</FirstName>
<SecondName>wwe</SecondName>
<ThirdName />
<Surname>wwq</Surname>
<IDNo>8</IDNo>
<PassportNo />
<BirthDate>dww</BirthDate>
<Gender>ddd</Gender>
…….Incomple