[wpkg-users] settings folders problem:
Tomasz Chmielewski
mangoo at wpkg.org
Wed Sep 13 22:26:35 CEST 2006
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
_______________________________________________
wpkg-users mailing list
wpkg-users at lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users
More information about the wpkg-users
mailing list