SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Making a site in XML

    I currently use XHTML and CSS to build sites. What would building a site in XML require? What exactly is an XML site?

  2. #2
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    919
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    An XHTML-site is an xml-site.

    You could compare to: I'm from Paris(France) ->XHTML. I'm from France -> XML.

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you momos.

    OK, my client wishes to provide XML data and me to make a site from it. What do I do?

  4. #4
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    919
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    a few possibilities:

    - use PHP or an other server-language to parse the xml and build your page in this language
    - use an xslt to convert it to an xhtml page
    - style the xml with CSS directly

  5. #5
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by momos
    - style the xml with CSS directly
    This isn't a good idea if your site is meant to be public-facing and search engines are any kind of priority.

  6. #6
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use an xslt to convert it to an xhtml page
    Where do I get this xslt?

  7. #7
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would convert it on the server side and not the client side. http://php.net/xslt
    Simon Pieters

  8. #8
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    919
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  9. #9
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Using client side XSLT is just as bad as styling the XML with CSS directly, if not worse.
    Simon Pieters

  10. #10
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    919
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, actually it is a nice method, but sad enough not very good supported

  11. #11
    SitePoint Enthusiast
    Join Date
    Oct 2003
    Location
    Baltimore, MD
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm actually debating the same issue at the moment, that is, whether or not to use xml, and if so, how to use it. The reason i'm thinking of using xml instead of just using a database is to allow users, or other websites to access the data easily.

    so now i come to the question which way to go? as mentioned above, there are three main options;

    1) server-side parsing
    2) xml + xslt
    3) xml + css

    In the past i've parsed xml with php without too much difficulty, but i'm now considering whether it would just be better to offer the raw xml, and style them with either css or xslt.

    Is the only reason that server-side parsing is better right now is because of poor browser support? Or are there other factors?

    The site i plan to build will contain guides or articles, which will all have the same format, so xml seems like it would be quite appropriate.

    any thoughts or suggestions?

    Thanks,
    Keith

  12. #12
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why HTML is better than generic XML on the client-side:
    • More user agents (think of search engines aswell) accept text/html than XML
    • HTML has semantics that can be understood and used by user agents, generic XML has no semantics at all and thus user agents can't do anything useful with it
    • The presentation layer (CSS or XSLT) is optional, and without it you have no semantics and no logical presentation at all
    Also see http://annevankesteren.nl/2005/05/generic-xml
    Simon Pieters


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •