ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: XML and math
Date: Thu, 10 Jan 2019 20:28:43 -0500 (EST)	[thread overview]
Message-ID: <nycvar.YAK.7.76.44.1901102026150.359@nqv-guvaxcnq> (raw)
In-Reply-To: <nycvar.YAK.7.76.44.1901101811580.359@nqv-guvaxcnq>

[-- Attachment #1: Type: text/plain, Size: 1489 bytes --]

On Thu, 10 Jan 2019, Aditya Mahajan wrote:

> On Thu, 10 Jan 2019, Hans Hagen wrote:
>
>> On 1/10/2019 10:26 PM, Aditya Mahajan wrote:
>>> Hi,
>>> 
>>> I have an XML file (which is generated via a program that I have no 
>>> control over), which contains elements as follows:
>>>
>>>           <p>
>>>              <equation text="$$y_1(t) = 1, t \geq 0$$">
>>>                 <img alt="$$y_1(t) = 1, t \geq 0$$" class="equation" 
>>> height="15px" src="Lab01_eq10401623798909303081.png" width="95px"/>
>>>              </equation>
>>>           </p>
>>> 
>>> I want to typeset the `text` attribute of equation (and ignore the <img> 
>>> tag). So, I tried:
>>> 
>>> \startxmlsetups matlab
>>>    % Bunch of missing definitions
>>>    \xmlsetsetup{#1}{equation}{matlab:*}
>>> \stopxmlsetups
>>> 
>>> \startxmlsetups matlab:equation
>>>    \xmlatt{#1}{text}
>>> \stopxmlsetups
>>> 
>>> This literally typesets `$$y_1(t) = 1, t \geq 0$$`. How can I flush the 
>>> attribute using ctxcatcodes? (There is \xmlflushcontent, but that is for 
>>> content and not attributes).
>> Time for an "aha, I knew it" moment ...
>
> This contains `&#xA;` which I want to convert to either newline or blank.

Some debugging showed that the entity was being translated correctly. I 
was typesetting the output under texcatcodes, which was causing the 
problem. Setting formfeedasciicode and endoflineasciicode to ignorecatcode 
made everything work correctly.

Aditya

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      reply	other threads:[~2019-01-11  1:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10 21:26 Aditya Mahajan
2019-01-10 22:00 ` Henri Menke
2019-01-10 22:09   ` Aditya Mahajan
2019-01-10 22:08 ` Hans Hagen
2019-01-10 23:21   ` Aditya Mahajan
2019-01-11  1:28     ` Aditya Mahajan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.YAK.7.76.44.1901102026150.359@nqv-guvaxcnq \
    --to=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).