W3C home > Mailing lists > Public > www-math@w3.org > June 2002

Including SVG in MathML (conceptual issue)

From: Alexander J. Vincent <jscript@pacbell.net>
Date: Sun, 16 Jun 2002 14:25:24 -0700
To: www-math@w3.org
Message-id: <3D0D0244.5060104@pacbell.net>

Dear Sirs,

I've been wondering what the best procedure is, if there are any, for 
using SVG or a custom XML language within a MathML fragment to define or 
reference objects defined in the alternate language.

For instance, the SVG 2 Requirements document suggests "SVG may define 
points and allow shape elements and paths to reference them. This would 
facilitate connection points on elements. [SVG 2.0]".   (Section 
4.2.1.5)  I personally would love to reference a point in SVG and use it 
in a mathematical equation in MathML.

Even if SVG did not implement a feature like this, I may end up creating 
an XML language module (compatible with the Modularization of XHTML 
Recommendation) to define certain basic features to analytic geometry.

It's not entirely clear from the MathML specification what MathML markup 
I would use to create such a connection.

Suppose I had a line in SVG:  <line x1="0" y1="0" x2="1" y2="1" id="AB" />

The slope of this line is equal to 1.  (y2 - y1) / (x2 - x1).  In 
MathML, I could say,

<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE math PUBLIC 
"-//W3C//DTD MathML 2.0//EN"
      "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd">
<!-- Created by amaya 6.1, see http://www.w3.org/Amaya/ -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mfrac>
    <mrow>
      <mrow>
        <mo>(</mo>
        <msub>
          <mi>y</mi>
          <mn>2</mn>
        </msub>
      </mrow>
      <mi></mi>
      <mo>-</mo>
      <mi></mi>
      <msub>
        <mi>y</mi>
        <mn>1</mn>
      </msub>
      <mo>)</mo>
    </mrow>
    <mrow>
      <mrow>
        <mo>(</mo>
        <msub>
          <mi>x</mi>
          <mn>2</mn>
        </msub>
      </mrow>
      <mi></mi>
      <mo>-</mo>
      <mi></mi>
      <msub>
        <mi>x</mi>
        <mn>1</mn>
      </msub>
      <mo>)</mo>
    </mrow>
  </mfrac>
  <mi></mi>
  <mo>=</mo>
  <mi></mi>
  <mn>1</mn>
</math>

But I lose any reference I had to the SVG line element. I'm wondering 
how I would build (a) a semantic reference to that line element, and (b) 
a definition of a slope function referencing that element, both within 
the context of content MathML and possibly presentation MathML as well.

I have a couple ideas on defining the slope function, based on my 
reading of the Content MathML chapter, but I am totally lost on how to 
build a reference to an element outside the MathML language.  Ideally, 
I'd love to do something like this:

<apply>
  <eq />
  <apply>
    <slope /><!-- attributes as necessary -->
    <svg:use xlink:href="#AB" />
  </apply>
  <cn>1</cn>
</apply>

Any suggestions on how I might go about doing this?
Received on Sunday, 16 June 2002 17:25:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 20 February 2010 06:12:51 GMT