Purchase your Section 508 Compliance Support guide now!

Purchase your Section 508 Compliance Support guide now!

XML Data Source

If 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/country.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 Windows file path example is \\

servername\XML\country.xml.
A UNIX file path example is /
servername/XML/country.xml.

• a local file

An example is C:\XML\country.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.

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?countrysid=??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 in Cognos Connection, the Test button does not work.

• Validation of the query specification in Report Studio does not work if you are connected to a parameterized XML connection string.