Newbie question...

Discussion in 'XML' started by Gabriel Guernik, Jun 20, 2006.

  1. 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
    Gabriel Guernik, Jun 20, 2006
    #1
    1. Advertising

  2. Gabriel Guernik

    Peter Flynn Guest

    Gabriel Guernik wrote:
    > 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
    --
    XML FAQ: http://xml.silmaril.ie/
    Peter Flynn, Jun 20, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jerry C.
    Replies:
    8
    Views:
    228
    Uri Guttman
    Nov 23, 2003
  2. Kruno Saho
    Replies:
    0
    Views:
    134
    Kruno Saho
    Apr 7, 2013
  3. Dave Angel
    Replies:
    0
    Views:
    118
    Dave Angel
    Apr 7, 2013
  4. rusi
    Replies:
    0
    Views:
    107
  5. Miki Tebeka
    Replies:
    0
    Views:
    81
    Miki Tebeka
    Apr 7, 2013
Loading...

Share This Page