Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to Convert as XML from SGML using FrameMaker

New Here ,
Jun 23, 2008 Jun 23, 2008
I have SGML files created by FM Structured App. I wanted to convert all these SGML files to XML files and save into Oracle XMLDB database.Any idea,like using FDK or any other way.
Please let me know.
Thanks in advance!!!
Saket
TOPICS
Structured
2.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 23, 2008 Jun 23, 2008
Hi Saket,

Outside of Framemaker, you could try JAmes Clark's SX Tool ( http://www.jclark.com/sp). It does not do well SDATA and NDATA entities, however.

Ken Holman from CraneSoftwrights has made a python-based tool "n2x" (http://www.CraneSoftwrights.com/resources/n2x) that works together with Clark's sw to handle the missing parts.

It should be also possible to read the original SGML to frame with the sgml application, then have a corresponding XML application to save the structured files to XML. If you have not used some tricky SGML, it should work. I've done similar things with success using Arbortext/PTC editor.

Martti
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 24, 2008 Jun 24, 2008
Thanks for reply, but i wanted to use FrameMaker to convert the file from SGML to XML. Because these SGML files is generated by FrameMaker and FrameMaker has feature to export the file as XML. I want use FrameMaker FDK to accomplish this task.I wanted to know that my approach is correct or not.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jun 24, 2008 Jun 24, 2008
Saket,

Provided that you have (or are willing to build) an XML structured application built to export the XML, this seems like a good approach. With the FDK, you can open the files with your existing SGML application with the FS_StructuredOpenApplication property for F_ApiOpen(), then switch to the XML application when using F_ApiSave(). It should be reasonably straightforward, though admittedly I've never tried it.

Russ
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 24, 2008 Jun 24, 2008
Thanks Russ!!!
I will try and let you know, how it works.
Saket
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 25, 2008 Jun 25, 2008
Saket, Russ,

You may not need the FDK at all. You can put the SGML documents into one directory and then use File > Utilities > Convert Structured Documents (in FM 7) or File > Structure Tools > Utilities > Convert Structured Documents (in FM 8) to import them all into FM. Then use Convert Documents to Structured Format to export the FM versions to XML.

Do all the SGML documents use the same application? Is there an XML version of the DTD available? If you need to create an XML DTD, you can generate it from the EDD, but you may need to change some of the general rules. I often use exclusions in my EDDs as well as general rules with expressions that are not permitted in XML. For example, I may have the general rule:

title?, (#PCDATA | emphasizedphrase | xref)*

in the EDD but

(#PCDATA | title | emphasizedphrase | xref)*

in XML. Thus, the EDD restricts a title to the beginning of the defined element, where the DTD allows titles throughout the content. All content that is valid in FM will be valid in XML. The reverse is not true, but doesn't matter if the editing is being done in FM. I put both expressions in the EDD as general rules but use conditional text to distinguish them. I also make the exclusions conditional. Then I show or hide one set of conditions to import element definitions into FM documents and reverse the show/hide settings to create a DTD from the EDD.

--Lynne

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 17, 2008 Oct 17, 2008
Russ,
I am able to convert XML from SGML using F_ApiSave method.
SGML file has images. When i am converting, it is converting all the other tag properly except Graphics tag. Converted Graphic tag looks like this but it should be like this . I tried to fix the EDD also but nothing is working for me.
Can you please give me some direction.
Thanks
Saket
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Oct 19, 2008 Oct 19, 2008
LATEST
Saket,

I'm not clear on what the problem is... is it the missing attributes or the improper element tag (Graphic vs. graphic)? In either case, I'd think this is a simple read/write rules issue. Do you have read/write rules set up for the graphic element?

Russ
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines