Re: [Xweb-developers] XWeb and JTidy
Brought to you by:
peterbecker
|
From: Peter B. <pe...@pe...> - 2004-01-09 21:31:24
|
Hi Murphy, sorry for the delay -- still catching up with the mails from the holiday season. The problem you describe is something I noticed, too. I'd sometimes like to have people using something like Mozilla+TortoiseCVS or similar to maintain the website, with the updates done automatically on the server. That does require something like JTidy. I'd say there are two options (as usual): the quick and dirty and the nice one. Quick and dirty is extending the XSLT specific code to have some option for JTidy. That would mean putting the JTidy calls into the XSLDocType/XSLDocument classes. Not nice at all, but that's why it is the quick and dirty way. Way better would be turning the way XWeb processes files into something stream/pipe-based. I planned that many times before, the simple version of this is to distinguish two types of stream (binary, sax) and to convert between them if required (i.e. XML parsing/writing). Then different processors would have a single input and output and could do different things, which can be used to model XSLT chains, your JTidy->XSLT requirement or more complex options involving things like CLI scripting. The pipe starts with reading the input file and ends with writing the output file. Shouldn't be too hard, but the changes to XWeb would be significant. It would take XWeb closer to other projects like Lagoon or Transmorpher, too. I'd like to do that anyway, but I don't know when I am getting around to do it. The usual problem, esp. in the chaotic times I tend to live :-) Peter murphee (Werner Schuster) wrote: > howdy Peter, > > I am about to use XWeb to maintain a Website, well actually I am > building the skeleton for a website, and other users will maintain > it and provide content. > > Now, my problem is, those users, while tech savy, don't know a lot > about XML, and even if they do, I don't want to force them to > produce valid XHTML as input (I can picture myself getting mails > telling me that "XWeb crashes with an exception", just because > some input file was not valid). > > Now, this can be solved by pre-processing each file with JTidy; > Initially I wanted to do this with Ant (basically just processing > each file with JTidy and writing the resulting files to a > temp directory, and then using that directory as input for XWeb; > I won't do that right now, for some reasons, but might reconsider > in the future). > > Now, I think it would be best to simply adapt XWeb to simply > pre-process a file with JTidy before handing it to XSL; > I found that I could simply do that in XSLDocument, where > you open the file and generate it's DOM tree from it; > Is this the only place that I have to change, or do I have > to adapt something else? > > > > murphee |