Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML, HTML And SQL Server 2000??

Status
Not open for further replies.

EliseFreedman

Programmer
Dec 6, 2002
470
GB
I am currently preparing for my SQL Server 70-229 certification. I am learning about XML at the moment and how it can be used to run queries against SQL Server databases. My Question is can the output from the XML document be output as a formatted HTML document. If So, how would I go about this? Im particularly curious as a friend has emailed me asking for help in developing her website with a searchable recipe database. I was wondering if XML can be used for this purpose.
 
HTML is basically a subset of XML (XML specifically for viewing in browsers). XSL (eXtensible Stylesheet Language) is used to transform XML. You can use XSL to format the XML however you like, thus it is possible (and probably its most used function) to format it in HTML. A good learning point is:


You can also manipulate XML using the DOM, server-side or client-side.

If your friends recipe database is not too large, you could store all the recipes in an XML file:

<recipebook>
<recipe>
<ingredients>......</ingredients>
<cookingmethods>......<cookingmethods>
</recipe>
<recipe>
......
</recipe>
......
</recipebook>

This could then be manipulated with XSL or DOM to produce HTML pages, but if there are many recipes (>2000) then a proper database would be better option.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top