Problem with odfWeave: Unescaped '<' not allowed in attributes values

View: New views
2 Messages — Rating Filter:   Alert me  

Problem with odfWeave: Unescaped '<' not allowed in attributes values

by Aleksey Naumov-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear R users,

I am having a problem with odfWeave: when I run

odfWeave('notes.odt', 'notes_out.odt')

I get a bunch of errors that start with "Unescaped '<' not allowed in
attributes values" in post-processing:

  <snip>
...
  'content_1.xml' has been Sweaved

  Removing content.xml

  Post-processing the contents
Unescaped '<' not allowed in attributes values
attributes construct error
error parsing attribute name
attributes construct error
xmlParseStartTag: problem parsing attributes
Couldn't find end of Start Tag text:list-level-style-bullet line 2
error parsing attribute name
attributes construct error
xmlParseStartTag: problem parsing attributes
Couldn't find end of Start Tag U line 2
Opening and ending tag mismatch: text:list-style line 2 and
text:list-level-style-bullet
Unescaped '<' not allowed in attributes values
...
</snip>

I cannot determine the cause of this. The error seems to come and go
erratically, as I experiment with deleting chunks of R code one by one and
pasting them back, i.e. no single chunk seems to be responsible.

I am using the current version of odfWeave (0.7.5). The thing is, the file
processed just fine in a previous version (0.7.3). Does anyone have any
suggestion how to deal with this? I am now kind of locked since I cannot
reproduce a report I was working on...

I also tried to downgrade to the previous working odfWeave version, however
I could not the windows binary for anything other than the latest version
0.7.5. I attempted to install from source by installing Rtools
(Rtools28.exe), however when I try to install odfWeave 0.7.3 (re-zipped from
tar.gz) I get:

> install.packages(pkgs=c('C:/Archive/R/packages/odfWeave.zip',
'C:/Archive/R/packages/XML.zip'), repos=NULL)
updating HTML package descriptions
> library(odfWeave)
Error in library(odfWeave) :
  'odfWeave' is not a valid package -- installed < 2.0.0?

What am I doing wrong? Is it possible to downgrade in this way? Any other
suggestions how to overcome this problem would be very much appreciated.

Thank you,

Aleksey

        [[alternative HTML version deleted]]

______________________________________________
R-help@... mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: Problem with odfWeave: Unescaped '<' not allowed in attributes values

by Max Kuhn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Aleksey,

>  I am using the current version of odfWeave (0.7.5). The thing is, the file
>  processed just fine in a previous version (0.7.3). Does anyone have any
>  suggestion how to deal with this? I am now kind of locked since I cannot
>  reproduce a report I was working on...
>

What version of the XML package are you using? What version of R etc?

There have been some changes to the XML package lately where encodings
are handled differently. This affects you since OO (and other word
processors) sometimes substitute "smart quotes" for regular quotes.
For example:

 "topepo"

instead of

 "topepo"

(some dashes also get converted to long dashes)

These characters will cause the R parser to choke. I had previously
coded around this, but interactions between odfWeave and XML are
subverting those error traps (but I it still works on Linux and OS X,
depending on your default encoding).

I'm working on a fix that will accomplish the same thing so you won't
have to deal with these characters (as before)

Try searching through your to code chunks and Sexpr in your document
for these characters and convert them to their usual analogs. Most
applications with "smart quotes" allow you to turn them off.

Also, it is generally better to contact the package maintainer in
situations like these.

If you still have issues after changing the characters, please let me know.

Max

______________________________________________
R-help@... mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.