That was part of the answer. The other part was to change the child id's to 1, which I don't get, since aren't there 3 children under the head tag? 1 title and 2 meta's?

But this is the successful code with all tags and elements in upper case in the taf file and in the html documen:

<@ELEMENTVALUE OBJECT='local$helpxml'
ELEMENT='root().child(1).child(1)' TYPE='TEXT'><hr>

<@ELEMENTATTRIBUTE OBJECT='local$helpxml'
ELEMENT='root().child(1).child(1,META,NAME,helpCategory)'
ATTRIBUTE='CONTENT' TYPE='TEXT'>

<@ELEMENTATTRIBUTE OBJECT='local$helpxml'
ELEMENT='root().child(1).child(1,META,NAME,helpSummary)'
ATTRIBUTE='CONTENT' TYPE='TEXT'>

Thanks so much for the help, now I'm off to the races.

John

On Friday, October 18, 2002, at 04:24 PM, Scott Cadillac wrote:

Hi John,

The XPointer syntax is case-sensitive. Try, for example:

child(2,meta,name,helpCategory)

Cheers....


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Multiple recipients of list witango-talk" <witango-
[EMAIL PROTECTED]>
Sent: Friday, October 18, 2002 4:54 PM
Subject: Re: Witango-Talk: Advice needed on dynamic indexing taf


Scott, I'm running into one problem.  I have my Title
tag content displaying, but not my two metatags.

Here is the HTML file:
<html>
<head>
<title>Using Autotext in MS Word</title>
<META NAME="helpCategory" CONTENT="MS Word"/>
<META NAME="helpSummary" CONTENT="How to make
boilerplate text easy"/>
</head>
</html>

I read this with a file read action, assign to a
variable, (helpfile), and then instantiate a DOM as you
suggested:

<@ASSIGN NAME="helpxml" SCOPE="local" VALUE="<@DOM
VALUE='@@helpfile'>">

<@ELEMENTVALUE OBJECT='local$helpxml'
ELEMENT='root().child(1).child(1)' TYPE='TEXT'><hr>

<@ELEMENTATTRIBUTE OBJECT='local$helpxml'
ELEMENT='root().child(1).child(2,META,NAME,helpCategory)'
ATTRIBUTE='CONTENT' TYPE='TEXT'>

<@ELEMENTATTRIBUTE OBJECT='local$helpxml'
ELEMENT='root().child(1).child(3,META,NAME,helpSummary)'
ATTRIBUTE='CONTENT' TYPE='TEXT'>

I get the title fine, but not the other two.  Here is
the debug output:

Using Autotext in MS Word
---------------------------------------------------------
-----------------------

---------------------------------------------------------
-----------------------
[Application File] [0] START /testhelp/testomit.taf
Tango_2000_Personal_Server
[External Action] [0] External
[Query] [0]
[External Action] [0] Forking process
[ActionResults] [50]
[External Action] [50] Complete
[Changed Vars] [50] local$dirfiles=[Array]
local$helpfiles=[Array:1x3] local$numfiles=4
[File Action] [50] File
[Query] [50] <@ASSIGN NAME=helpfile VALUE="<html> <head>
<title>Using Autotext in MS Word</title> <meta
name="helpCategory" content="MS Word"/> <meta
name="helpSummary" content="How to make boilerplate text
easy"/> </head> </html>" SCOPE=local> (read from file:
c:\inetpub\wwwroot\testhelp\autoaxml.htm)
[Results Action] [50] Results2
[Changed Vars] [50] local$helpxml=[DOM]
[Return Action] [50] Return
[local$ Vars] [50] dirfiles=[Array:4x1] helpfile=<html>
<head> <title>Using Autotext in MS Word</title> <meta
name="helpCategory" content="MS Word"/> <meta
name="helpSummary" content="How to make boilerplate text
easy"/> </head> </html> helpfiles=[Array:1x3] helpxml=
[DOM] numfiles=4 resultSet=[Array:8x1]
variableTimeout=30

What am I missing?

Thanks,

John
Thank you John,

I'm glad you liked it. Here is some information on XPointer with
Witango if
you are interested:

http://xml-extra.net/webpage.xmlx?node=72

Cheers....

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


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

________________________________________________________________________
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

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

Reply via email to