|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Displaying XML as HTML
I need to display XML as HTML
ie <Parent> <Child>Some Text</Child> </Parent> Should transform to <HTML> <BODY> <Parent> &tbsp;<Child> &tbsp;&tbsp;Some Text &tbsp;</Child> </Parent> </BODY> </HTML> Plzzzzz help!! |
|
#2
|
|||
|
|||
|
Reply
Well is there any specific reason why you cannot use the default IE stylesheet ?
You can access the default IE stylesheet at res://msxml2.dll/defaultss.xsl - may be you can try to explore possibilities in there. Alternatively you can try the following recursive piece of code that I just wrote and it seems to work fine - you'll have to add the specifics pertaining to attributes and other entity references - this is just an outline. ---------------------------------------------------- <xsl:template match="/"> <html><body> <xsl:for-each select="*"> <<xsl:value-of select="local-name(.)"/>><br/> <xsl:value-of select="text()"/> <xsl:call-template name="one"> <xsl:with-param name="par" select="."/> </xsl:call-template> </<xsl:value-of select="local-name(.)"/>><br/> </xsl:for-each> </body></html> </xsl:template> <xsl:template name="one"> <xsl aram name="par"/><xsl:for-each select="./*"> <<xsl:value-of select="local-name(.)"/>><br/> <xsl:value-of select="text()"/> <xsl:call-template name="one"> <xsl:with-param name="par" select="."/> </xsl:call-template> </<xsl:value-of select="local-name(.)"/>><br/> </xsl:for-each> </xsl:template> <xsl:template match="*"></xsl:template> </xsl:stylesheet> ---------------------------------------------------- Khuzaima |
|
#3
|
|||
|
|||
|
I can highly recommend the opensource project Xorro. I think it is exactly what you're looking for!
- View a description: URL - Download the latest version with a demo: URL Good luck! - Colin (xorro@thawte.com) |
|
#4
|
|||
|
|||
|
Hi there,
if your xml resides on a webserver, i recommend cocoon,.... it does xml->html,wml,pdf,rtf...whatever format but if its only a small thing you wanna get done, cocoon might be to massive... |
|
#5
|
|||
|
|||
|
Thanks for the help.
I have used Kahaji's suggestion. As for xorro and cocoon, I am looking into the two. Hopefully I will be able to use some opensource tool. Thanks again Chennaikar |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Displaying XML as HTML |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|