rl201 wrote: > On Wed, 13 Sep 2006, Tomasz Chmielewski wrote: >> Sherwood Botsford wrote: > >>> As a ToDo item: Could wpkg emit an error when it finds something out of >>> place in parsing files: E.g: >>> "<package> tag found outside of <packages> context in file >>> packages/foo.xml, line 20" > >> I think not - error generation is made by cscript itself; to do a proper >> error handling we would have to write our own >> parsing-and-error-reporting program, perhaps many times longer than >> wpkg.js right now... > > I use xmllint for this. My script pulls packages from an SQL server, > stitches them into an XML file and only if xmllint says its valid does it > then over-write the original. Saves a lot of grief when I mis-type > something in the web front-end! (Script available on request, of course.)
I didn't know this tool: # xmllint hosts.xml hosts.xml:28: parser error : expected '>' # xmllint /tmp/empty /tmp/empty:1: parser error : Document is empty ^ /tmp/empty:1: parser error : Start tag expected, '<' not found ^ And for "<package> tag found outside of <packages> context" error we would get: # xmllint firefox.xml firefox.xml:22: parser error : expected '>' </packages> ^ firefox.xml:23: parser error : Opening and ending tag mismatch: packages line 3 and package </package> -- Tomasz Chmielewski http://wpkg.org ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ wpkg-users mailing list wpkg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wpkg-users