Scott, that's very clear, and makes alot of sense. I'll give it a whirl. It gives me a great excuse to get to know the DOM. Now I have two good approaches to the problem.

Thanks!

John


On Thursday, October 17, 2002, at 12:05 PM, Scott Cadillac wrote:

Hi John,

Use the HTML <TITLE> tag and the <META> tags for storing your Category and
Summary, and then read and assign the files as a <@DOM> variable - then use
XPointer to extract the information you want.

This is much more elegant and makes use of the HTML <META> tags they way
they are meant to be used. And then you don't have to worry about removing
the information.

Something like:

<@ASSIGN local$TempHTMFile VALUE="<@DOM VALUE='
<HTML>
<HEAD>
<TITLE>I'm a vegetarian</TITLE>
<META NAME="helpCategory" CONTENT="Cooking" />
<META NAME="helpSummary" CONTENT="I steam all my vegetables" />
</HEAD>
<BODY>
<P>Some content, blah, blah, blah...</P>
</BODY>
</HTML>
'>">

Note the <@DOM VALUE=''> can be substituted with an <@INCLUDE> that points
to your help file, but I'm showing HTML here to illustrate how this is
done.


Then to extract the information, assign the following to a variable.

<@ELEMENTVALUE OBJECT='local$TempHTMFile'
ELEMENT='root().child(1,HTML).child(1,TITLE)' TYPE='TEXT'> - return the
Title: I'm a vegetarian

<@ELEMENTATTRIBUTE OBJECT='local$TempHTMLFile'
ELEMENT='root().child(1,HTML).child(1,META,NAME,helpCategory)'
ATTRIBUTE='CONTENT' TYPE='TEXT'> - returns the Category: Cooking

<@ELEMENTATTRIBUTE OBJECT='local$TempHTMLFile'
ELEMENT='root().child(1,HTML).child(1,META,NAME,helpSummary)'
ATTRIBUTE='CONTENT' TYPE='TEXT'> - returns the Summary: I steam all my
vegetables

The only prerequisite is that all the HTML files need to be XML compliant -
a.k.a XHTML. Making any HTML page XHTML compliant is coding practice in my
opinion and is a good habit to get into.

But you probably could cheat by doing something like:

<BODY>
<!-- <![CDATA[ -->

<P>Some badly formed HTML.

<P>More badly formed HTML, blah, blah,

<!-- ]]> -->
</BODY>

Hope this helps. Cheers....

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Multiple recipients of list witango-talk" <witango-
[EMAIL PROTECTED]>
Sent: Thursday, October 17, 2002 12:26 PM
Subject: Witango-Talk: Advice needed on dynamic indexing taf


This is not urgent, and the taf does work, but I am
wondering if there is a more elegant way to accomplish
the task.

We are setting up a web folder with help files. What
we'd like to do is drop a new help file into the folder,
and then have it indexed along with the existing files.

Here is the sequence of steps.
1. Each help file has a title, category and summary that
are preceeded by a special character (I use the ^) and a
double ^ to end the summary. These are standard html
files, with explanations that follow the summary.
2. I have a taf that reads the directory and returns all
the files ending in .htm
3. a for loop that operates on each, placing the file in
a variable.
4. I use <@locate> to find the positions of the ^
character in the string, so I can extract just the
string that includes the title, category and summary,
and then <@calc to calculate the length.
5. I use atomize to turn the returned string into a 3
element array.
6. I use <@addarray> to populate the table of all the
help files, showing the viewer the title (as a hyperlink
to the actual file), category and summary of each of the
help files in the directory.

As I said, the taf works, but when the viewer sees the
actual help file, there are these unsightly ^ characters.

I tried using comment tags to hide them but there was no
way to easily get rid of the comment tag characters when
I built the array. I couldn't seem to find a way to use
atomize with a word instead of a character.

I hope this was clear enough. I learned alot about
arrays and string manipulation in the process. THe main
point of this app is to have people who write the help
files just drop them in the directory, without needing
to update a database.

John Newsom

________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
with unsubscribe witango-talk in the message body
________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
               with unsubscribe witango-talk in the message body

Reply via email to