我正在开发通过XML可配置并可用PowerShell模块扩展的构建工具。我有一个XSD (http://download.crawler-lib.net/BuildTools/BuildConfig.xsd),它描述开箱即用的功能。一个扩展点是构建序列的工具:
<xs:element name="BuildSequence">
<xs:annotation>
<xs:documentation>Performs a sequence of build tools to build the solution</xs:documentation>
</xs:annotation>
<xs:complexType>
<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>
<xs:attribute name="Name" type="xs:string" use="required"/>
<xs:attribute name="NewBuild" type="bt:boolean" use="optional"/>
</xs:complexType>
</xs:element>有人可以通过一个额外的PowerShell模块来扩展这一点,该模块定义了一个名为"MyTool“的构建步骤工具。因此,在XML配置中,可能会有另一个有效元素,应该在选项列表中,如下所示:
<xs:element ref="custom:MyTool"/>如何使用额外的(custom.xsd) XSD文件扩展这样的定义?以便在Visual中为自定义元素获取IntelliSense?
发布于 2014-08-31 09:17:08
考虑使用替换组。如果您的内容模型允许元素E,那么它也允许E的替换组中的任何元素;任何人都可以创建这样的元素(除非您阻止它),并且它可以自动可用,而无需更改内容模型。
https://stackoverflow.com/questions/25584603
复制相似问题