Re: [greenstone-users] importing snippets of HTML (fwd)

From Katherine Don
DateFri, 13 May 2005 10:44:10 +1200
Subject Re: [greenstone-users] importing snippets of HTML (fwd)
In-Reply-To (20050512194318-1B7CEF4B9-webmail220-herald-ox-ac-uk)
Hi Benjamin

Have you tried just using HTMLPlug with your snippets of HTML?
I just tried two files, contents like:

<table><tr><td>first name</td><td>last name</td></tr>
<tr><td>Kath</td><td>Don</td></tr>
</table>

and

<html><head> </head><body>
<table><tr><td>first name</td><td>last name</td></tr>
<tr><td>Kath</td><td>Don</td></tr>
</table>
</body>
</html>

and both imported fine.

You may need to play with the format statements - eg DocumentHeading
shows Title by default, which is extracted from the text in the file -
add your Title metadata as dc.Title (for example) and display that instead:
format DocumentHeading "[dc.Title]"

Hope this helps,
Katherine Don

Benjamin Weaver wrote:
> Hello Greenstone Staffers,
>
> I would like to import snippets of HTML when building collections. The
> snippets would not be complete HTML pages, but, say, no more than a simple
> HTML table, stored in a text file in the appropriate import subdirectory. The
> rest of the HTML display page, the Title, and so on, I want to build from
> metadata.xml and Greenstone macros.
>
> For example, the imported text file would containing nothing more than:
>
> <table> ... </table>.
>
> Currently we build using import data consisting of a metadata.xml file and a
> complete HTML document. This arrangment is not satisfactory since Title
> metadata is drawn from the HTML file, not from the metadata.xml file as I want
> it to be, and even display elements common to all items in a collection have
> to be rebuilt and maintained in each of the individual imported HTML
> documents. I would like to use imported HTML only for the purpose of
> formatting that part of the display which is unique to that document (tables
> including links to variable numbers of multiple images) which I can not format
> in a Greenstone macro. A simple solution is to pre-construct only the
> variable-length HTML table and import this snippet.
>
> I tried using TEXTPlug to import the raw text of the HTML table, but it did
> not seem to work. How do I import a snippet of HTML while drawing all
> metadata, including Title, from my xml file? Ought I use HTMLPlug with some
> option argument, or TEXTPlug for the snippet?
>
> Thank you for any ideas in advance,
>
> Benjamin Weaver
> Researcher, Imaging Papyri Project/The Herculaneum Society
> email: benjamin.weaver@classics.oxford.ac.uk
> phone: (0)1865 288260
>
>
>
> -----End of forwarded message from Benjamin Weaver
> <benjamin.weaver@classics.oxford.ac.uk> -----
>
>