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

Saving cross-reference to XML causes invalid output

Advocate ,
Aug 24, 2022 Aug 24, 2022

I am hoping someone else has seen this problem and found the solution for it.

 

I am creating large documents using a custom schema. I now have to add a cross-reference to it. It all works fine while I am opening and editing files in FrameMaker. But when writing the valid file to XML, the writer does not generate a close tag for the <xref> element, which makes the XML invalid.

 

I am hoping there is a simple switch somewhere in FrameMaker's many settings, or an instruction I need to add to the read-write rules. Before trying to read through the many pages of the Structured Application guides, I thought it might be useful to post my question here. If any of you knows where the catch is, and how to get around this obvious flaw in FM, let me know asap.

 

Kind regards from Amsterdam

 

Jang

TOPICS
Error , Structured
278
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
Community Expert ,
Aug 24, 2022 Aug 24, 2022

So you're working with .fm files, not .xml files?

You'll almost certainly need a read/write rule to manage the conversion of your fm xref element and attributes to xml xref element and attributes, since an xref is a specific fm object that leverages baked-in functionality in fm. (as you know, tables, footnotes, variables, and other things need this as well)

Sounds like you need someone to put eyes on your work. Reached out to any former partners of yours yet? 😉

-Matt Sullivan
FrameMaker Course Creator, Author, Trainer, Consultant
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
Advocate ,
Aug 24, 2022 Aug 24, 2022

I am using .xml files. And I do have the read-write rules set up correctly. It seems FM has a serious bug and nobody is encountering it but me, as other XML standards like DITA use their own client code to repair what FM is doing wrong. It is either that or the documentation is incomplete (well, it is incomplete and even incorrect in many locations). I am surprised that nobody seems to have tried using cross-references in a custom XML schema. If anyone has done that, please share your knowledge here.

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
Advocate ,
Jan 24, 2023 Jan 24, 2023
LATEST

I finally found the cause of this issue. It turns out that FrameMaker bases its XML output behaviour on the definitions in the DTD that is associated with the XML document. I had the definition for xref showing PCDATA and this causes a start tag without an end tag. When I changed the DTD definition to EMPTY the tag was correctly closed.

 

You could state that this is what is written in the Structured Application Developer's Guide, but in my honest opinion this is very strange behaviour and does not seem to serve any realistic purpose. Why not simply give an error that the DTD has an invalid type definition for the cross-reference element, or even better - simply write the closing tag no matter what that definition is. Generating invalid XML without even so much as a warning is a serious bug if you ask me. But I am happy that I finally found out about this crazy behaviour so that my project is saved from going under. Not happy about the amount of time it took to figure this one out, though.

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