translating LaTeX to XML

Discussion in 'XML' started by Michael Friendly, Apr 2, 2004.

  1. I have a LaTeX document describing a long list of items that I want to
    translate to XML to treat these as a database. I've written a perl
    script to do the basic translation, and a basic DTD file,
    but I am stumped at translating
    LaTeX character encodings to something XML won't choke on.

    I found GNU recode to solve most of this, using

    cat milestone.tex | recode -d tex..xml | itemdb -s xml -o milestone.xml

    where itemdb is my perl script, and I've gotten rid of the diacritical
    characters, but I'm getting errors with &s in URLs:

    XML Parsing Error: not well-formed
    Location: file:///home/friendly/SCS/Gallery/milestone/Private/milestone.xml
    Line Number 2397, Column 101: <commentary
    url="http://historical.library.cornell.edu/cgi-bin/cul.math/docviewer?did=00620001&seq=3"
    text="Text of d'Ocagne'sbook on parallel coordinates" />
    ----------------------------------------------------------------------------------------------------^

    (This is from the mozilla browser, trying to load the milestone.xml file.)
    I'm pretty much a newbie with XML, so I don't know whether it is a
    problem with my DTD or what tools are available (debian linux)

    -Michael


    --
    Michael Friendly Email:
    Professor, Psychology Dept.
    York University Voice: 416 736-5115 x66249 Fax: 416 736-5814
    4700 Keele Street http://www.math.yorku.ca/SCS/friendly.html
    Toronto, ONT M3J 1P3 CANADA
     
    Michael Friendly, Apr 2, 2004
    #1
    1. Advertising

  2. In article <c4k9m9$716$>,
    Michael Friendly <> wrote:

    % url="http://historical.library.cornell.edu/cgi-bin/cul.math/docviewer?did=00620001&seq=3"

    You must encode & as &amp; and < as &gt; anywhere they appear as text in
    any XML document, so this should be

    url="http://historical.library.cornell.edu/cgi-bin/cul.math/docviewer?did=00620001&amp;seq=3"

    (Must might be a bit strong here, you could get away with & and <
    if you find that more aesthetically pleasing.)

    --

    Patrick TJ McPhee
    East York Canada
     
    Patrick TJ McPhee, Apr 4, 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. Shmuel (Seymour J.) Metz

    XML equivalent to LaTex res class

    Shmuel (Seymour J.) Metz, Jun 30, 2004, in forum: XML
    Replies:
    1
    Views:
    701
    Martin Honnen
    Jun 30, 2004
  2. Florencio Cano

    XML+Logs to Latex. XSLT?

    Florencio Cano, Jan 10, 2008, in forum: Python
    Replies:
    0
    Views:
    266
    Florencio Cano
    Jan 10, 2008
  3. Florencio Cano

    Re: XML+Logs to Latex. XSLT?

    Florencio Cano, Jan 10, 2008, in forum: Python
    Replies:
    0
    Views:
    371
    Florencio Cano
    Jan 10, 2008
  4. John Redmond

    Convert XML to Latex/PDF and XHTML

    John Redmond, Feb 24, 2009, in forum: XML
    Replies:
    0
    Views:
    2,144
    John Redmond
    Feb 24, 2009
  5. John Redmond

    Converting XML/HTML to LaTeX/PDF

    John Redmond, Feb 28, 2009, in forum: XML
    Replies:
    0
    Views:
    700
    John Redmond
    Feb 28, 2009
Loading...

Share This Page