Skip to content
Prev 110113 / 398500 Next

gsub: replacing a.*a if no occurence of b in .*

Ulrich Keller wrote:
Instead of using xmlTreeParse() which really expects well-formed XML,
and assuming you cannot have the XML generation mechanism fixed, you might
try to use htmlTreeParse().
While the name suggests it is for HTML, it is really a "relaxed"
XML parser that is capable of handling malformed XML.  This typically
occurs in HTML and hence the name.
Of course, since the XML is malformed, the results will be hard to predict
as it is hard to make sense of "non-sense".


If xmlTreeParse() is actually causing R to exit (i.e. what some people
refer to as crashing), as Jeff (Horner) said, we would like to be able
to stop this. We will need the actual text/file passed to
xmlTreeParse(), version information of operating system, R and the XML
package and any locale information.  However, if by crashing you mean
generates an error, then that is expected on malformed XML inputs.

HTH,
 D.