Newbie question...

G

Gabriel Guernik

Hi to all! I'm try to design a web site, not to big and not too fancy,
consisting of just 15 to 20 web pages. I've recently started with
xhtml, but i was wondering if there's a more automated and flexible
way. And i would like to have as result simple xhtml files, i would
really prefer not no manage my site with PHP, ASP or the like.
I've started learning xml + xslt, but i'm not sure if what i want is
acievable with these. This is what i have in mind:

1) to keep all content in one (xml or other format) file, say foo.xml
2) to have a stylesheet that stores the general layout of the pages
3) an (another or the same) stylesheet placing each element of foo.xml
in ist proper place in each of the fina pages, so that when processing
it (in MY machine) it outputs all the webpages of the site with proper
layout and content.

As an axample, consider the files:

foo.xml:

<title>the title</title>
<news>here goes the news...</news>
<oldernews>And here the older ones...</oldernews>

and style.xsl should say that the general layout (i omitt all meta's,
declarations, etc) is:

<h1><here:goes:the:title/></h1>
<div><here:goes:the:content/></div>

and the same or another style should say that i want to output two
files, called news.html and oldnews.html, sth like:

<allfiles><here:goes:the:title=title/></allfiles>
<file:news><here:goes:the:content=news/></file:news>
<file:eek:ldnews><here:goes:the:content=oldnews/></file:eek:ldnews>


So my questions are:

1) is this achievable with xml+xslt? or is there a better way?
2) i'd thought of writting my own JAVA program to do this. Are there
some "xml parsing and xslt applying" classes around that would help
with this?

I hope it's rather clear what i've tried to ask. If not, please tell me
and i will try again.
Thanks to all!

Gabriel
 
P

Peter Flynn

Gabriel said:
Hi to all! I'm try to design a web site, not to big and not too fancy,
consisting of just 15 to 20 web pages. I've recently started with
xhtml, but i was wondering if there's a more automated and flexible
way. And i would like to have as result simple xhtml files, i would
really prefer not no manage my site with PHP, ASP or the like.
I've started learning xml + xslt, but i'm not sure if what i want is
acievable with these. This is what i have in mind:

1) to keep all content in one (xml or other format) file, say foo.xml
2) to have a stylesheet that stores the general layout of the pages
3) an (another or the same) stylesheet placing each element of foo.xml
in ist proper place in each of the fina pages, so that when processing
it (in MY machine) it outputs all the webpages of the site with proper
layout and content. [snip]
So my questions are:

1) is this achievable with xml+xslt? or is there a better way?

Yes, have a look at Cocoon (cocoon.apache.org). It's quite big, but it
will do what you want.
2) i'd thought of writting my own JAVA program to do this.

Unless you're a masochist I'd use Cocoon...it's all in Java and runs
under Tomcat.

///Peter
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top