[Date Prev][Date Next]
[Thread Prev][Thread Next]
[Date Index]
[Thread Index]
[New search]
To: "MITZ" <mitz@xxxxxxxxxxxx>, Free Framers <framers@xxxxxxxxx>
Subject: Re: Frame+SGML index
From: Dan Emory <danemory@xxxxxxxxxxxx>
Date: Tue, 15 Jun 1999 15:51:35 -0700 (MST)
Sender: owner-framers@xxxxxxxxx
At 06:40 PM 6/15/99 +0200, MITZ wrote: > >Hello everybody, > > >I’m working with Framemaker+SGML 5.5.6 on Windows95 and I must make an >index. >The structure in the SGML-document is: > ><a>text text ….<index>public <s>health</s></index> text …..<a/>. > >The text between <s> and </s> is the main word, so this example must appear >in the index as: health, public. > >I know I can make the SGML-tag index a fm marker type index (in the EDD) but >how can I solve this problem with the sub-tag <s> in the tag <index>? ===================================================================== MITZ: As you probably know, you cannot put SGML markup (e.g., <s> or </s>) tags into an index marker (i.e., index markers cannot have structure). The nearest I could come to a solution that gives you what I think you want is as follows: 1. I created an EDD/DTD and an SGML Import/Export application named Index Test. The DTD follows: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ <!--DTD for IndexTest. Typically invoked by <!DOCTYPE IndexTest SYSTEM "C:\FMSGML5\SGML\INDXTEST\DTD"> --> <!ELEMENT IndexTest - - (a+) > <!ELEMENT a - - ((#PCDATA | Index | s)*) > <!ELEMENT Index - - RCDATA > <!ATTLIST Index type CDATA #IMPLIED > <!ELEMENT s - - RCDATA > <!ATTLIST s type CDATA #IMPLIED > ++++++++++++++++++++++++++++++++++++++++++++++++++++++ Note that each Index and s element has a type attribute to indicate the marker type (this was included only for clarity, it could be removed from the DTD by suppressing it in the read/write rules). The EDD specifies that the Index element is an Index marker, and that the s element is a Subject marker, as you will see in the type attribute values of the SGML document instance in step 3 below. Note also that the content of the two marker types is RCDATA, since marker text in FM+SGML cannot contain SGML markup. 2. The read/write rules for the import/export application must identify the Index and s elements as marker elements, as shown below: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ element "Index" { is fm marker element "Index"; marker text is content; } element "s" { is fm marker element "s"; marker text is content; } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3. Next, I created a simple instance of the doctype in FM+SGML, and exported it to SGML. The resulting SGML document instance follows: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ <!DOCTYPE IndexTest SYSTEM "c:\fmsgml5\sgml\indxtest\dtd" [ <!-- Begin Document Specific Declarations --> <!-- End Document Specific Declarations --> ]> <IndexTest><a>This is paragraph text1<Index type = "Index">Health, Public</Index><s type = "Subject">Health<$nopage></s></a> <a>This is paragraph text2<Index type = "Index">Health, Private</Index></a></IndexTest> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Note that each index element contains the full text (e.g., Health, Public), and that the s element contains only the main word, "Health", followed by <$nopage>, which inhibits the generation of a page number for this element in the FM+SGML generated index. I deduce that each main word must only appear once (i.e., it does not have to appear with each index marker that uses the main word--only one of them). 4. Finally, I imported the above SGML document instance into FM+SGML and generated the index, selecting both the Index and Subject markers for inclusion. Here is what is produced in the generated index: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ H Health Health, Private 2 Health, Public 1 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Where the first entry under the letter H is the main word (with no page number) obtained from the subject marker, and the other two entries (with page numbers) are obtained from the two index markers. Admittedly, this solution would require modification of your SGML document instances to add the main word followed by a comma to the text of each Index element, and to put the Index element end tag (</Index>) before the s element's start tag (<s>). =========================================================================== ==================== | Nullius in Verba | ==================== Dan Emory, Dan Emory & Associates FrameMaker/FrameMaker+SGML Document Design & Database Publishing Voice/Fax: 949-722-8971 E-Mail: danemory@primenet.com 10044 Adams Ave. #208, Huntington Beach, CA 92646 ---Subscribe to the "Free Framers" list by sending a message to majordomo@omsys.com with "subscribe framers" (no quotes) in the body. ** To unsubscribe, send a message to majordomo@omsys.com ** ** with "unsubscribe framers" (no quotes) in the body. **