Click here to Skip to main content
Click here to Skip to main content

XML MessageBoard

By , 12 Jun 2001
 

Introduction

As part of my quest to learn more about XML and its associated technologies, I decided to implement a XML bulletin board / message board system. It serves as useful example to others learning the technology and to those who simply would like to incorporate a message board system into their website (without having to install an expensive SQL database). This version of the XML Messageboard should work correctly under the production MSXML 3.0. If you don't already have the XML 3.0 SDK, download it from the Microsoft Web Site!

The downloadable archive contains the following files:

Default.htm

The main page leading to others

Global.asa

Contains application scope logic (loading XML doc)

Post.asp

HTML form for entry of new messages

Reply.asp

HTML form for entry of message replies

Viewmessage.asp

ASP logic for displaying a single message

Viewmessage.xsl

XSL stylesheet for displaying a singlemessage

Viewmessagelist.asp

ASP logic for displaying hierarchical list of messages

Viewmessagelist.xsl

XSL stylesheet for displaying hierarchical list of msgs

Submitmessage.asp

ASP logic for inserting a message in the message tree

Messageboard.biz

XML Schema for the messageboard.XML

To install and run this XML application on your own system you will need:

  • An ASP enabled web server such as Internet Information Server
  • Microsoft’s XML parser (MSXML 3.0 and higher)

You’ll need to configure your web server’s file write access permissions in the directory where you install the above files. This can be a little tricky in IIS so be sure read the IIS documentation to find out how.

A message board system is suited to XML implementation, because it is inherently a hierarchical system.

<messageboard>
	<group>
		<message>
			<message>
			</message>
		</message>
	</group>
<messageboard>

A message is contained within a message group. A reply to a message is neatly contained within its original message. This simple structure is used to define a message tree. The entire message tree is stored in the XML flat file messageboard.xml.

The information contained in the message tree is displayed in an appropriate format using XSL style sheets. This example does not rely on the presence of an XML/XSL capable browser. It uses XSL processing on the server-side to output HTML for legacy browser
compatibly. However the example could just as easily be modified to support XSL processing on the client.

The root node (“messageboard”) in the XML message tree is constructed in the Application_OnStart method of global.asa supposing no messages have been posted. The DOMDocument object is therefore defined at application-level scope, meaning that multiple users access the same document tree in memory.

Each message in the message board contains the following attributes:

Subject = the subject of the message
Nick = the nickname of the person who wrote the message
Id = a unique identifier associated with the stored message
PostDt =  the time and date when the message was posted

The file submitmessage.asp contains ASP the logic for inserting a message node into the message tree, in response to new post and reply to message operations. The message hierarchy is stored in the file messageboard.xml. This file is automatically created if it does not exist, so don't be surprised if its missing in the distribution.

The XSL stylesheets viewmessagelist.xsl, and viewmessage.xsl, display a list of hierarchical messages in a message group and the contents of a message, respectively.

XSL parameters are used extensively, for example, to display a particular message associated with a message Id, the viewmessage.xsl stylesheet includes the tag:

  <xsl:param name="msgid"/>

The above msgid parameter is supplied prior to XSL processing in the ASP script:

xslproc.addParameter "msgid",CStr(id) xslproc.transform

where id contains the unique id of the message to be displayed.

Message IDs are used to locate messages in the message board, using the nodeFromID() method available in the MSXML-2 XMLDOMDocument object.

By far the most interesting style sheet is viewmessagelist.xsl. The style sheet displays the message hierarchy by recursively applying message templates and using the HTML DIV tag to format the output in an indented fashion.

There are a number of useful extensions that can be added to this example, if you’re keen to beef up your XML expertise:

  • Implement a search function enabling users to find messages on the message board
  • Incorporate message count statistics for each message group
  • For each user (nick) supply information on which messages have been read / not read
  • Link up message groups from different sources (i.e. web sites)

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

