XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 15th, 2003, 01:30 PM
chennaikar chennaikar is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 chennaikar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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!!

Reply With Quote
  #2  
Old September 15th, 2003, 05:02 PM
kahaji kahaji is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 7 kahaji User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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">
<xslaram 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

Reply With Quote
  #3  
Old September 16th, 2003, 09:50 AM
colinwebber colinwebber is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Cape Town, South Africa
Posts: 4 colinwebber User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cool Xorro on Sourceforge: 2-way iterative XSLT developement

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)
Attached Files
File Type: zip xorro_with_demo.zip (466.6 KB, 274 views)

Reply With Quote
  #4  
Old September 18th, 2003, 06:39 AM
sampleee sampleee is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Germany
Posts: 4 sampleee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to sampleee
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...

Reply With Quote
  #5  
Old September 18th, 2003, 07:25 AM
chennaikar chennaikar is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 chennaikar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Displaying XML as HTML


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT