New error for PreTeXt with MOM

10 views
Skip to first unread message

Mark Fitch

unread,
Mar 13, 2023, 7:25:35 PM3/13/23
to pretext...@googlegroups.com
At some point generating webwork was tied to generating MOM exercises.
When I run "pretext build -g webwork" it fails with a list of errors
about finding MOM problems. This is also true of using pretext/pretext.

cli error attached

pretext/pretext error

$ ~/pretext/pretext/pretext -c webwork -s
"(http://webwork.uaa.alaska.edu,anonymous,anonymous,unused,anonymous)"
-d /d/Documents/texts/tech_math/generated/webwork/ source/techmath.ptx
Traceback (most recent call last):
  File "C:\Users\drmaf\pretext\pretext\pretext", line 815, in <module>
    main()
  File "C:\Users\drmaf\pretext\pretext\pretext", line 649, in main
    ptx.webwork_to_xml(
  File "C:\Users\drmaf\pretext\pretext\pretext.py", line 1056, in
webwork_to_xml
    xsltproc(extraction_xslt, xml_source, ww_filename, None, stringparams)
  File "C:\Users\drmaf\pretext\pretext\pretext.py", line 3518, in xsltproc
    raise (e)
  File "C:\Users\drmaf\pretext\pretext\pretext.py", line 3514, in xsltproc
    raise (texc)
  File "C:\Users\drmaf\pretext\pretext\pretext.py", line 3492, in transform
    result_tree = xslt(src_tree, **stringparams)
  File "src/lxml/xslt.pxi", line 582, in lxml.etree.XSLT.__call__
  File "src/lxml/etree.pyx", line 331, in
lxml.etree._ExceptionContext._raise_if_stored
lxml.etree.XSLTApplyError: Cannot resolve URI
file:/D:/Documents/texts/tech_math/source/problems/mom-4495.xml

Dr. Mark A. Fitch
Professor of Mathematics
Chair, Associate of Arts

maf...@alaska.edu
907-786-1656
SSB 154
University of Alaska Anchorage
3211 Providence Drive, Anchorage, AK 99508
error.txt

Rob Beezer

unread,
Mar 13, 2023, 7:36:29 PM3/13/23
to pretext...@googlegroups.com
Dear Mark,

A shot in the dark.

From about line 240 of your errors.txt:

* Opening and ending tag mismatch: statement line 3 and p
* Opening and ending tag mismatch: p line 7 and statement
processing with C:\Users\drmaf\.ptx\xsl\extract-pg.xsl has failed

error: Cannot resolve URI
file:/D:/Documents/texts/tech_math/generated/problems/mom-434001.xml

Can you inspect "mom-434001.xml" and see if the generated PreTeXt has some
mismatch between lines 3 to 7 with opening/closing a "p" and a "statement".

Rob

Mark Fitch

unread,
Mar 13, 2023, 7:41:13 PM3/13/23
to pretext...@googlegroups.com
That was one of two problems. The error reported apparently are from
working with an outdated copy of my already generated MOM problems. The
webwork generation wasn't even starting because of the MOM issues.

That problem is now resolved.

Rob Beezer

unread,
Mar 13, 2023, 7:47:33 PM3/13/23
to pretext...@googlegroups.com
On 3/13/23 16:41, Mark Fitch wrote:
> That problem is now resolved.

Great - thanks. That *was* a spectacular error log! ;-)

For the record, even though you were generating WeBWorK, it was/is necessary to
read *all* of your source before the WW problems can be ripped out for
conversion. That's a fundamental difference between PreTeXt and LaTeX - you
need to always have the entirety of your source available to be processed.
There are no conditional includes, and "commenting out" code can get you in trouble.

Rob
Reply all
Reply to author
Forward
0 new messages