Converting HTML Anchors to FrameMaker XREFs
Hi All,
I've been asked to debug a FrameScript. I'm having trouble finding anything on Google ... I hope this is the correct forum to ask this question.
What is the proper way to convert an HTML Anchor to an XREF in FrameScript
As an example:
In the html document that is being converted, there is this line
<a href="./sysPicTimer.html#sysPicTimerDisable" class="routine">sysPicTimerDisable( )</a>
In the resulting document, we want sysPicTimerDisable() to be the text and the XREF will direct you to ./sysPicTimer.html#sysPicTimerDisable
i.e. sysPicTimerDisable()
This is what we have - which apparently has been working for many years ....
Loop While(gvPgfVar)
Write console gvPgfVar.Text;
Set gvNextPgf = gvPgfVar.NextPgfInDoc;
Find '<a href="./' InObject(gvPgfVar) ScrollTo ReturnStatus(gvStat) ReturnRange(gvRange);
If gvStat=true
Delete Text(gvRange);
Set gvNewRange = gvRange;
Find '" class="routine">' InObject(gvPgfVar) ScrollTo ReturnStatus(gvStat) ReturnRange(gvRange);
If gvStat=true
Set gvNewRange.end = gvRange.end; //gvNewRange contains HTML Xref
set temp=Text(gvNewRange);
Delete Text(gvNewRange); //delete HTML Xref
Find '</a>' InObject(gvPgfVar) ScrollTo ReturnStatus(gvStat) ReturnRange(gvRange);
If gvStat=true
Set gvNewRange.end = gvRange.begin; //gvNewRange contains Xref text
Set gvXrefText= gvNewRange.Text;
Set gvNewRange.end = gvRange.end;
Delete Text(gvNewRange); //delete HTML Xref
New XRef Format('Heading Only') TextLoc(gvNewRange.begin) NewVar(gvXRef);
Set gvXRef.XRefSrcText = gvXrefText; \\ ERROR OCCURS hear . Read Only Variable
Endif
Endif
EndIf
Find '<a href="./' InObject(gvPgfVar) ScrollTo ReturnStatus(gvStat) ReturnRange(gvRange);
If gvStat=false
Set gvPgfVar = gvNextPgf; //Go to next paragraph. Otherwise, continue in this paragraph.
Endif
EndLoop
// Update the cross-references.
Update DocObject(ActiveDoc) XRefs Everything;
I've been told that this has been working for years ... but has since stopped working with an error at this line
Set gvXRef.XRefSrcText = gvXrefText;
Indicating that gvXRef.XRefSrcText is read-only
Is there a better way to approach this?
