id
attribute of the infoboxDefinition
top-level XML element.
property
elements define the properties specified for this infobox. There are two kinds of properties:text
property means the text value of the propertyurl
property means the URL of the external linkimage
property means the ID of the image<property key="prop1" value="my value" /> <property key="prop1" >a reference to <ref id="anArticle" /></property>
state
children, each child having the following attributes:<enumProperty key="prop4" value="one" />Note that if you don't specify an enumeration property value, but the propety definition has a default state, this state will be used.
<infoboxDefinition id="infobox1"> <property key="prop1" desc="property 1" keyRef="article2" /> <property key="prop2" desc="property 2" /> <property key="prop3" desc="property 3" type="url" /> <property key="prop4" desc="property 4" type="image" /> </infoboxDefinition>If we have the following instance:
<article desc="article20"> <infobox id="infobox1"> <property key="name" value="the name" /> <property key="prop1" value="my value" /> <property key="prop2">The text</property> <property key="prop3" value="http://docs.oracle.com/javase/8/docs/api/index.html" /> <property key="prop4" value="image1" /> </infobox> a text. </article>The result will be:
<infoboxDefinition id="infobox1"> <property key="prop1" desc="property 1" keyRef="article2" /> <enumProperty key="prop2" desc="property 2"> <state value="one" desc="the first value" /> <state value="two" desc="the second value" /> </enumProperty> </infoboxDefinition>We can have the following instance:
<article desc="article20"> <infobox id="infobox1"> <property key="name" value="the name" /> <property key="prop1" value="my value" /> <property key="prop2" value="one"</property> </infobox> a text. </article>
<infoboxDefinition id="infobox1"> <property key="prop1" desc="property 1" keyRef="article2" defaultState="two" /> <enumProperty key="prop2" desc="property 2"> <state value="one" desc="the first value" /> <state value="two" desc="the second value" /> </enumProperty> </infoboxDefinition>If we have the following instance:
<article desc="article20"> <infobox id="infobox1"> <property key="name" value="the name" /> <property key="prop1" value="my value" /> </infobox> a text. </article>The result will be equivalent to:
<article desc="article20"> <infobox id="infobox1"> <property key="name" value="the name" /> <property key="prop1" value="my value" /> <property key="prop2" value="two"</property> </infobox> a text. </article>
docJGenerator Copyright (c) 2016-2023 Herve Girod. All rights reserved.