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

Re: [FrameSGML] Import XML fails with odd errors



At 10:30 PM 7/16/03 +0100, Mark Barratt wrote:
>Given that Frame is pretty relaxed about most things in the fragment (no 
>application, no document type declaration), is there a good reason for 
>it insisting on a root element?


Mark,
  I don't KNOW the answer to this question, but I can GUESS. And my
guess is that the development team simply neglected to consider this
possibility.
  When you import an SGML fragment, FM creates an SGML document using
the current application. In effect, it imports a temporary file of
the form:

     <!DOCTYPE SGMLFragment SYSTEM "DTD specified in application"[
        <!ELEMENT SGMLFragment - - ANY>
        <!ENTITY fragment SYSTEM "file you want to import">
     ]>
     <SGMLFragment>
     &fragment;
     </SGMLFragment>

  My guess is that someone thought that the above was unnecessary in
XML because XML does not require a DTD. The software therefore treats
the fragment as a complete XML document and attempts to open it. If the
document fails to parse, it does not create a text inset. In particular,
it does not import a fragment unless the fragment has a root element.
It is often useful for the fragment to be a forest rather than a 
tree and, as you've noted, this approach fails with such fragments.
  A related discrepancy may appear when you import an XML document with
references to external entities that are fragments of the document. As I
mentioned in my last message, referenced entities can be forests. Open
the Text Inset Properties dialog box by double-clicking on a text inset or
by selecting one and using the Edit > Text Inset Properties command.
Note the Open Source button in the lower-left corner. Click on this button.
FM opens the referenced file in another window; the open fails if the
referenced file is a forest, succeeds if it is a tree. Again, my guess
is that FM attempts to open the referenced file as a complete XML document--
something that only works if the file defines a tree.
	--Lynne

  
Lynne A. Price
Text Structure Consulting, Inc.
Specializing in structured FrameMaker consulting and training
lprice@txstruct.com            http://www.txstruct.com
voice/fax: (510) 583-1505      cell phone: (510) 421-2284

The program for the 2003 FrameUsers Conference includes several
presentations and training on XML and structured documents. See
http://www.FrameUsers.com for more information.



** To unsubscribe, send a message to majordomo@omsys.com **
** with "unsubscribe framers" (no quotes) in the body.   **