Skip to content
This repository has been archived by the owner on Jul 23, 2018. It is now read-only.

it return null value #2

Open
Anythingforlife opened this issue Jul 21, 2017 · 3 comments
Open

it return null value #2

Anythingforlife opened this issue Jul 21, 2017 · 3 comments

Comments

@Anythingforlife
Copy link

currently i use mammoth package . in that math function not converted in html so i refer your omml2mathml package in that i passed {http://schemas.openxmlformats.org/officeDocument/2006/math}oMath this element to omml2mathml() function but it return null . where actual problem.

if (element.name == "{http://schemas.openxmlformats.org/officeDocument/2006/math}oMath")
        element = MathXml(element);

i call my own function when math element ignore by mammoth package

function matchXml(element)
{
var omml2mathml = require('omml2mathml');
var mathmlElement = omml2mathml(element);
}

@darobin
Copy link
Contributor

darobin commented Jul 21, 2017

Are you passing it a real DOM node? Last I looked, Mammoth used some weird representation of XML that wouldn't work well with other packages.

@Anythingforlife
Copy link
Author

plz can you send your example for DOM node. in mammoth they convert doc in XML element for each paragraph of docx file. so i passed that element in your library but it not work

@darobin
Copy link
Contributor

darobin commented Jul 24, 2017

This uses any DOM implementation that follows the DOM standard (and not even that much of it). For instance, it'll work with xmldom. I don't know what Mammoth uses internally, but if it's some weird non-standard representation of XML then you'll have to convert it to DOM first.

See mwilliamson/mammoth.js#83

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants