Support for mathmlref element
See original GitHub issueRight now I’m working on support for <mathmlref>
. This is a subset of #1774, but I don’t expect to implement all of it in DITA-OT at this point so I’ve opened an issue specific to that element. (Once complete, whatever is done to make it work should be easily redone to make <svgref>
work, a small subset of #1123)
The DITA specification says:
Processors SHOULD process the MathML as though the
<m:math>
element had occurred directly in the content of the containing<mathml>
element.
I’ve got this part of the way done but have encountered a few issues:
<mathmlref>
appears inside of a specialization of<foreign>
, so the preprocess ignores it - the reference never registers. At this point I’ve setMATHML_D_MATHMLREF
to the class value, as with other known class values, and added exceptions inDebugFilter.java
so that it’s processed. This feels like a hack. I wouldn’t think this is appropriate for my own specializations. But this is an OASIS one, with an OASIS defined processing behavior, so it seems like we really should extend things to support it. For example:if (foreignLevel <= 1 || MATHML_D_MATHMLREF.matches(atts.getValue(ATTRIBUTE_NAME_CLASS))){
- This feels very much like the
<coderef>
element. So I’ve used that debug filter to get the math targets added into.job.xml
, because I expected a later step to pull in the math, much like with code references. But, I’m not sure this is the correct approach. - Again like coderef, I tried to add a SAX filter, in the same
topic-fragment
step – but it doesn’t use the XML catalog, so couldn’t parse the Math files (they have a DTD reference). I later heard from @jelovirt that the step which processes image metadata might be a good (catalog-aware) spot to add the filter, but I haven’t tried this yet. - I’m more comfortable in XSL anyway so I tried to do that instead - but the
.job.xml
file isn’t set up to retrieve only topics that use math, and throwing every DITA topic into a new XSL step is wasteful. Plus, so far, the files are processed in the source directory like code targets, and don’t exist in the temp directory.
At this point I decided to seek advice. What would the ideal approach be here?
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (20 by maintainers)
Top Results From Across the Web
mathmlref - Oxygen XML Editor
Use the mathmlref element to reference a non-DITA XML document that contains MathML markup. This element enables you to use the markup by...
Read more >mathmlref
Use the mathmlref element to reference a non-DITA XML document that contains MathML markup. This element enables you to use the markup by...
Read more >Stage 3 proposal: Feature 13111 MathML and Equations
<mathmlref>. Specializes topic/xref. Allows for use-by-reference of <m:math> elements from non-DITA XML documents. Includes the MathML 3 declarations.
Read more >MathML element reference - MDN Web Docs
MathML element reference. This is an alphabetical list of MathML elements. All of them implement the MathMLElement class.
Read more >MathML and equation domains - WebWorks
These two domains provide support for mathematics elements: ... or it can use the mathmlref element to include MathML markup that is stored...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I also think there are synergies between implementing this correctly and implementing support for SVG (#1123).
I see, I misread the original comment (I’ll blame cedar pollen and continuing illness). I was afraid some really significant bug had eluded all of us up to now.