Preserving cross-references to/from XML
Hello all,
I am roundtripping from stuctured Frame to XML and cannot figure out how to make FM restore my cross-reference targets.
My edd shows the <xref> element as this:
Element (CrossReference): xref
Attribute List
1. Name: XrefTarget IDReference Optional
The DTD was generated by Frame from the EDD, and shows the following definition for <xref>:
<!ELEMENT xref EMPTY >
<!ATTLIST xref XrefTarget IDREF #IMPLIED
format CDATA #IMPLIED
srcfile CDATA #IMPLIED >
The read/write rules should not be required, but after it did not work without a specific rule, I included this one:
element "xref" {
is fm cross-reference element;
attribute "XrefTarget" is fm property cross-reference id;
attribute "format" is fm property cross-reference format;
}
The XML output (with or without the read/write rules, that does not seem to make a difference) show this:
<xref format = "NumberRef"
srcfile = "../RepGeneral.fm#t-replace-reagent-rotor"/>
The @srcfile is generated by Frame. What is worrying is that @XrefTarget is not set here. And indeed, when I read the XML back into Frame, <xref> shows up with the correct format but no content in its @XrefTarget. I tried everything and I am getting just a little annoyed with Frame's supposedly intelligent default behavior. I do NOT want to get into API programming, I just want Frame to do what it claims to do by default. If I need to make changes to the EDD or read/write rules, I will, but I am not finding useful information on what exactly is expected here.
Anyone ?
Thanks a lot in advance
Jang
