Jump to content

XML Webpage Newbie Advice


ehartnett00

Recommended Posts

A few years ago I took a course one XML but I haven't used it since so I'm very rusty. I'm a librarian at a small college and I'm trying to convert part of our website, our Subject Guides (a list of the most relevant resources for a particular subject area), into XML. I'm wanting to do this mainly because each web subject guide has a corresponding printable pdf version (which has a little bit different formatting) and each time I make a change to the subject guide I have to go in and manually change the pdf version of the subject guide and save it as a pdf again. I'm hoping by going to XML, the whole process will be a little more efficient.Here is a link to one of the subject guides:Agriculture Subject GuideForgetting about the banner and navigation bar at the top, I've created an XML version of the subject guide:

<?xml version="1.0" encoding="ISO-8859-1"?><subjectguide>	<title>Agriculture</title>	<abbreviation>Ag</abbreviation>	<callnumberareas>		<callnumber>Agriculture - S-SK</callnumber>		.		.	</callnumberareas>	<websites>		<websitename url="http://...">The Agriculture Network Info Center</websitename>		.		.	</websites>	<databases>		<databasename url="http://...">Ebscohost</databasename>			<databasesub>Agricola</databasesub>		.		.	</databases>	<periodicals>		<periodicalname>Ag Illustrated</periodicalname>		.		.	</periodicals>	<referencebooks>		<referencetitle callnumber="REF S411 .E713 1994">Encyclopedia of Agricultural Science</referencetitle>		.		.	</referencebooks>	<videos>		<videotitle callnumber="SF 207 .C377 1994">Cattleman's Satellite Shortcourse</videotitle>		.		.	</videos></subjectguide>

I was hoping someone could take a look and tell me if I'm on the right track or provide any other advice they might have.Thanks.

Link to comment
Share on other sites

Well, it seems you're on the right track. Unless there was some other information that you need to process separatly, in which case you'd emcompass it in it's own element.The only thing you really must ask yourself is whether you can have an XSLT processor and a FO processor. XSLT to convert the XML into (X)HTML and XSL-FO, and FO processor to turn the FO into PDF.In the worse (in my opinion) scenario, you'll create the files within the S3L of your choise (what do you have at your disposal actually? PHP(5), ASP(.NET)?).

Link to comment
Share on other sites

Well, it seems you're on the right track. Unless there was some other information that you need to process separatly, in which case you'd emcompass it in it's own element.The only thing you really must ask yourself is whether you can have an XSLT processor and a FO processor. XSLT to convert the XML into (X)HTML and XSL-FO, and FO processor to turn the FO into PDF.In the worse (in my opinion) scenario, you'll create the files within the S3L of your choise (what do you have at your disposal actually? PHP(5), ASP(.NET)?).
Wow, I'm wondering if I'm in over my head. My mind hadn't even gotten to the formatting stage. Do you mean that it would be a big problem to try to take my xml subject guide and convert it into both an html web page and a pdf file? If so, I didn't know that. I'm not familiar with the acronym S3L. What is it? I do have access to PHP. I installed it for another thing on our website but didn't have to actually do any programming with it and don't have any experience programming with it. I've used ASP but have not used ASP.NET. The website is on a Windows 2000 server.Thanks for your help.
Link to comment
Share on other sites

S3L is my own acronym (see the bottom of my signature). Stands for Server Side Scripting Language.No. It's not a problem... if you have everything you need that is. And that part may be problematic, because S3Ls don't have all of the tools built in and hosts almost never include those extensions. But such DO exist so it's not impossible if you happen to be on a good host.PHP you say. And on Windows even. If it's PHP5, then perfect. Not only the tools you need are available for it, but the latest tools, the ones you could need in the future (not for this project I think) are available for it.In order to turn the XML into (X)HTML or any other format, you'll need XSLT (version 1.0 would do it too). Ideally with PHP5 and the XSL extension. PHP4 can do it too, but the story is quite different there (for starters, it's the XSLT extension, and the syntax is completely different).There are also other ways (DOM, SimpleXML for the XML parsing; PDFlib for the PDF creation) if you insist on not using XSLT, but it's quite more verbose and if you decide/have to switch to ASP(.NET), you'll have to rewrite everything, other then the content itself of course.

Link to comment
Share on other sites

S3L is my own acronym (see the bottom of my signature). Stands for Server Side Scripting Language.No. It's not a problem... if you have everything you need that is. And that part may be problematic, because S3Ls don't have all of the tools built in and hosts almost never include those extensions. But such DO exist so it's not impossible if you happen to be on a good host.PHP you say. And on Windows even. If it's PHP5, then perfect. Not only the tools you need are available for it, but the latest tools, the ones you could need in the future (not for this project I think) are available for it.In order to turn the XML into (X)HTML or any other format, you'll need XSLT (version 1.0 would do it too). Ideally with PHP5 and the XSL extension. PHP4 can do it too, but the story is quite different there (for starters, it's the XSLT extension, and the syntax is completely different).There are also other ways (DOM, SimpleXML for the XML parsing; PDFlib for the PDF creation) if you insist on not using XSLT, but it's quite more verbose and if you decide/have to switch to ASP(.NET), you'll have to rewrite everything, other then the content itself of course.
Knowing that I have a good XML template to start with, what do you advise my next step to be? Should I work on a dtd or work on the XSLT or something else?
Link to comment
Share on other sites

You don't need a DTD or Schema for that matter, unless others were to edit those XML files. I mean, if there are others, they make mistakes, and DTD or Schema would ensure they don't make such.You should work on XSLT for XML-to-XHTML transformation. Go to the FO or PDF later.But before that, actually ensure you have the XSL(T) extension on the server and some sort of tool to create PDFs.

Link to comment
Share on other sites

You don't need a DTD or Schema for that matter, unless others were to edit those XML files. I mean, if there are others, they make mistakes, and DTD or Schema would ensure they don't make such.You should work on XSLT for XML-to-XHTML transformation. Go to the FO or PDF later.But before that, actually ensure you have the XSL(T) extension on the server and some sort of tool to create PDFs.
I've started working on the XSLT. I'll probably be back once I get it finished. Thanks again for your help.
Link to comment
Share on other sites

With a risk of discouraging you into using this otherwise beautiful language, there's also software that converts HTMLs to PDFs on the fly. Such include, but are not limited to DOMPDF for PHP 5.Using XML and XSLTs will allow you much more the HTML and PDF, but is certanly not as easy as that (I guess).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...