Re: [fpc-pascal] Re: XML pretty formatter
People, my problem was solved with the help of xsltproc in a Linux box where one our services is running, and it works really good. But it could be nice to have an Object Pascal version of the library, to be able to do the same without needing to use an external program. Leonardo M. Ramé http://leonardorame.blogspot.com --- On Fri, 5/15/09, Graeme Geldenhuys wrote: > From: Graeme Geldenhuys > Subject: Re: [fpc-pascal] Re: XML pretty formatter > To: "FPC-Pascal users discussions" > Date: Friday, May 15, 2009, 6:09 AM > On Fri, May 15, 2009 at 11:01 AM, > Michael Van Canneyt > > > IMHO we should have the latter. We have a > near-complete DOM implementation > > in native object pascal, we have XPath in native > pascal. It seems only natural > > to have XSLT native as well... > > That would be nice obviously, but it's not something I > think can be > done quickly. A project for a rainy day (oh boy, I'm > screwed - it's > winter here). :-) > > I'll make a note in my todo list, but realistically I will > not be able > to touch it for the next 12 months. My clones are on > strike! > > Regards, > - Graeme - > > > ___ > fpGUI - a cross-platform Free Pascal GUI toolkit > http://opensoft.homeip.net/fpgui/ > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: XML pretty formatter
On Fri, May 15, 2009 at 11:01 AM, Michael Van Canneyt > > IMHO we should have the latter. We have a near-complete DOM implementation > in native object pascal, we have XPath in native pascal. It seems only natural > to have XSLT native as well... That would be nice obviously, but it's not something I think can be done quickly. A project for a rainy day (oh boy, I'm screwed - it's winter here). :-) I'll make a note in my todo list, but realistically I will not be able to touch it for the next 12 months. My clones are on strike! Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: XML pretty formatter
On Fri, 15 May 2009, Graeme Geldenhuys wrote: > On Fri, May 15, 2009 at 8:43 AM, Michael Van Canneyt > wrote: > > > > I think he meant a pascal version of the xsltproc program. > > Oh, my mistake.. xsltproc is just a frontend for the libxslt library. > So you should be able to write a object pascal program that talks to > the libxslt library directly (like is done for many other libraries - > just convert the header files). Or do you want a object pascal > version of the library as well? That would be even more work. :-( IMHO we should have the latter. We have a near-complete DOM implementation in native object pascal, we have XPath in native pascal. It seems only natural to have XSLT native as well... Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: XML pretty formatter
On Fri, May 15, 2009 at 8:43 AM, Michael Van Canneyt wrote: > > I think he meant a pascal version of the xsltproc program. Oh, my mistake.. xsltproc is just a frontend for the libxslt library. So you should be able to write a object pascal program that talks to the libxslt library directly (like is done for many other libraries - just convert the header files). Or do you want a object pascal version of the library as well? That would be even more work. :-( Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: XML pretty formatter
On Fri, 15 May 2009, Graeme Geldenhuys wrote: > On Thu, May 14, 2009 at 8:15 PM, Leonardo M. Ramé > wrote: > > > > BTW, is there any Pascal source code out there to do this?. > > I'm sure you can convert the .xsl file to pascal source, but that > might just be more effort than it's worth. I think he meant a pascal version of the xsltproc program. Michael.___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: XML pretty formatter
On Thu, May 14, 2009 at 8:15 PM, Leonardo M. Ramé wrote: > > BTW, is there any Pascal source code out there to do this?. I'm sure you can convert the .xsl file to pascal source, but that might just be more effort than it's worth. Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: XML pretty formatter
Thanks Seth and Graeme, the problem is the program must run on a remote server that hasn't installed Tidy.pm, but fortunately it has xsltproc, so I'll try Graeme's solution. BTW, is there any Pascal source code out there to do this?. Leonardo M. Ramé http://leonardorame.blogspot.com --- On Thu, 5/14/09, Seth Grover wrote: > From: Seth Grover > Subject: [fpc-pascal] Re: XML pretty formatter > To: fpc-pascal@lists.freepascal.org > Date: Thursday, May 14, 2009, 2:06 PM > I don't know what your requirements > are for platform/language, but > this works nicely for me: > > -- > #!/usr/bin/perl > > use XML::Tidy; > > my $xmlFile = '/path/to/filename'; > my $tidy_obj = XML::Tidy->new('filename' => > $xmlFile); > $tidy_obj->tidy(); > $tidy_obj->write(); > -- > > > > > Hi, I'm looking for a simple XML pretty formatter, or > parser who can remove all superfluous characters from XML > files. > > > > My application receives an XML file from an external > app. containing many spaces and CRLFs after closing tags, > this doesn't affect my parser, but I need to add the XML to > a log file and those spaces make very difficult to read the > logs. > > > > Thanks in advance. > > > > Leonardo M. Ramé > > > -- > This email is fiction. Any resemblance to actual events > or persons living or dead is purely coincidental. > > Seth Grover > sethdgrover[at]gmail[dot]com > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal