Attributes with quotes within entities

Discussion in 'XML' started by Soren Kuula, Apr 8, 2004.

  1. Soren Kuula

    Soren Kuula Guest

    Hi,

    I'm writing some DocBook with lots of math formulae. For every
    mathematical expression in my document, I have to enclose it in :

    <math xmlns="http://www.w3.org/1998/Math/MathML">
    blah
    </math>

    so I thought of declaring entities in the DTD extension so I can just use

    &mathbegin;
    blah
    &mathend

    Problem is, how do I declare there ?

    <!ENTITY mathbegin <math xmlns="http://www.w3.org/1998/Math/MathML">>

    <!ENTITY mathbegin '<math xmlns="http://www.w3.org/1998/Math/MathML">'>

    <!ENTITY mathbegin "<math xmlns='http://www.w3.org/1998/Math/MathML'>">

    <!ENTITY mathbegin "<math xmlns="http://www.w3.org/1998/Math/MathML">">

    <!ENTITY mathbegin "<math
    xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;>">

    all don't work (with Xalan). The problem seems to be the quotes in the
    text I want to declare an entity for ...

    Surely there must be a solution ...

    Soren
     
    Soren Kuula, Apr 8, 2004
    #1
    1. Advertising

  2. In article <F1bdc.138541$>,
    Soren Kuula <> wrote:

    >&mathbegin;
    >blah
    >&mathend


    Sorry, you can't do that: elements must start and end in the same entity.

    But you can shorten it:

    ><math xmlns="http://www.w3.org/1998/Math/MathML">
    >blah
    ></math>


    Declare a fixed attribute for the <math> element:

    <!ATTLIST math xmlns CDATA #FIXED "http://www.w3.org/1998/Math/MathML">

    and then you can just use

    <math>
    blah
    </math>

    -- Richard
     
    Richard Tobin, Apr 8, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris White

    Quotes/Double Quotes in Image Control

    Chris White, Sep 22, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,859
    Hermit Dave
    Sep 22, 2004
  2. Chris
    Replies:
    1
    Views:
    13,661
    Oisin
    Mar 24, 2006
  3. Lawrence Tierney

    Multiline quotes - escaping quotes - et al

    Lawrence Tierney, Dec 24, 2003, in forum: Java
    Replies:
    3
    Views:
    4,504
    Andrew Thompson
    Dec 24, 2003
  4. Ken Fine
    Replies:
    2
    Views:
    177
    Ken Fine
    Feb 24, 2004
  5. Jim Higson
    Replies:
    3
    Views:
    227
    Eric Amick
    Jul 25, 2004
Loading...

Share This Page