Skip to main content
Version: 4.2.5

Filter for importing XML schemas

The purpose of the filter is to limit what is imported from an XML schema, for example if the schema is too large or complex.

note

The import filter must conform to the schema definition file XmlSchemaImportFilter.xsd, which can be found under bin/Config/Scripts in the iCore install folder.

Example

Below is an example of an import filter which replaces and excludes a number of elements in an xml schema.

    <Filter xmlns="http://schemas.icore.se/XmlSchemaImportFilter.xsd/V1/">
<ReplaceChildren>
<FilterByPath Path="/Order/"
ElementName="ReferenceDocument"
ElementNamespaceURI="http://www.tempuri.com/order/" />
</ReplaceChildren>
<ReplaceChildren>
<FilterByName ElementName="ReferenceDocument"
ElementNamespaceURI="http://www.tempuri.com/order/" />
</ReplaceChildren>
<ExcludeElement>
<FilterByPath Path="/Order/"
ElementName="InvoiceAddress"
ElementNamespaceURI="http://www.tempuri.com/order/" />
</ExcludeElement>
<ExcludeElement>
<FilterByName ElementName="InvoiceAddress"
ElementNamespaceURI="http://www.tempuri.com/order/" />
</ExcludeElement>
</Filter>

Comments

ExcludeElement excludes elements from the imported schema.

ReplaceChildren replaces the children of a specific element with an <any> element.

Elements in the imported schema are identified either by name or by path in the schema, and is done with the following elements:

FilterByName

  • ElementName attribute – specifies an element name.
  • ElementNamepsaceURI attribute – specifies a namespace (optional).

FilterByPath

  • Path attribute – specifies the parent path in the schema of the element. The path must start and end with a slash (/), for example: /order/lines/line/.
  • ElementName attribute  – specifies an element name.
  • ElementNamepsaceURI attribute – specifies a namespace (optional).

See Also

Tutorials

Managing structures