jamieb22
Web Developer
South Africa South Africa
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralPlease Answer if you can.memberrichiebey13 Oct '06 - 14:06 
This message board that I'm posting on is exactly what I want. However, I need to build it within a .net page and as you may well know, simple asp won't work.
 
Does anyone know of code that I can get for this? There is already a .net treeview app running in the page.
 
velcrobomb
GeneralRe: Please Answer if you can.memberrichiebey13 Oct '06 - 14:08 
If I'm an idiot and this is the actual XML message board described above, I apologize in advanced.
General[ANNOUNCE] STYLUS STUDIO OFFERS ALTOVA XMLSPY AND MAPFORCE USERS A FREE UPGRADE TO STYLUS STUDIO 6 XML ENTERPRISE EDITIONmemberstylusstudio4 Oct '05 - 7:14 
[ANNOUNCE]
Customers who Purchased Altova XML Products Can Now Obtain a Free Upgrade to Stylus Studio® 6 XML Enterprise Edition, the World's Best XML IDE
 
Bedford, MA, October 4, 2005 – Stylus Studio (http://www.stylusstudio.com), the world's leading provider of XML tools for advanced data integration, today announced a new competitive upgrade program allowing customers who purchased Altova XMLSPY® 2005 or Altova XMLSPY® 2004 (Professional or Enterprise Editions) or Altova Mapforce® 2005 or Altova Mapforce® 2004 (Professional or Enterprise Editions) on or before October 1, 2005, to upgrade to Stylus Studio® 6 XML Enterprise Edition for free (limit one free single-user license per order, per company). Altova XMLSPY customers pay absolutely NOTHING for this upgrade to Stylus Studio. But wait, there's more! Altova XMLSPY users who take advantage of this offer will also receive a coupon good for 30% off an unlimited number of single-user licenses of Stylus Studio 6 XML Enterprise Edition and Stylus Studio 6 XML Professional Edition from the Stylus Studio Online Shop, good for 14 days. This offer cannot be combined with any other offers, cannot be applied to past purchases, and expires October 14, 2005. Qualifying customers can see complete offer details and upgrade online today at: https://www.stylusstudio.com/buy/getoutofjailfree.html
 
"Altova developers are missing out big time, and it just makes sense for us to educate the market about their options when it comes to XML tools and components," said Jerry King, Stylus Studio's General Manager. "If you're unimpressed by the latest new features in Altova XMLSPY 2006 and feel that there's got to be a better XML tool out there, we encourage developers to make the switch to Stylus Studio this week. You won't be alone! Visit our website, get educated on the facts about XML tools and components, and see why upgrading to Stylus Studio 6 makes so much sense."
 
Why it's time to Make the Switch
 
Stylus Studio has developed a free educational center where developers can learn more about scratching the itch to switch: http://www.stylusstudio.com/switch.
 
• We compiled a list of the top 10 reasons to switch to Stylus Studio. Visit http://www.stylusstudio.com/top_ten.html.
• Customers tell in their own words why switching to Stylus Studio was so compelling. See http://www.stylusstudio.com/cust_switch_stories.html.
• Read our special report on AltovaXML™, which documents issues with the core XML processing technology that powers both Altova XMLSPY and Altova MAPFORCE at: http://www.stylusstudio.com/altovaxml.html.
 
Why Upgrade to Stylus Studio?
 
Stylus Studio 6 XML Enterprise Edition provides the world's most powerful and productive XML IDE for advanced XML data integration, providing dozens of integrated tools for developing, debugging and deploying advanced XML applications. This comprehensive and standards-based XML IDE provides XML developers with everything they need without having to purchase 2-6 different products, or sometimes a suite of products. Here are just a few of the highlights of the new features in Stylus Studio 6 XML Enterprise Edition, Release 3:

• Java™ Code Generation: Now you can generate Java code for your XQuery and XSLT stylesheets and deploy that code to a live production server or application. Stylus Studio captures the settings specified in the XQuery and XSLT scenarios – your choice of XML processor, parameters, input/output files, and post processing options, for example – and reflects them in the generated Java code.
• Updated W3C XQuery Compliance: Stylus Studio is the first XML IDE to fully support the W3C XQuery working draft of April 2005, taking the lead on the path of innovation to this critical emerging data integration technology.
• New XML Schema Productivity Tools: Generate sample XML fragments from XML Schema components, create XML Schema documentation with a familiar JavaDoc-like layout, perform XML Schema-based output validation of XSLT or XQuery transformations… These and many more usability enhancements further strengthen Stylus Studio's position as the most innovative XML Schema tool for XML data modeling.
• XML File Explorer Window: The new File Explorer window provides a handy way for developers to manage files in Stylus Studio and to perform other basic file-oriented operations (delete, copy, and rename, for example). You can also easily convert files by dragging the file you want to convert onto any built-in or user-defined adapter. A new Auto-Backup feature optionally creates backup files of your documents when you save them.
• XML Diff Text View: XML Differencing is even easier now with a third way to view differences in XML documents. In addition to the Split View - Tree tab and the Merged tab, you can now view two documents side-by-side in plain text on the Split View - Text tab.
• Canonical XML Converter: Convert XML into canonical form with a single mouse click – just one of the many new XML editing utilities in the Stylus Studio XML Editor.
• XML Spell Checker: Admit it, there's a reason you didn't become a marketing copywriter – but now you can impress your colleagues with your brilliant command of the English language with the Stylus Studio XML Spell Checker.
• EDIFACT to XML Schema Conversions: Simplify EDIFACT data integration projects with a new utility for generating XML Schema from EDIFACT messages, fully integrated with the XML Schema Editor.
• JAXB Support: Generate Java-XML bindings from your XML Schemas using the Java API for XML Binding (JAXB) – fully integrated with the Java IDE and XML Schema Editor.
• FREE Upgrade: Need we say more?
 
Qualified customers can upgrade to Stylus Studio 6 XML Enterprise Edition for free at: https://www.stylusstudio.com/buy/getoutofjailfree.html
 

Generals.ninkov@student.qut.edu.aususss.ninkov@student.qut.edu.au8 Sep '05 - 21:32 
Someone email me please !
 
s.ninkov@student.qut.edu.au
GeneralAnonymous postingsussAnonymous22 Jun '05 - 19:11 
trying one out
 
featherbubbles
GeneralTesting StuffsussAnonymous5 May '05 - 16:41 
Look at this comment
GeneralRe: Testing StuffsussAnonymous5 May '05 - 16:41 
ABC DEF GHI
GeneralAtlantarug GaragebidsussAtlantarug Garagebid6 Jan '05 - 21:25 
Offering oil paintings, like landscape oil painting, abstract oil painting,floral oil painting, cartoon,figures oil painting ,inspirational oil painting etc..
http://www.garagebid.com
area rug, sunflower rug, oriental rug,animal print rug, fur rug, persian rug
http://www.atlantarug.com
Generalgold jewelry,sterling silver jewelrysussfamoushandbag5 Jan '05 - 19:00 
Wink | ;) ;)Laugh | :laugh: Laugh | :laugh: Laugh | :laugh: Laugh | :laugh: Laugh | :laugh: Laugh | :laugh: :nice site!!good work!!!you've created a very good site and i found a lot of interesting,and good information on your site.Do you like Handbag, gold jewelry,sterling silver jewelry?Go to my websit,it is a very good websit.
http://www.wholesalepearl.com
http://www.famoushandbag.com
http://www.gsc-usa.com
http://www.Hariagencies.com
http://www.ladyblasters.com
http://www.bushenterprises.com
http://www.diamond-queen.com
http://www.diamond-king.com
http://www.diamondphd.com
http://www.garagebid.com
http://www.atlantarug.com
http://www.pearl-pearls.com
http://www.errandsetc-fl.comlaugh:
GeneralAccess a method in another server using xmlhttpmemberthayalan4411 Dec '04 - 0:29 
Shown below is ASP Code sample that tries to access a method,CreateUser in the server called,
 
