[Date Prev][Date Next] [Thread Prev][Thread Next]
[Date Index] [Thread Index] [New search]

Re: Getting rid of Doctype declaration header?



Lynne:
Here are some points you failed to mention in your description of the method
you suggest:

1. You didn't mention that the method you describe for importing SGML
fragments only works with FM+SGML 5.5.x, not 5.1.x.

2. It should have been pointed out that the SGML fragment cannot contain
entity references unless they are all declared in the DTD.

3. As you mention, on import of the SGML fragment as a text inset into the
larger FM+SGML document, it retains the SGMLFragment element, which, in this
case, is not a highest-level element. Now, if you export the larger
document, including the imported text inset, is the SGMLFragment element
also exported? If it is, then it creates invalid SGML, because SGMLFragment
is not declared in the DTD. Consequently, the SGMLFragment element must be
unwrapped on export by specifying in the read/write rules file the following
rule:

        fm element "SGMLFragment" unwrap;

4. Even if element SGMLFragment is not exported to SGML, there still may be
a validity problem, because the unwrapped components or the text inset may
not be valid at that point in the document (note that the sturcture rule for
SGMLFragment is <ANY>).

5. The exported SGML document instance produced as described in 3 above will
not contain an entity reference to the text inset/fragment. Instead, the
entire content of the the original SGML fragment file will be contained in
the SGML document instance. Consequently, if you open the SGML document
instance in FM+SGML (or any other SGML-aware browser or editor), it will
contain the content of the SGML fragment that existed at the moment it was
originally imported as a text inset into FM+SGML. Thus, if the SGML fragment
file was updated in the meantime, the updated version will not appear in the
document.

For all of the reasons cited above, the solution you suggest is not very
viable, unless I'm missing something. I have proposed, in an FM+SGML
enhancement request, an approach that would replace the method you describe
with one that eliminates most of those shortcomings. 
===========================================================================
At 07:39 AM 8/2/99 -0700, Lynne A. Price wrote:
>---------------Snip
>Dear Nasser,
>  If I understand your question, there is indeed a way to do what you are
asking.
>When exporting a document to SGML, FrameMaker+SGML normally writes a complete
>SGML document, which begins with a document type declaration (<!DOCTYPE ...).
>The exception is if the highest-level element in the FrameMaker+SGML document
>is SGMLFragment. In this case, FrameMaker+SGML unwraps the SGMLFragment element
>and exports only its contents for use as an SGML text entity. For example, if
>you have a FrameMaker+SGML document with the structure:
>
>   (P) ...... This is the third paragraph
>
>FrameMaker+SGML as you've noted will save it to SGML as something like:
>
>   <!DOCTYPE p SYSTEM "filename"[
>   
>   <!--Begin document specific declarations-->
>
>   <!--End document specific declarations-->
>   ]>
>   <p>This is the third paragraph</p>
>
>However, if the original document is instead:
>
>   (SGMLFragment)
>      |-----(P)................This is the third paragraph
>
>the exported SGML will be merely:
>
>   <p>This is the third paragraph</p>
>
>You can then import this fragment into your larger document as
>needed. When you create the text inset, the Unknown File Type
>dialog appears. Select SGML as the file type.
>
>To use this technique, you'll need to add SGMLFragment with
>general rule <ANY> to your EDD as a valid-highest-level element.
>SGMLFragment should not be added to your DTD--the element
>will never appear in SGML.
>
>By the way, you can import document instances and partial document
>instances. Suppose you open a file that consists of
>
>   <p>This is the first paragraph</p>
>   <p>This is the second paragraph</p>
>   <p>This is the third paragraph</p>
>
>Again the Unknown File Type dialog appears. If you select SGML
>as the file type, FrameMaker+SGML asks what application to use.
>You must specify an application that includes a DTD. If you do,
>the result will be a FrameMaker+SGML document with the structure:
>
>   (SGMLFragment)
>      |-----(P)................This is the first paragraph
>      |-----(P)................This is the second paragraph
>      |-----(P)................This is the third paragraph
>
>For import, you don't need to provide an SGMLFragment element in your
>EDD; FrameMaker+SGML creates it automatically. You only need to
>define it on export so you can insert it yourself.
     ====================
     | 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.   **