473,405 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Trying to use XSLT to convert XML to HTML

I am trying to make an html from an xml sheet using an xslt. I cannot seem to get the data displayed individually. I think it is because of the schema in the xml. How can I change my xsl to display (for example) just the <Abstract>?
Thank you!

The XML:

Expand|Select|Wrap|Line Numbers
  1.  <?xml version="1.0" encoding="UTF-8"?> 
  2. <?xml-stylesheet type="text/xsl" href="Tank_Sip header.xsl"?>
  3. <RecipeElement xmlns="urn:Rockwell/MasterRecipe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SchemaVersion="3519">
  4. <RecipeElementID>TANK_SIP</RecipeElementID>
  5. <Header>
  6. <Abstract>Operation</Abstract>
  7. <ApprovedBy></ApprovedBy>
  8. <DBSchema>3519</DBSchema>
  9. <DefaultSize>100</DefaultSize>
  10. </Header>
  11. </RecipeElement>
  12.  
The XSL:

Expand|Select|Wrap|Line Numbers
  1.  <?xml version="1.0" encoding="UTF-8"?> 
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.  
  4. <xsl:template match="RecipeElement/Header">
  5. <body>
  6. <h1>Abstract: <xsl:value-of select="../Abstract"/></h1>
  7. </body>
  8.  
  9. </xsl:template>
  10. </xsl:stylesheet>
  11.  
Jun 6 '07 #1
2 1464
DeMan
1,806 1GB
Hi redgrL86,

Might move this post to the XML forum, the experts there may have a better idea of how to address your problem. Hope they can help you out!!
Jun 6 '07 #2
dorinbogdan
839 Expert 512MB
In your code just update one line:
Expand|Select|Wrap|Line Numbers
  1. ...
  2. <xsl:value-of select="Abstract"/>
  3. ...
Jun 8 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: nanookfan | last post by:
Hi all, I'm having a bizarre problem converting XML files to HTML using an XSLT. The problem is only occuring in my Netscape 7.0 browser. What makes it more bizarre is that it is only...
1
by: Murtaza Tinwala | last post by:
Hello mates, I have to convert an XML document into HTML output through the use of XSLT. I am receiving some text content which contains tab characters. I have to display this content into TD....
1
by: Mark247 | last post by:
Hi, When transforming an XSLT to HTML I get a very annnoying white spac gap of about 2px under each image. This is particularly annoying as am creating a vertical navigation menu made up of images...
1
by: mountain1228 | last post by:
Hello, I apoligize in advance if this post is off-topic in this group. I have been converting xml to html with an xslt stylesheet using the program xslt-parser that comes with RH 7.3. The...
6
by: arfinmail | last post by:
When I read about XSLT for the first time I thought it was a cool toy, but then I asked myself why use XSLT over ASP? Can someone give a real world example where XSLT would be the best choice...
1
by: Jens Mueller | last post by:
Hi there, this is a Java-XML Question, so I am not sure whether this is the right place, haven't found anything better .... I try to convert a Java object to XML via SAX and let the FOP...
3
by: Jack Fox | last post by:
I've never had the need to work with XML, but I believe I now have an appropriate application. I have time-series data in objects organized as a tree that I want an ASP.NET program to write out to...
0
by: Christopher M. Lauer | last post by:
I have done my best to answer this question but can not find the proper set of commands. I would like to transform an xml file (in code behind) and display its output in a specific html tag,...
4
by: elsigh | last post by:
I'm wondering if anyone has any ideas about a way to quickly convert an HTML DOM Node into an XML Document. The goal is that I want to perform XSLT on the Node, which is coded correctly as XHTML....
12
by: Chris | last post by:
Hi, Just wondering if anyone out there knows if it is possible to convert a CSV to xml using XSLT? I've seen a lot of examples of xml to CSV, but is it possible to go back the other way? I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.