Avoid automatic generation value for required attributes
Posted: Wed Mar 03, 2021 8:07 pm
Hello,
I am using Author web 22.1.0.0 but I encounter the same behaviour in Oxygen Editor 20.1.
I open an XML file which is associated with a DTD file.
In this DTD file some elements have attributes that are required.
Let's imagine that the DTD says that under my "root" element there is a "chapter" element and in this chapter element a "para" element.
The "chapter" element has an attribute "code" required.
My document is opened in "Author" mode, and it contains only the "root" element.
If if add a "chapter" in my "root" element, it comes with an empty "code" attribute.
I remove the "chapter" element and instead of adding "chapter" element, I ask to add directly "para" element in my "root" element.
In that case, "chapter" element is automatically generated and as child, "para" element has been created.
The difference is the code attribute of "chapter" element which is not empty but with a generated value.
How can we avoid this automatic generation of attribute value ?
I have implemented an automatic generation of attributes values by using DocumentFilter in my framework but the behavior I described takes over.
Thanks for your help,
Johann
I am using Author web 22.1.0.0 but I encounter the same behaviour in Oxygen Editor 20.1.
I open an XML file which is associated with a DTD file.
In this DTD file some elements have attributes that are required.
Let's imagine that the DTD says that under my "root" element there is a "chapter" element and in this chapter element a "para" element.
The "chapter" element has an attribute "code" required.
My document is opened in "Author" mode, and it contains only the "root" element.
If if add a "chapter" in my "root" element, it comes with an empty "code" attribute.
Code: Select all
<root>
<chapter code=""></chapter>
</root>
In that case, "chapter" element is automatically generated and as child, "para" element has been created.
The difference is the code attribute of "chapter" element which is not empty but with a generated value.
Code: Select all
<root>
<chapter code="code_brj_rsl_v4b"><para/></chapter>
</root>
I have implemented an automatic generation of attributes values by using DocumentFilter in my framework but the behavior I described takes over.
Thanks for your help,
Johann