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

XML export of marker-based xrefs?

Community Expert ,
May 23, 2013 May 23, 2013

Copy link to clipboard

Copied

Colleagues,

I'm pulling my hair out a bit over issues with external cross-references in an unstructured>structured conversion. (FrameMaker 11, custom DTD).

First, I've not found a way to automatically convert _external_ cross-references from marker-based to element-based. This is a historical issue, but I thought I would raise it in case any new solutions or approaches have appeared.

If FrameMaker won't convert marker-based external cross-references, I would prefer to do this clean-up in XML. But...FrameMaker unwraps these (marker-based, unresolved) cross-reference elements on save to XML. (FM retains the _text_ of the cross-reference, but removes the cross-reference element).

Is there any way to prevent this unwrapping? The presence of an empty cross-reference element is more important to me than the cross-reference text.

-Alan

TOPICS
Structured

Views

1.1K
Translate

Report

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 ,
May 23, 2013 May 23, 2013

Copy link to clipboard

Copied

HI Alan...

First .. when you say _external_ cross-ref, are you referring to a cross-ref to another FM file, or a cross-ref to a "website" (or other target external to the "book")? I assume you mean to another FM document, but wanted to make sure.

Are you saying that when you save to XML, the "xref" element is lost? I've encountered the problem where the content of the xref "squirts out" of the xref and ends up outside of the element.

Before ..

     <xref ...>Link Text</xref>

After ..

     <xref ... />Link Text

This happens because an "xref" is defined as "EMPTY" (at least in my models) so the content is forced out on save to XML. To solve this problem I update the cross-ref format definitions to contain no text. This seems to do the job.

But, as far as getting the cross-refs to actually link to the right place, the only way I've been able to do it is to run scripting on the file in FM (before export to XML and when the cross-refs are stil valid), to assign the target file and destination ID (whatever that means in your model) to an attribute on the "xref" element. After export to XML, I run another script on the files to map the target file information to the proper syntax and attribute.

I will soon have a plugin available to help with this and many other conversion issues for FM to DITA conversions. Sounds like this won't help you if you're using another model. (Why would you not be using DITA? No, you don't need to answer that question. 🙂

Cheers,

...scott

Votes

Translate

Report

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 ,
May 23, 2013 May 23, 2013

Copy link to clipboard

Copied

Hi Scott,

Thanks for your reply! Yes, I am working with cross-references to other FrameMaker files (which, post-conversion, will be to other XML files).

Using my (pretty basic) structured application, FrameMaker drops the xref entirely for "unresolved" external cross-references. I would be thrilled to have -

blah blah blah <xref>Link Text</xref> blah blah blah

or even

blah blah blah <xref/>Link Text blah blah blah

(I could reconnect most of these with a bit of text processing).

Instead, I get -

blah blah blah Link Text blah blah blah

I tried making the <xref/> content model non-empty in my DTD; with no change in result.

Will let you know if I uncover anything!

-Alan

Votes

Translate

Report

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 ,
May 23, 2013 May 23, 2013

Copy link to clipboard

Copied

Ah .. it's dropping the unresolved cross-refs? I know this is an obvious question, but can you resolve them first?

Cheers,

...scott

Votes

Translate

Report

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 ,
May 23, 2013 May 23, 2013

Copy link to clipboard

Copied

Hi Scott,

I could resolve them first. But my XSLT/Perl/sed/awk skills are currently stronger than my FrameScript/Extendscript skills, so I was hoping to re-resolve the xrefs post-conversion instead of pre-conversion.

Too much personal information?  🙂

Thanks!

-Alan

Votes

Translate

Report

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 ,
May 23, 2013 May 23, 2013

Copy link to clipboard

Copied

Naw .. I think without FM scripting of some type, your unresolved xrefs will be toast.  😞

...scott

Votes

Translate

Report

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 ,
May 23, 2013 May 23, 2013

Copy link to clipboard

Copied

LATEST

Hi Alan,

maybe you could try a workaround.

Why don't you define some automatic text for each and every one of your refs, that gives you a marker in the generated file?

Maybe something like: _xref_view page xyz in _xref_chapter zyx

You said your out of FM scripting skills were good - well, this would be a method  to start post-processing (should be easy with simple string parsing).

Cheers

Alex

Votes

Translate

Report

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