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.
Can I put many xml files in the same directory to specify the deployment?
Since ACS 4.1.0, it is possible to put multiple xml files in the same directory, each with a number of Components inside, by using the recent XInclude and XPointer XML specification.
See CDBProblems#Multiple_Xml_Files_In_Cdb_Direct for a detailed discussion about usage and implementation of XInclude and Xpointer in xerces-2 java, our parser (and the patches we have implemented).
Components.xml
well formed Components description file=
Components.xml
using the following syntax: (2)
<xi:include href="<relative path>/MyIncludeFile.xml" xpointer="element(/1)" />
See also:
for more details of usage and examples
-- GianlucaChiozzi - 06 Sep 2005
ACS < 4.1.0
With versions of ACS < 4.1.0, this was not possible. Here is the old explanation
The design of the ACS CDB is driven by the need to provide users with an "XML Abstraction" for the configuration database, i.e. from the user point of view every Node in the hierarchical structure of the Configuration Database shall appear as a valid XML document.
This is independent from the actual implementation on the backend.
We are now providing a Java implementation (called cdbjDAL
) and we will provide an implementation of the same interfaces using the ALMA Archive.
The Java implementation could have used a single XML file for the whole configuration database, but we have preferred to make it more modular using the hierarchical structure of the file system.
In doing this we have introduced the mapping:
Directory <=> XML node
If we put two XML files in the directory, it is not possible any more to build a valid XML document by loading both of them!
This is because we would have two root nodes and this is not allowed by the XML specification
Consider the following example:
/Components
- Is a directorySomeComponents.xml
- Is an XML file with the following contents:<?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="PBEND_B_01" Code="acsexmplPowerSupplyImpl" Type="IDL:alma/PS/PowerSupply:1.0" Container="bilboContainer"/> <_ Name="PBUMP_B_01" Code="acsexmplPowerSupplyImpl" Type="IDL:alma/PS/PowerSupply:1.0" Container="bilboContainer"/> </Components>
OtherComponents.xml
- Is another XML file with the following contents:<?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="TEST_PS_1" Code="acsexmplPowerSupplyImpl" Type="IDL:alma/PS/PowerSupply:1.0" Container="bilboContainer"/> <_ Name="TEST_PS_2" Code="acsexmplPowerSupplyImpl" Type="IDL:alma/PS/PowerSupply:1.0" Container="bilboContainer"/> </Components>
We can make the following considerations:
We think that none of these solutions would be acceptable and therefore we prefer to stick to the rule that only one XML file per directory is allowed and suggest to use the hierarchical directory structure.
A clean solution for the problem of splitting information over multiple XML files in the same directory would come from the usage of the XInclude specification, but there are currently implementation problems discussed in the topic
CdbXInclude.
-- GianlucaChiozzi - 22 Feb 2005