I'm developing build tools that are configurable via XML and extendable with PowerShell modules. I have an XSD (http://ift.tt/1qSPHvy) which describes the out of the box functionality. As suggested in a previous question (Extending XML Schema xs:choice) I want to use substitution groups to map my tools in a extendable way. But now I have a problem: Some tools are only valid at certain places. how can I restrict or map the tools to my elements in a extendable way?
Hard coded I would use <xs:choice> to define the tools on certain places. Eg the build tools:
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element ref="bt:AppendText"/>
<xs:element ref="bt:Autover"/>
<xs:element ref="bt:Call"/>
<xs:element ref="bt:CopyFile"/>
<xs:element ref="bt:Download"/>
<xs:element ref="bt:DumpContext"/>
<xs:element ref="bt:FxCop"/>
<xs:element ref="bt:IntelliLock"/>
<xs:element ref="bt:MSBuild"/>
<xs:element ref="bt:NuGetPack"/>
<xs:element ref="bt:NuGetPush"/>
<xs:element ref="bt:NUnit"/>
<xs:element ref="bt:NuSpecUpdate"/>
<xs:element ref="bt:Powershell"/>
<xs:element ref="bt:RemoveFile"/>
<xs:element ref="bt:Upload"/>
<xs:element ref="bt:VerifyFile"/>
<xs:element ref="bt:Xslt"/>
<xs:element ref="bt:Zip"/>
</xs:choice>
the credentials tools:
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element ref="bt:Powershell"/>
<xs:element ref="bt:File"/>
<xs:element ref="bt:Plain"/>
</xs:choice>
have the Powershell tool in common. Otherwise it would be no problem to use a substitution group. So I don't know how to map these elements in a reusable way.
No comments:
Post a Comment