XSL XML inserting data from the xml doc to the xsl

victorbear

New Member
I am a beginner at using XSL and XML. I have a problem with fetching the data from the XML document and using it in the XSL. Currently I am trying different methods but can't seem to get it right and I will need to use this technique throughout to complete the project. Once I can do it to one I will be able to do throughout the page. Here is samples from my XML and my XSL document: \[code\]<storelocator> <!--Parent element containing all text on the page--> <content_text> <title> <titlename>Store Locator</titlename> </title> <title> <subtitle>FIND A STORE</subtitle> </title> <title> <countrydropdown>Country</countrydropdown> </title> <title> <address>Steet Address, City, Sate/Province OR Postal/Zip Code</address> </title> <title> <radiusdropdown>Radius</radiusdropdown> </title> <title> <featuredstore>FEATURED STORE</featuredstore> </title> <title> <storelocation>Newbury Street, Boston, MA USA</storelocation> </title></storelocator>\[/code\]Here is the XSL: \[code\]<?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"><html><body bgcolor="white"><div id="container" style="100%"><div id="header" style="background: url('header.png'); height:30px;"></div><div id="content_container" align="center" style="text-transform: uppercase; font-family: tahoma; font-weight: normal; font-size: 0.8em"> <div id="content" align="left" style="background-color:blue;height:845px;width:848px"> <xsl:value-of select="titlename"/> <!--here I was trying to import the text from XML DOC--><br/><br/><br/> <img src="http://stackoverflow.com/questions/13808604/image.png" align="left"/><br/><br/><br/><br/><br/></div></div><div id="footer" style="background-color:black;clear:both;text-align:center;height:20px"></div></div></body></html></xsl:template></xsl:stylesheet>\[/code\]Basically what I am trying to do is import the "store locator" title so that it displays above the image but currently nothing appears when it is opened in browser. I would much appreciate some help as I have been trying to do it for a while. Thanks
 
Back
Top