View Full Version : XSL and XML
The Red
02-24-2010, 10:59 PM
Hi I hope I can post this here. I am looking for some help with rendering XML (in html) using a XSL or XSLT stylesheet. I am however quite confused on the linking aspect. Does the text file named for example mystyle.xsl need to have the
<?xml version="1.0" encoding="ISO-8859-1"?>
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml"> in it to run even if its local?
Can someone direct me to some reading on styling for XML? Can the XML be rendered without using HTML tags? For example
<radio>
<song>
<title>Cuz it's Hot</title>
<composer>Thrill Kill Kult</composer>
<file>music/indust/cuzitshot.mp3</file>
</song>
</radio>
Can this code be rendered and styled using XSL? IF so could someone give me an example? Thanks in advance for any help or direction to reading.
coothead
02-27-2010, 02:09 PM
Hi there The Red,
check out the attachment for a possible solution to your problem. ;)
coothead
The Red
02-27-2010, 07:53 PM
I have moved beyond this a bit but have run into another problem. How can I get individual hyperlinks to show up in dynamically generated XHTML. I hope my enclosed files show my point. Is it possible to use the
<a href="">My Link</a> tags if I use a XHTML DTD? I've tried that but I dont know if it needs to be declared differently.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Starts with <! while XML declarations start <?
Any help is appreciated (and may save my forhead from hitting the wall),
Red
The Red
02-28-2010, 02:41 AM
Also Coothead I found your DTD to be informative. Thank you.
coothead
02-28-2010, 02:03 PM
Hi there The Red,
I hope that the attachment may "save your forehead from hitting the wall". :D
coothead
The Red
02-28-2010, 03:43 PM
Coothead,
THANK YOU!!! That is exactly what I was looking for. One more question:
Can you specify unique names inside the tags?
<file></file>
Example:
<file>www.google.com</file> But I want it to display like this
<file>Click Here</file> or <file>Google</file> I know this is kind of like splitting hairs, but I am curious. Would you have to give say the
<file> Element an attribute value?
<file id="1"></file> If so how would you go about calling that with your xsl sheet? Would it look like this?
a href="{file[1]}" style="
font-size:10pt;
font-style:bold;
color:#000;
">
<xsl:value-of select="file"/>
</a>
Thank you again for your help.
The Red
02-28-2010, 04:24 PM
Sorry post script.
What does the + mean in your DTD?
<!ELEMENT radio (header,song+)>
coothead
02-28-2010, 04:59 PM
Hi there The Red,
What does the + mean in your DTD?
<!ELEMENT radio (header,song+)>
You must understand that I am not, by any means, an XML/XLS expert. :eek:
So my understanding is that, it means that the song element contains nested elements.
I don't seem to be too bad though at problem solving, though. :)
Check out the attachment for a solution to your latest problem. :D
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.