Information
We are currently investigating an issue with the editor of some pages. Please save your work and avoid to create new pages until this banner is gone.
How can I put definitions for dynamic components in multiple files?
This page discusses how to handle dynamic components outside the single Components.xml
file.
DynamicComponents are described in the Component.xml
file by entries whose name is "*".
This works fine if we are happy to put all DynamicComponents in the same Components.xml
file. But it is impossible to place their description in a separate, own file, because:
"*"
containind a file calles *.xml
This is a problem when trying to factorize the CDB in a structured and hierarchical way.
See:
Starting from ACS 4.1.0, it is possible to use the recent XInclude and XPointer XML specification.
See ZLegacy/ACS.CDBDynamicComponents for a detailed discussion about usage and implementation of XInclude and Xpointer in xercel-2 java, our parser (and the patches we have implemented).
Components.xml
XXX_IncludeDynamic.xml
and can be put anywhere in the hierarchical structure of the CDB. (1)
well formed Components description file=
Components.xml
using the following syntax: (2)
<xi:include href="<relative path>/XXX_IncludeDynamic.xml" xpointer="element(/1)" />
(1) Note:
Using this technique include XML files can be in principle generally used everywhere in the CDB.
The only hard constraint is that:
Guidelines, conventions and other approved usages of the XInclude facility are not part of this discussion and will have to be adressed with HLA, SE and IT at a later time.
(2) Note:
The XPointer syntax is currently not fully implemented. Only the expression "element(/1)"
is supported.
<subsystem>_IncludeDynamic.xml
CONTROL
might have the file CONTROL_IncludeDynamic.xml
:<?xml version="1.0" encoding="utf-8"?> <Components xmlns="urn:schemas-cosylab-com:Components:1.0" xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" xmlns:baci="urn:schemas-cosylab-com:BACI:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <_ Name="*" Code="controlDynamic_1" Type="IDL:alma/PsDynamic_1:1.0" Container="Container"/> <_ Name="*" Code="controlPsDynamic_2" Type="IDL:alma/PsDynamic_2:1.0" Container="bilboContainer" /> </Components>
CORRELATOR
might have the file CORRELATOR/IncludeDynamic.xml
inside the CORRELATOR directory:<?xml version="1.0" encoding="utf-8"?> <Components xmlns="urn:schemas-cosylab-com:Components:1.0" xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" xmlns:baci="urn:schemas-cosylab-com:BACI:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <_ Name="*" Code="corrDynamic_1" Type="IDL:alma/MountDynamic_1:1.0" Container="Container"/> <_ Name="*" Code="corrDynamic_2" Type="IDL:alma/MountDynamic_2:1.0" Container="corrContainer" /> </Components>
Components.xml
eventually together with other component specifications:<?xml version="1.0" encoding="utf-8"?> <Components xmlns="urn:schemas-cosylab-com:Components:1.0" xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" xmlns:baci="urn:schemas-cosylab-com:BACI:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude"> <_ Name="ALMA_DOOR" Code="acsexmplDoorImpl" Type="IDL:alma/acsexmplBuilding/Door:1.0" Container="Container" /> <xi:include href="CONTROL_IncludeDynamic.xml" xpointer="element(/1)" /> <xi:include href="CORRELATOR/IncludeDynamic.xml" xpointer="element(/1)" /> </Components>
A complete working example of CDB is here: Main.FAQHierarchicalComponentsAndCDBStructure
-- GianlucaChiozzi - 06 Sep 2005