On Fri, 21 Nov 2014 10:47:53 +0100
Felipe Monteiro de Carvalho <[email protected]> wrote:

> Hello,
> 
> Consider this XML:
> 
> <!DOCTYPE math PUBLIC "-//W3C//DTD MathML 3.0//EN"
> "http://www.w3.org/TR/MathML3/dtd/mathml3.dtd";>
> <math xmlns="http://www.w3.org/1998/Math/MathML";>
>         <mi>&pi;</mi>
>         <mo>&InvisibleTimes;</mo>
>         <msup>
>           <mi>r</mi>
>           <mn>2</mn>
>         </msup>
>  </math>
> 
> I cannot get the value "&pi;" because TXMLReader.ParseRef as far as I
> can tell will substitute it with an empty string =(
> 
> How can I get "&pi;" or at least the Unicode char for Pi? Maybe I
> should add a field to allow me to define my own ParseRef routine? This
> way I could in my own code fix this. I guess I could change ParseRef
> to substitute &pi; with pi, but this could lead to an endless amount
> of combinations which could be valid.... and all of them need to be
> added to ParseRef.

The &pi; corresponds to a TDOMEntityReference and NodeName contains the
"pi".

  for Node in doc.GetEnumeratorAllChildren do begin
    DbgOut(Space(Node.GetLevel*2+2));
    DbgOut(DbgSName(Node));
    if Node is TDOMText then
      DbgOut(':"',TDOMText(Node).TextContent,'"')
    else 
      DbgOut(':',Node.NodeName);
    debugln;
  end;


Mattias

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to