"http://smallbutsmart.basis.com.au" using the protocol,XMLHTTP. Can you explain to me why this
 
Code does not work and showing the correct Code Sample?
 

 
<%
dim objXMLHTTP
set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.Open "Post", "http://smallbutsmart.basis.com.au", false
'objXMLHTTP.SetRequestHeader "Content-type", "text/html"
'objXMLHTTP.CreateUser "abc","123","Scriven","1","001","qms"
objXMLHTTP.Send
%>

QuestionHow to write the xsl for this RSS news feed and use it in aspsussMathavan21 Nov '03 - 3:01 
Hello to all!
 
I want use below RSS news feed in xml, I wrote many xsl file, but gave error...
Please help me to design the XSL file, I am going to use in my asp code
Any one Please
Thanks
Mathavan, India
 
<?xml version="1.0"?>
<rss version="2.0">
     <channel>
          <title>The Indian Express</title>
          <link>http://www.indianexpress.com</link>
          <description>The Indian Express Online Edition</description>
          <language>en-us</language>
          <pubDate>Fri, 21 Nov 2003 02:11:44 GMT</pubDate>
          <lastBuildDate>Fri, 21 Nov 2003 02:11:44 GMT</lastBuildDate>
          <docs>http://www.expressindia.com/syndications/</docs>
          <generator>The Indian Express Group</generator>
          <category domain="http://www.weblogs.com/rssUpdates/changes.xml">rssUpdates</category>
          <managingEditor>editor@expressindia.com (Editor)</managingEditor>
          <webMaster>admin@expressindia.com (Admin)</webMaster>
 
         
     <item>
          <title>Objection, Your Lordship, Govt tells apex court</title>
          <link>http://www.indianexpress.com/full_story.php?content_id=35748</link>
          <description>Undaunted by the Supreme Court's stinging criticism that it was encroaching into its domain, the Government today said that Commerce Secretary Dipak Chatterjee was ''the most appropriate person'' to be appointed as chairman of the newly constituted Competition Commission of India (CCI).</description>
          <guid>http://www.indianexpress.com/full_story.php?content_id=35748</guid>
          <comments>http://www.indianexpress.com/comments_form.php?content_id=35748</comments>
     </item>
    
     <item>
          <title>Riots keep Wipro away from Gujarat, says chief Azim Premji</title>
          <link>http://www.indianexpress.com/full_story.php?content_id=35750</link>
          <description>WIPRO chairman Azim Premji has blamed communal violence and proximity to Pakistan as key reasons why Wipro has not started operations in a major way in Gujarat.</description>
          <guid>http://www.indianexpress.com/full_story.php?content_id=35750</guid>
          <comments>http://www.indianexpress.com/comments_form.php?content_id=35750</comments>
     </item>
    
     <item>
          <title>Daler pops up, makes a land deal on the run </title>
          <link>http://www.indianexpress.com/full_story.php?content_id=35751</link>
          <description>Singer Daler Mehndi may be on the run but that has not stopped him from striking property deals. While the Punjab police were initiating the process of declaring him a proclaimed offender (PO) on November 17, the pop star was selling a plot in Sohna, near Gurgaon.</description>
          <guid>http://www.indianexpress.com/full_story.php?content_id=35751</guid>
          <comments>http://www.indianexpress.com/comments_form.php?content_id=35751</comments>
     </item>
    
     <item>
          <title>The Biharis who never saw Bihar until last night</title>
          <link>http://www.indianexpress.com/full_story.php?content_id=35753</link>
          <description>There are many who have no idea what this ruckus over railway jobs is all about. Nor do they have any place to go to: the school where they have sought shelter is a temporary relief camp, organised by some locals because the administration is yet to make up its mind whether these people should be provided relief material.</description>
          <guid>http://www.indianexpress.com/full_story.php?content_id=35753</guid>
          <comments>http://www.indianexpress.com/comments_form.php?content_id=35753</comments>
     </item>
    
     <item>
          <title>Cricket's new smear: cash for India cap? </title>
          <link>http://www.indianexpress.com/full_story.php?content_id=35752</link>
          <description>Allegations of trying to buy his place into the India A side against Maharashtra cricketer Abhijit Kale have kicked off a fresh controversy in Indian cricket.According to the allegations, Kale offered national selectors Kiran More and Pranab Roy Rs 10 lakh each for a place in the India A for the series against Sri Lanka A.</description>
          <guid>http://www.indianexpress.com/full_story.php?content_id=35752</guid>
          <comments>http://www.indianexpress.com/comments_form.php?content_id=35752</comments>
     </item>
    
     <item>
          <title>With Washington in London, terror targets UK in Turkey</title>
          <link>http://www.indianexpress.com/full_story.php?content_id=35763</link>
          <description>Suspected Islamist suicide car bombers killed at least 27 people and wounded hundreds in Istanbul on Thursday in a strike against Britain that US and British leaders called a challenge to their war on terror.The Consulate's chaplain said Consul-General Roger Short, a career diplomat, was among the 15 killed at the mission.</description>
          <guid>http://www.indianexpress.com/full_story.php?content_id=35763</guid>
          <comments>http://www.indianexpress.com/comments_form.php?content_id=35763</comments>
     </item>
    
     <item>
          <title>Iftar at Ayodhya's Hanumangarhi temple</title>
          <link>http://www.indianexpress.com/full_story.php?content_id=35764</link>
          <description>For the first time ever a largely-attended roza iftar was organised in the campus of Hanumangarhi temple on Thursday evening. </description>
          <guid>http://www.indianexpress.com/full_story.php?content_id=35764</guid>
          <comments>http://www.indianexpress.com/comments_form.php?content_id=35764</comments>
     </item>
    
     <item>
          <title>Paper got something newsworthy and published it: Advani</title>
          <link>http://www.indianexpress.com/full_story.php?content_id=35749</link>
          <description>Asked if The Sunday Express had done the right thing by publishing the report on the Judeo tape, Union Home Minister L K Advani said here today: ''The newspaper got something that was newsworthy and published it.</description>
          <guid>http://www.indianexpress.com/full_story.php?content_id=35749</guid>
          <comments>http://www.indianexpress.com/comments_form.php?content_id=35749</comments>
     </item>
    
    
          <image>
               <title>The Indian Express</title>
               <url>http://www.indianexpress.com/grfx/ie88x31.gif</url>
               <link>http://www.indianexpress.com</link>
          </image>
     </channel>
