Copy link to clipboard
Copied
Using FM 9.0.3 and a slightly specialized DITA application...
Is there a way to write an attribute to XML if there is only a default value specified for it in the EDD, but no value was entered by the user? I know the reason why FM does not write it to XML by default (e.g. because the DTD may specify a different default value for the same attribute), but anyway I want/need to achieve this for one specific attribute in my structured application.
Are there any R/W rule or EDD based tricks to achieve this, or is an export XSL transformation the way to go?
Thanks for any help,
Marcus
Copy link to clipboard
Copied
Hi Marcus,
It does seem that you will not be able to do this with r/w rules. In one part, the Structure Dev guide actually says:
"In FrameMaker, a default
attribute value can only be specified in the EDD, so this rule has no effect when importing
an XML or SGML instance, or when exporting a FrameMaker document. Also, the default
value is used only to initiate formatting. FrameMaker does not actually provide an attribute
value for the element. When you export the FrameMaker document, the software does not
generate an attribute value where there previously was none."
If our suspicions are true, that would leave you with XSLT or the FDK. I have a number of instances myself where this is required and I use the FDK for it, as I recall somewhere in the past bumping into the same wall.
Russ
Copy link to clipboard
Copied
Markus,
as Russ suggested a simple XSLT transform (»identity transform«) will populate the default value if declared in the DTD accordingly. If it doesn’t it would be easy to accomplish that.
From my point of view one main benefit of XSL post-processing is the unification of the individual XML segments when saving a book as XML into a single XML file. For others it is a problem that variable entities are resolved and do not round-trip. For the last issue Adobe issued a workaround with FM 9.0.3 in their »PreserveEntity« client including XSL and C source code.
- Michael