mathml to latex conversion using mml2tex(XSLT) - xslt

I am trying to convert MathML to LaTex using XSLT with the templates available in https://github.com/transpect/mml2tex. This is working fine for MathML with the namespace. But the same not working without namespace.
without namespace
input: <math display="block"><mi>a</mi></math>
output: <?xml version="1.0" encoding="UTF-8"?><math display="block"><mi>a</mi></math>
with namespace
input: <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="block"><mml:mi>a</mml:mi></mml:math>
output: <?xml version="1.0" encoding="UTF-8"?><?mml2tex a?>
with namespace declaration
input:<math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="block"><mi>a</mi></math>
output:<?xml version="1.0" encoding="UTF-8"?><math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="block"><mi>a</mi></math>

Related

BaseX 9.1.2 : issues with entities on xslt:transform

I'm having some trouble to transform xml nodes containing entities using xslt:transform() with BaseX :
let $xsl := doc('xsl/commun.xsl')
return
xslt:transform(<node>ééé</node>, $xsl)
gives
[FODC0002] "" (Line 1): L'entité "eacute" était référencée, mais pas déclarée.
I have created my database with/without intparse and/or DTD options, with no changes (options basex).
xslt:processor() and xslt:version tell that I'm using java 1.0 as processor.
Here is the declaration of my xslt:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" encoding="UTF-8" omit-xml-declaration="no" exclude-result-prefixes="#all"/>xslt:transform
<xsl:template match="/"/>
I don't know what I am doing wrong... Should I declare any entity I want to use in the XSL file?
xslt:processor() and xslt:version tell that I'm using JAVA 1.0 as processor.
As explained here "XSLT 3.0 will be enabled if Version 9.x of the Saxon XSLT Processor (saxon9he.jar, saxon9pe.jar, saxon9ee.jar) is found in the classpath"
Just has to add saxon9he.jar in {Basex Folder}/lib/custom and that's fine
Hope that help

How to disable specific rule in FSharpLint?

I created Settings.FSharpLint and I want to suppress IdentifiersMustNotContainUnderscores rule
Is it possible to disable only one rule?
Example (Doesn't work):
<?xml version="1.0" encoding="utf-8"?>
<FSharpLintSettings>
<Analysers>
<NameConventions>
<IdentifiersMustNotContainUnderscores>
<Enabled>False</Enabled>
</IdentifiersMustNotContainUnderscores>
</NameConventions>
</Analysers>
</FSharpLintSettings>
I tried this and it worked well (But it's for all NameConventions rules):
<?xml version="1.0" encoding="utf-8"?>
<FSharpLintSettings>
<Analysers>
<NameConventions>
<Enabled>False</Enabled>
</NameConventions>
</Analysers>
</FSharpLintSettings>
The IdentifiersMustNotContainUnderscores element needs to be nested inside a Rules element, try:
<?xml version="1.0" encoding="utf-8"?>
<FSharpLintSettings>
<Analysers>
<NameConventions>
<Rules>
<IdentifiersMustNotContainUnderscores>
<Enabled>False</Enabled>
</IdentifiersMustNotContainUnderscores>
</Rules>
</NameConventions>
</Analysers>
</FSharpLintSettings>

remove namespaces of multiple tags

i've just learned some xslt langauge and i have a problem. I'm trying to remove this namespace without success.
Original xml:
<?xml version="1.0" encoding="UTF-8"?>
<file_information xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.chellodmc.com/files/dmc_media_delivery.xsd" xsi:schemaLocation="http://www.chellodmc.com/file0073/dmc_media_delivery.xsd http://www.chellodmc.com/files/dmc_media_delivery.xsd">
<asset_data soa:23946923649236489>
<upn>TEST_Sintec_HD</upn>
<title>NLD_NGC_C_Man United - Chelsea - Sunday #17.00</title>
<version>High Definition</version>
<duration>00:30</duration>
<tc_in>23:00:00:00</tc_in>
<tc_out>23:00:30:00</tc_out>
<aspect_ratio>16X9</aspect_ratio>
<segment>
<sequence>1</sequence>
<tc_in>23:00:00:00</tc_in>
<tc_out>23:00:30:00</tc_out>
<comment></comment>
</segment>
</asset_data>
</file_information>
Expected output xml:
<?xml version="1.0" encoding="UTF-8"?>
<file_information>
<asset_data>
<upn>TEST_Sintec_HD</upn>
<title>NLD_NGC_C_Man United - Chelsea - Sunday #17.00</title>
<version>High Definition</version>
<duration>00:30</duration>
<tc_in>23:00:00:00</tc_in>
<tc_out>23:00:30:00</tc_out>
<aspect_ratio>16X9</aspect_ratio>
<segment>
<sequence>1</sequence>
<tc_in>23:00:00:00</tc_in>
<tc_out>23:00:30:00</tc_out>
<comment></comment>
</segment>
</asset_data>
</file_information>
what would be your suggestion?
Many thanks!

Removing specific element from xml using sax with xerces library in c++

My problem is that I want to remove lastfiles and all it's child element using sax with the API of Xerces in c++ language??
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE config>
<config datecreated="20011210">
<user>
John Smith
</user>
<login>jsmith</login>
<password>topsecret</password>
<lastfiles>
<lastfile timestamp="20011210T1002">accounts.txt</lastfile>
<lastfile timestamp="20011190T1132">/home/jsmith/docs/letter.doc</lastfile>
</lastfiles>
</config>

XercesDOMParser and XIncludes

I am attempting to get xincludes working in an existing system that uses a XercesDOMParser in xercesc to parse incoming xml from a client. I am working with Apache Xercesc v3.0.1, and the incoming XML, read from an input stream, is:
<?xml version="1.0" encoding="UTF-8"?>
<VisionServer xmlns:xi="http://www.w3.org/2001/XInclude">
<CompositeObject>
<xi:include href="testguioutput.xml" />
while testguioutput.xml contains
<?xml version="1.0" encoding="UTF-8"?>
<GUIOutput>
<Input>Input</Input>
<Title>IDC2_1</Title>
</GUIOutput>
The existing code uses a wrapper around a XercesDOMParser to parse the XML as it comes in, and after using setDoNamespaces and setDoXInclude to true, it is attempting to parse the XInclude, but I get a persistent "Fatal: include failed and no fallback element found in document '{0}'" error, no matter where in the directory structure I put testguioutput.xml.
I am working under visualstudio 2008, my working directory is default, and running out of /project/debug, but the include fails whether the target file is in /project/ or /project/debug/.
I was able to expand the xinclude tags using the XInclude.exe sample application that is included with the Xerces application. To do this, I created two files using your files above:
test1.xml:
<?xml version="1.0" encoding="UTF-8"?>
<VisionServer xmlns:xi="http://www.w3.org/2001/XInclude">
<CompositeObject>
<xi:include href="test2.xml"/>
</CompositeObject>
</VisionServer>
test2.xml:
<?xml version="1.0" encoding="UTF-8"?>
<GUIOutput>
<Input>Input</Input>
<Title>IDC2_1</Title>
</GUIOutput>
At the command line I executed:
"XInclude.exe test1.xml test1_expanded.xml" without quotes.
The resulting test1_expanded.xml file:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<VisionServer xmlns="" xmlns:xi="http://www.w3.org/2001/XInclude">
<CompositeObject>
<GUIOutput xml:base="test2.xml">
<Input>Input</Input>
<Title>IDC2_1</Title>
</GUIOutput>
</CompositeObject>
</VisionServer>