Re: FW: Question regarding the attribute editor
Hussein Shafie <[email protected]> Thu, 3 Nov 2022 15:11:31 +0100
| Newsgroups | gmane.editors.xxe.general |
|---|---|
| Message-ID | <[email protected]> |
Hello,
What you did is correct:
---
<attributeEditor attribute="Entity_x" elementMatches="*">
<list allowAnyValue="false" allowMultipleValues="false">
<item>Yes</item>
</list>
</attributeEditor>
---
except that DocBook v5.1 has no "Entity_x" attribute. That's why your
attributeEditor is never used.
--> What to do:
1) Remove your attributeEditor from docbook51.xxe as this
attributeEditor is really not needed for such a simple case.
2) Modify docbook51/rng/V5.1/docbook.rng by defining attribute
"Entity_x" and adding it to the group of common base attributes
"db.common.base.attributes":
Original schema:
---
<define name="db.common.base.attributes">
<interleave>
<optional>
<ref name="db.version.attribute"/>
</optional>
<optional>
<ref name="db.xml.lang.attribute"/>
</optional>
<optional>
<ref name="db.xml.base.attribute"/>
</optional>
<optional>
<ref name="db.remap.attribute"/>
</optional>
<optional>
<ref name="db.xreflabel.attribute"/>
</optional>
<optional>
<ref name="db.revisionflag.attribute"/>
</optional>
<optional>
<ref name="db.dir.attribute"/>
</optional>
<ref name="db.effectivity.attributes"/>
<ref name="db.rdfalite.attributes"/>
<ref name="db.transclusion.attributes"/>
</interleave>
</define>
---
Modified schema:
---
<define name="db.common.base.attributes">
<interleave>
<optional>
<ref name="db.version.attribute"/>
</optional>
<optional>
<ref name="db.xml.lang.attribute"/>
</optional>
<optional>
<ref name="db.xml.base.attribute"/>
</optional>
<optional>
<ref name="db.remap.attribute"/>
</optional>
<optional>
<ref name="db.xreflabel.attribute"/>
</optional>
<optional>
<ref name="db.revisionflag.attribute"/>
</optional>
<optional>
<ref name="db.dir.attribute"/>
</optional>
<ref name="db.effectivity.attributes"/>
<ref name="db.rdfalite.attributes"/>
<ref name="db.transclusion.attributes"/>
<optional>
<ref name="entity.x.attribute"/>
</optional>
</interleave>
</define>
<define name="entity.x.attribute">
<attribute name="Entity_x">
<value>Yes</value>
</attribute>
</define>
---
(There is a "cleaner" way to customize the DocBook v5.1 schema by
augmenting "db.common.base.attributes". See
https://relaxng.org/tutorial-20011203.html#IDAVEZR)
Modified schema is attached to this email, as well as a screenshot of
XMLmind XML Editor Attributes tool.
Best regards,
On 11/3/22 13:36, Hurd, Alex wrote:
> Dear Hussein,
>
> I have had a look into your comments. I checked as you suggested and i am currently working in a Docbook V5.1 (see attachment).I apologize beforehand I have grayed out the name of the file and location due to client requirements.
>
> I have also attached a copy of the "docbook51.xxe" with the adjustment I made. I want to add an attribute of with the given name, and currently only want that attribute to have the value " yes" when used. I don’t know if this is possible or not but I am currently running into trouble even getting changes to appear in the Docbook when editing the config file. Could you have a look into this?
>
> Thank you very much and kind regards,
>
> Alex Hurd
>
docbook.rng
(application/xml, 543.6 KB) - not displayed
Entity_x_attribute_is_set.png
(image/png, 198.2 KB) - not displayed