XML Data Sources

When you create an XML data source, you must use XML as the type of connection and specify the location of the XML document in the connection string.

You can specify the connection string for an XML data source as:

  • an HTTP URL that identifies the content store required to connect to the XML document.

    An example is HTTP://xmltestserver.cognos.com/XML/countryregion.xml.

    Ensure that you create a Web alias for the directory that contains the XML file and that you enable directory browsing.

  • a file path

    A Microsoft Windows operating system file path example is \\servername\XML\countryregion.xml.

    A UNIX operating system file path example is /mount name/XML/countryregion.xml.

  • a local file

    An example is C:\XML\countryregion.xml;VALIDATE=ON.

To access a local file, use a file path that uses platform-specific syntax.

To test an XML connection string, you must type the following code at the end of the string:

;VALIDATE=ON

The text of this code is not case sensitive.

You specify connection parameters when you create a data source or modify a data source connection. For more information, see Data source connections.

Table 1. XML data source parameters

Parameter

Description

Connection string

Enter the connection string.

Parameterized XML Connection Strings

In an HTTP URL connection string for an XML data source, you can use parameters to send additional information. You can embed a prompt definition string in the parameter component.

If the prompt definition is specified in the report, that value is used. Otherwise, the user is prompted to supply a value. Prompting is not supported for other types of connection strings.

An example of a URL component is addressing_scheme://network_location/path;parameters?query#fragment_identifier

Encode the parameter component with the definition string in between two sets of question marks. A prompt cannot cross a component boundary.

An example of a parameterized XML string is http://My_Network_Location/My_Path/myxml.asp?countryregionsid=??CanadaPrompt??

Parameterized XML connection strings have these restrictions:

  • When a URL component is a prompt, it cannot contain other data.
  • Prompts embedded in XML connection strings do not work in Framework Manager. You cannot import data from a parameterized XML connection string.
  • When you set up a parameterized XML connection string, the Test button does not work.
  • Validation of the query specification in Reporting does not work if you are connected to a parameterized XML connection string.