OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: Translating XML -> HTML & RTF

[ Lists Home | Date Index | Thread Index ]
  • From: "John E. Simpson" <simpson@polaris.net>
  • To: xml-dev@ic.ac.uk
  • Date: Sat, 23 Jan 1999 11:00:45 -0500

At 03:12 PM 1/23/99 +0000, Tony McDonald wrote:
><studyguide title='Organisation of Tissues'>
><section title='Core Content' sg_title='Organisation of Tissues'> *1*
></section> *2*
>I'm using an Expat enabled parser to scan the resultant documents and 
>(try) to do the translations.
>...I would like the <section>..</section> tag to be replaced by a <h2 
>class="section">Core Content: Organisation of Tissues</h2> construct, 
>but using expat, I end up with the closing </h2> tag at the line 
>marked *2* above.

I think expat is doing exactly what you asked it to do: turning all of the
section element's content into <h2>. One way to fix it might be to turn the
title and sg_title attributes into full-blown child elements of the section
element, and enclose them in something like a titleinfo wrapper to which
you can apply your desired class attribute. Something like this:

    <titleinfo class="section">
      <title>Core Content</title>
      <sg_title>Organisation of Tissues</sg_title>

This seems to be a good illustration of one argument in favor of using
elements vs. attributes: when you want the content to be easily displayed.

Will be interested to see others' replies, if any.
John E. Simpson
Just XML - Now available from Prentice-Hall

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS