views:

2289

answers:

9

I would like to create an xml based website. I want to use xml files as datasources since it is a kind of online directory site. Can someone please give me a starting point? Are there any good online resources that I can refer to? I am pretty confortable with ASP and Javascript. Thank you in advance.

Best regards, Aravind

+1  A: 

I'd use PHP with the built in SimpleXML functionality, though I'm sure there is similar functionality with ASP.

Alternatively you could use XSLT to transform the XML to display - depends what the XML is and whether you are creating it or just consuming it.

Rich Bradshaw
Thank you rich. The xml will be consumed, but there will be provision to update the data in it periodicaly
Aravind
+2  A: 

Hey, here's an idea - xhtml is xml, after all, so if you can define the format of the xml files, just create browser-friendly xhtml to begin with.

Otherwise I'm sure there are XML parsing libraries for ASP and you can look into XSLT (which is cool to learn, but a bit more of a challenge).

Jason Morrison
+3  A: 

w3schools has very good information about XSTL.

Mackaaij
A: 

jQuery, AJAX, and PHP are your friends - for static content, a few nested loops in PHP can easily prase XML into XHTML (kudos to the person who pointed out that well-formed xhtml is xml), and with jQuery you can AJAX in additional content as needed.

Also - did I mention that they're all free?

matt lohkamp
A: 

(I'd really recommend using a traditional database instead.)

In ASP you can use the MSXML-component to parse and change XML-files. More information about the MSXML-component can be found on MSDN.

Basicly what you'd wanna do is read a XML-file and do some filtering on the server side, and outputting to the client.

Maybe something like this will get you started: XML:

<data>
  <item visible="no">
    <title>Invisible item 1</title>
  </item>
  <item visible="yes">
    <title>Visible item 1</title>
  </item>
  <item visible="yes">
    <title>Visible item 2</title>
  </item>
</data>

And some ASP:

Dim oXMLDoc
Dim oNode
Set oXMLDoc = CreateObject("MSXML.DOMDocument")
oXMLDoc.Load Server.MapPath("../_private/data.xml")
Set oNode = oXMLDoc.SelectSingleNode("data/item")
Do Until oNode Is Nothing
  If oNode.GetNamedAttribute("visible") = "yes" Then
    Response.Write "Title: " & oNode.SelectSingleNode("title").Text & "<br />" & vbCrLf
  End If
  Set oNode = oNode.nextSibling
Loop
svinto
+4  A: 

If you cannot or don't wish to store your data in XHTML format, then XSLT is definitely the way you want to go. By its very definition, it is a transformation language designed to transform data from one format to another. Because this is it's focus, it provides power, speed and flexibility you won't find in many other solutions. It will also ensure you output standards compliant (X)HTML as it's impossible to do otherwise (well, not without deliberately going out of your way to botch it).

MSXML allows you to do XSL transformations for use in Classic ASP - see this page for an example.

ZVON.org is also a great XSLT reference.

Luke Bennett
Thanks a lot, this looks really useful.
Aravind
A: 

Take a look at tox, http://tox.sourceforge.net/. It is meant for use with Oracle, but you could use the include feature instead to retrieve the XML files. Like most of the other answers, when using tox, you will need to apply a view to your XML via XSLT. There are a couple of very simple examples included in the tox download.

dacracot
+2  A: 

I've worked with an XML/XSLT based templating system and have known others who have and my advice is don't do it. You'll tend to use XSLT as a programming language for presentational logic and it's a headache to develop and maintain.

You could use XML as data sources, but use deserialization or XQuery/XPath to extract the data and use it in a easier-to-use templating system -- even ASP pages are fine.

Mark Cidade
A: 

Web Content Management Made Simple with XML.

SoftXMLCMS is a unique content management system for managing data in XML format. Easy graphical interface enables you to control the profiling data for the creation of hierarchical structures.

SoftXMLCMS is ideal web tool for creating complex multi-page websites in different languages. Main advantage of SoftXMLCMS is that there is no need for a database that significantly reduce the cost of creating a professional website.

The process of installing an application is very simple and requires no special technical skills.

Compatible with the most important browsers available in the market: IE 5.5+, Firefox 1.0+, Mozilla 1.3+, Netscape 7+, Chrome and require ASP JPEG component only to work.

SoftXMLCMS includes a powerful text editor for editing rich HTML documents and images in CMS. The Word-like interface of editor makes content creation easy for business users who know nothing about HTML and want to keep it that way.

SoftXMLCMS includes a ready website template for displaying CMS content. All this will give you set of tools for creating a professional website in minimum time and in cost effective manner.

SoftXMLCMS requires IIS and support of Microsoft ASP technology and ASP JPEG component.

Gregory