xml and purpose of ccs xsl

Bill Cunningham

Usenet Archive
Joined
Jun 21, 2003
Messages
1,946
Reaction score
0
I'm new to xml but I think It'll be the thing of the future. Hold data and transfer it. Then give it form somehow. That's where I get stuck.

<?xml version="1.0" ?> //left out encoding
<data>
<name>peggy</name>
</data>

Short to demonstrate my point. I'm missing <!DOCTYPE etc.... I don't know if it's required. How do you use ccs or xsl to make this data display like html?

Bill
 

Tripredacus-X

Usenet Archive
Joined
Feb 8, 2004
Messages
11
Reaction score
0
Bill Cunningham wrote:Short to demonstrate my point
I'm missing <!DOCTYPE etc.... I don't know if
it's required. How do you use ccs or xsl to make this data displa like html?

Bill

You do not need a DOCTYPE declaration on the XML file because the <?xm version="1.0"?> does the same thing. You can reference the XSL as i this example:

<?xml-stylesheet type="text/xsl" href="style.xsl"?>

The XSL will have a similar declaration after the initial XML one suc as:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

You may build the XSL as a HTML page. Within the HTML code you ca reference the CSS just as would with an HTML page. For dynamic field you use this code:

<xsl:value-of select="root/page_title"/>

where root is your root in the XML file and page_title is whatever ta in the XML file you want to appear in that place. So generally, desig the CSS as you would for an HTML page and design the XSL to be you page layout. you can use this as your guide to building your XSL:

http://www.w3.org/TR/xslt

hope this helps

Tripredacus-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,224
Members
248,132
Latest member
henrywalsh

Latest Threads

Top