Include Task
Performs XInclude processing on an XML input and outputs a file.
Parameters
The following table describes the parameters of the XInclude task.
Parameter | Description |
---|---|
BaseUriFixupBaseUriFixupBaseUriFixup |
Optional boolBooleanbool parameter.
Specifies whether |
InputInputInput |
Required ITaskItemITaskItemITaskItem parameter. Specifies the path of an XML input file to use as the context item. |
LanguageFixupLanguageFixupLanguageFixup |
Optional boolBooleanbool parameter.
Specifies whether |
OutputOutputOutput |
Required ITaskItemITaskItemITaskItem parameter. Specifies the principal output file to which the input will be serialized. |
OutputFilesOutputFilesOutputFiles |
Optional ITaskItemITaskItemITaskItem[] output parameter. Receives the serialized output file. |
ProcessXsiSchemaLocationProcessXsiSchemaLocationProcessXsiSchemaLocation |
Optional boolBooleanbool parameter.
Specifies whether |
SerializationParametersSerializationParametersSerializationParameters |
Optional stringStringString parameter. Specifies the values of serialization parameters. The value of this parameter should be set to a series of XML elements of the following form: <Parameter Name="..." [Namespace="..."] Value="..." />
The |
SerializationParameterDocumentSerializationParameterDocumentSerializationParameterDocument |
Optional ITaskItemITaskItemITaskItem parameter. Specifies a serialization parameter document from which to read serialization parameters. |
StripWhitespaceStripWhitespaceStripWhitespace |
Optional boolBooleanbool parameter.
Specifies whether the whitespace will be stripped from source documents.
If not specified, the default value is |
ValidationValidationValidation |
Optional stringStringString parameter.
Specifies whether the source documents will be validated using a DTD ("dtd"), XML Schemas ("schema") or no validation will be performed ("none").
If not specified, the default value is |
Remarks
In addition to having the parameters that are listed in the table, this task inherits parameters from the TaskTaskTask class. For a list of these additional parameters and their descriptions, see Task Base Class.
Example
The following example queries input document document.xml to produce result output.htm using the XQuery program query.xq. Values are supplied for stylesheet parameters 'data' (in namespace 'http://www.example.org/) 'name', 'size' and 'date' are defined. The 'method' serialization parameter is set to XHTML. Input documents are validated using XML Schema against a set of files with extension 'xsd'. Two collections are made available with URIs 'urn:foo' and 'urn:bar'.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath32)\XmlPrime.Tasks\XmlPrime.Tasks.Tasks"/> <ItemGroup> <Query Include="query.xq" /> <ContextDocument Include="document.xml" /> <Schemas Include="*.xsd" /> <FooCollection Include="foo*.xml"> <CollectionURI>urn:foo</CollectionURI> </FooCollection> <BarCollection Include="bar*.xml"> <CollectionURI>urn:bar</CollectionURI> </BarCollection> </ItemGroup> <PropertyGroup> <SerializationParameters> <!-- set the serialization method to XHTML --> <Parameter Name="method" Value="xhtml" /> </SerializationParameters> <QueryParameters> <!-- bind parameter 'data' in namespace 'http://www.example.org/' to the document data.xml --> <Parameter Name="data" Namespace="http://www.example.org/" Select="doc('data.xml')" /> <!-- bind parameter 'name' to the string 'Jethro' --> <Parameter Name="name" Value="Jethro" /> <!-- bind parameter 'size' to the XPath expression '1024 * 768' --> <Parameter Name="size" Select="1024 * 768" /> <!-- bind parameter 'date' to the current date --> <Parameter Name="date" Select="current-date()" /> </QueryParameters> </PropertyGroup> <!-- test passing of serialization parameters --> <Target Name="transform"> <Query XQuery="@(Query)" Input="@(ContextDocument)" Collections="@(FooCollection);@(BarCollection)" Parameters="$(QueryParameters)" SerializationParameters="$(SerializationParameters)" Schemas="@(Schemas)" Validation="Schema" Output="output.htm"> <Output TaskParameter="OutputFiles" ItemName="TransformOutputFiles" /> </Query> <Message Text="Wrote output file @(TransformOutputFiles)" /> </Target> </Project>