Re: [xml] xmllint as filter?



On Fri, Nov 23, 2001 at 04:35:11PM +0100, Elizabeth Mattijsen wrote:
I'm looking at using "xmllint" as a filter for a stream of XML-documents 
that become one large XML document.  What I want to do is to inhibit an 
improperly formed document to enter the stream, which would otherwise 
improperly form the complete stream.

  concatenating a set of XML files onto a single stream is in the
majority of the cases I have seen a serious design error.

It seems that "xmllint" could be used for that, if it were not for the 
<?xml processing directive that is always output.

  simply filter it on top of xmllint with a simple script, this
sounds quite more sane.

I've changed the source of xmllint.c to allow for an extra parameter
"--noxmlproc", but now find it difficult to actually get that flag setting 
passed to "xmlDocContentDumpOutput" in tree.c.

Would it make sense to add parameters to all "intervening" routines that 
get passed through to "xmlDocContentDumpOutput", or would the introduction 
of a global variable make more sense?  If a global variable would make 
sense, it would probably have to be one that resets itself after being 
checked so that you would have to set it each time you would want a 
document dumped without the <?xml processing directive.

However, I'm too rusty in C to know how to do a global variable: if someone 
could point me the way towards that, I could create a diff to tree.c as 
well that would perform the suggested change.

  Libxml2 API is being frozen currently. I'm not found at all about
adding a new global variable, and totally opposed to change the signature
of the existing routines especially as you noted the right API already
exists.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]