Hello,
I have an XML file with some information and corresponding XSLT and XSD files. I need to convert this XML to user friendly HTML table, but the problem is that XSLT contains general description and no instructions about XML to HTML conversion. Do I need to write my own parser or maybe there are existing solutions to make this conversion?
These are parts ot this files (they are too big):
XML:
<EnquiryResponse>
−
<Consumers>
−
<s>
−
<PVS>
<status>NotVerified</status>
</PVS>
−
<CAIS>
−
<Consumer>
−
<Address>
<addressCurrPrev>0</addressCurrPrev>
<buildingNbr>401</buildingNbr>
<country>FR</country>
<endDate/>
<flatNbr>56</flatNbr>
<homeTelNbr>555 77 88</homeTelNbr>
<houseNbr/>
<line1/>
<line2>ABC</line2>
<line3>DEF</line3>
<line4>GHI</line4>
<postcode>191011</postcode>
<regionCode>02</regionCode>
<startDate>19950101000000</startDate>
<type>1</type>
</Address>
−
XSL:
−
<xsl:stylesheet version="1.0">
−
<xsl:template match="/">
−
<EnquiryResponse>
−
<xsl:for-each select="/s/child::*">
−
<xsl:if test="@n != 'Consumer' and @n != 'ValidationErrors'">
−
<xsl:element name="{@n}">
<xsl:value-of select="child::node()[1]"/>
</xsl:element>
</xsl:if>
−
<xsl:if test="@n = 'ValidationErrors'">
−
<ValidationErrors>
−
<xsl:for-each select="s">
−
<s>
−
<xsl:for-each select="child::*">
−
<xsl:element name="{@n}">
<xsl:value-of select="child::node()[1]"/>
</xsl:element>
</xsl:for-each>
</s>
</xsl:for-each>
</ValidationErrors>
</xsl:if>
−
<xsl:if test="@n = 'Consumer'">
−
<Consumers>
−
<xsl:for-each select="s">
−
<s>
−
<xsl:for-each select="child::*">
−
<xsl:if test="@n = 'PVS'">
−
<PVS>
−
<xsl:for-each select="child::*">
−
<xsl:element name="{@n}">
<xsl:value-of select="child::node()[1]"/>
</xsl:element>
</xsl:for-each>
</PVS>
</xsl:if>
XSD:
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified">
−
<xs:element name="EnquiryResponse">
−
<xs:complexType>
−
<xs:sequence>
−
<xs:element name="Consumers" minOccurs="1" maxOccurs="1">
−
<xs:complexType>
−
<xs:sequence>
−
<xs:element name="s" maxOccurs="unbounded">
−
<xs:complexType>
−
<xs:sequence>
−
<xs:element name="PVS" minOccurs="1" maxOccurs="1">
−
<xs:complexType>
−
<xs:sequence>
<xs:element name="status" minOccurs="1" maxOccurs="1" type="status">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
−
<xs:element name="CAIS" minOccurs="0" maxOccurs="unbounded">
−
<xs:complexType>
−
<xs:sequence>
−
<xs:element name="Consumer" minOccurs="1" maxOccurs="unbounded">
−
<xs:complexType>
−
<xs:sequence>
−
<xs:element name="Address" minOccurs="1" maxOccurs="unbounded">
−
<xs:complexType>
−
<xs:sequence>
<xs:element name="addressCurrPrev" type="codeValue1" maxOccurs="1" minOccurs="1"/>
<xs:element name="buildingNbr" type="xs:string" maxOccurs="1" minOccurs="1"/>
<xs:element name="country" type="codeValue2" maxOccurs="1" minOccurs="1"/>
<xs:element name="endDate" maxOccurs="1" minOccurs="1" type="timeStamp"/>
<xs:element name="flatNbr" type="xs:string" maxOccurs="1" minOccurs="1"/>
<xs:element name="homeTelNbr" type="xs:string" maxOccurs="1" minOccurs="1"/>
<xs:element name="houseNbr" maxOccurs="1" minOccurs="1" type="xs:string"/>
<xs:element name="line1" maxOccurs="1" minOccurs="1" type="xs:string"/>
<xs:element name="line2" type="xs:string" maxOccurs="1" minOccurs="1"/>
<xs:element name="line3" type="xs:string" maxOccurs="1" minOccurs="1"/>
<xs:element name="line4" type="xs:string" maxOccurs="1" minOccurs="1"/>
<xs:element name="postcode" type="xs:string" maxOccurs="1" minOccurs="1"/>
<xs:element name="regionCode" type="codeValue2" maxOccurs="1" minOccurs="1"/>
<xs:element name="startDate" type="timeStamp" maxOccurs="1" minOccurs="1"/>
<xs:element name="type" type="codeValue1" maxOccurs="1" minOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Thank you.