Open alexjbest opened 4 years ago
Regex is available in XSLT 2.0, which we are not ready to move to.
I convert separators to spaces, use normalize-space()
to consolidate and trim, add back a single space at the start and end, then search on terms, etc with spaces on each end. Or instead of spaces, fence strings off with a weird symbol like |
.
Spaces work, assuming they are not allowed in identifiers.
I've got some big-picture proof-of-concept working for "assembling" source, but will want to test on existing WeBWorK first (maybe?) since it is harder and will provide better testing.
@rbeezer That sounds good, I'm still wondering about numbering. It seems to me the best way to achieve my goal is to have something that runs before any other processing and removes un-ref-ed biblio's from the xml file then, before any other processing starts, rather than ignoring them only at the time the bibliography is created. Do you know if something like this is possible in xslt, and if so are there any examples of similar procedures already in pretext, I'm happy to have a crack at modifying something existing to work, but the prospect of learning the right parts xslt to do this from scratch seems a little daunting (getting the above working took longer than I'd like).
Dear Alex,
Did you see the "Assembly" thread on pretext-dev? Lots of details there. And daunting for me. I'm doing something similar (but easier in some respects) with knowls today.
Let me know what questions that thread doesn't answer (even if they are the ones you just asked!).
Rob
See https://groups.google.com/forum/#!topic/pretext-dev/HDjVhO7t2qM
I made a bad and stupid version of this?:
note I also changed referencelist to thebibliography. And that this is not controlled by an option, but the real thing should be.
One deficiency of this implementation is when
xref
s refer to more than one biblio item using a comma separated list I have tried to usecontains
for this which looks to be working fine. However it does suffer the issue that if I havethen both references appear as
bib-beezer
occurs in both ids. Some proper regex (can you even do regex in xslt) should fix it.