</rss>

Generalfor testingsussAnonymous7 Sep '03 - 4:18 
hiii this is for testing
GeneralRe: for testingsussAnonymous7 Sep '03 - 4:18 
dddddddd
GeneralI get &quot;Required property does not have a valid value.&quot;memberbongospanners5 Aug '03 - 23:36 
I've tried messing around with it but think that XMLDOM 4 works with the transform method slightly differently. Microsoft keep saying it's something to do with the contents of syle sheets on google groups which I don't buy.
 
I think that this is a change in implementation between different versions of the ASP XML dom.
 
I'm gonna try and place the global.ASA VARIABLES into page scope to test if this makes a difference and the fault lies within iis, I doubt this as I'm fairly sure the global.asa is actually working although properties are assigned in here. I will report on my progress
 
clicky for my site

GeneralRe: I get &quot;Required property does not have a valid value.&quot;sussAnonymous8 May '05 - 9:35 
I am also getting this error. Pls help!.. How to solve it.
GeneralRe: I get &quot;Required property does not have a valid value.&quot;sussAnonymous8 May '05 - 9:36 
testing
Generalits goodsussAnonymous12 Mar '03 - 13:07 
Frown | :( img src="/script/Forums/Images/smiley_cry.gif" align="top" alt="Cry | :((" /> Suspicious | :suss: Eek! | :eek: Smile | :) Wink | ;) Poke tongue | ;-P Big Grin | :-D Frown | :( img src="/script/Forums/Images/smiley_cry.gif" align="top" alt="Cry | :((" /> Sleepy | :zzz: OMG | :OMG: WTF | :WTF: Roll eyes | :rolleyes: Laugh | :laugh: Mad | :mad: Confused | :confused: Unsure | :~ Hmmm | :| Dead | X| Suspicious | :suss: Cool | :cool: Eek! | :eek: Rose | [Rose] Suspicious | :suss: Mad | :mad: Blush | :O Frown | :( img src="/script/Forums/Images/smiley_eek.gif" align="top" alt="Eek! | :eek:" /> Hmmm | :| Blush | :O
GeneralIMPORTANT NOTE!!!!sussAnonymous25 Dec '02 - 18:57 

If you are having trouble getting this working:
 
Make sure you create the website using Visual Interdev. If you use IIS, it does not execute the global.asa file. Thus the global objects are not available. Hence the error.


GeneralRe: IMPORTANT NOTE!!!!sussAnonymous10 Dec '03 - 4:26 
sadfasdfsdf
Generaltest posteditorNishant S19 Dec '02 - 11:50 
jus testing the xml msg board
 
Roll eyes | :rolleyes: Unsure | :~ Big Grin | :-D OMG | :OMG: Sleepy | :zzz: Confused | :confused: Mad | :mad: Unsure | :~ Unsure | :~ Suspicious | :suss:
 
Nish Poke tongue | ;-P
 

Author of the romantic comedy

Summer Love and Some more Cricket [New Win]

Review by Shog9
Click here for review[NW]

GeneralRe: test posteditorNishant S19 Dec '02 - 11:53 
Hello all,
 
This was just a joke. As CG says below if you want to try out the actuial msgboard, please download the stuff from the download link at the top of the article.
 
Thanks
Nish
 

Author of the romantic comedy

Summer Love and Some more Cricket [New Win]

Review by Shog9
Click here for review[NW]

GeneralRe: test postmemberChristian Graus19 Dec '02 - 12:55 
Yup - Nish is back. And it's all good.

 
Christian
 
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002

C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002


Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable.
- Jamie Nordmeyer - 15-Nov-2002
GeneralRe: test posteditorNishant S19 Dec '02 - 12:56 
Christian Graus wrote:
Yup - Nish is back. And it's all good.
 
Smile | :) It's sorta nice now for me. I was feeling quite homesick here but now that I Lounge about a little while everyday, I feel a lot like home again Smile | :)
 
Nish
 

Author of the romantic comedy

Summer Love and Some more Cricket [New Win]

Review by Shog9
Click here for review[NW]

GeneralYou're all STUPID !!!!memberChristian Graus19 Dec '02 - 9:55 
Every single article on this site has this board at the bottom for discussion of the article. You're not using the message board the article is about, that's what the download is for.
 
I continue to maintain that authors should have the right to delete posts by anonymous morons.

 
Christian
 
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002

C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002


Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable.
- Jamie Nordmeyer - 15-Nov-2002
GeneralRe: You're all STUPID !!!!editorNishant S19 Dec '02 - 11:51 
Hello mon ami
 
I tested the xml board here
and it really does work
just like in the ad above it
what a long ad eh?
 
Nish Big Grin | :-D
 

Author of the romantic comedy

Summer Love and Some more Cricket [New Win]

Review by Shog9
Click here for review[NW]

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 13 Jun 2001
Article Copyright 2001 by jamieb22
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid