Re: [xml] xmllint as filter?



At 11:36 AM 11/23/01 -0500, Daniel Veillard wrote:
  The point is that a concatenation of XML documents is not an XML document.
And an XML parser, per the spec cannot know when a document finishes, it
has to come as an indication from the layer feeding it. That's why keeping
markers in streams of XML document is crucially important, it allows the
consumer to indicate to the XML parser when the current document finishes.

Which is why we now have a slighly adapted filter for that, that basically does this (in Perl):

------------------------------------------------------------------------
# Start the XML output

print <<EOD;
<?xml version="1.0" encoding="$encoding"?>
<docseq>
EOD

# For all of the lines
#  Pass the line through if it is not a processing instruction

while (<STDIN>) {
  print unless m#^<\?xml#;
}

# Print the rest of this XML stream

print <<EOD;
</docseq>
EOD
------------------------------------------------------------------------

The ending of the <docseq> container indicates that the indexer can finish up indexing.


> And if I would like to do a global variable, I would have to tweak
> ../include/libxml/globals.h , right?
 right to export the name and the .c too to actually define that variable.

Ok, then I got that right at least...  ;-)

However, it seems that the adaptation of my simple docseq filter will handle all of this also (at the expense of a slight overhead).



Elizabeth Mattijsen




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