[R] odfWeave & XML error in post-processing

Rob James rob at aetiologic.ca
Sat Oct 10 17:33:15 CEST 2009


Just to close out my earlier posting, I have identified and resolved the 
following odfWeave/XML error:

>> xmlParseStartTag: invalid element name
>>     

I  used odfWeave to call various logistic regression models which 
included the above mentioned variable. odfWeave failed to generate the 
destination file throwing multiple lines of the above error.

It happened that the dataset originated in STATA (probably irrelevant),  
and included a variable which had five levels. Two of those levels had 
values of
"(1)<3500" and "(5)=>5000".   

So, while these codes did not appear in the source document, these codes 
appear in the odfWeave destination file.   The results were displayed in 
the document using the following crude method:

results <-glm(......

and subsequently reported out using :

odfTable(

as.matrix(results[,c(X1, X2, X3)],)

horizontal = TRUE)

odfTableCaption("Selected Logistic Regression Results for RXN3 outcome")


@

I received xmlParseStartTag errors for each such table.  Editting of the 
XML file in gedit highlighted the above values as problematic.

I then removed the two problematic value for this variable, and re-ran 
odfWeave, which generated the output I needed.

So, it appears that these values of this variable operated as invalid 
xmlParseStartTags, and that the process of wrapping up content_1.xml 
back into an ODF file failed because of the mis-recognition of these 
ParseStartTags found embedded in the data.   I think this is likely to 
be regarded more as a feature than as a bug, but it is none-the-less a 
cautionary tale.




More information about the R-help mailing list