XML File Data Source
Adding an XML File Data Source
If this data source is exported from a staging machine and imported to a production machine, the path for the logs directory might change from C:\<staging>\logs to C:\<production>\logs. Then, only the path to the root directory in the file data source needs to be modified after the data source is imported, and none of the queries to this data source need to be modified. After the root path is modified, it is your responsibility to re-introspect your data to ensure the existence of all the files. If the file structure of the new location is different from the old one, it entails adding/deleting/changing some of the files.
After you have added a file-XML data source to the resource tree, you cannot change its file path. If you want a new file path, delete it and create it again.
To add a file-XML data source
|
1.
|
Right-click at a location in the Studio resource tree where you want this data source to reside, and select New Data Source. |
|
2.
|
In the New Physical Data Source dialog, select File-XML. |
|
4.
|
Type a name for the data source. |
|
5.
|
Select one of the following: |
|
6.
|
If the file is on the local file system, Select Browse and navigate to the root directory of the files for this data source. |
With this option, you can select one, more, or all the files in a directory. You can also select all the directories and all the files of the same type in those directories. However, even if all the files in the directory are of the comma-separated values (CSV) type, detailed characteristics such as whether a header row exists must match.
|
7.
|
If the files are located at a URL, specify
|
|
FTP URL
|
HTTP, HTTPS and FTP are supported for reading the data. File must be in text format and unzipped.
|
|
network location
|
The URL to the single file must be relative to the machine where TDV Server is running.
|
|
machine without a Web server
|
It must be mapped to the machine where TDV Server is running.
|
|
8.
|
Select Use Credentials if you want to specify user credentials here (rather than with system configuration) for connecting the data source.
|
|
Domain
|
User’s domain; for example, composite.
|
|
User Name
|
Name of the user.
|
|
Password
|
User’s password.
|
|
9.
|
Accept the default or specify the Character Set encoding type. The Character Set drop-down list includes <auto-detect> as the default option for file-XML data sources, letting Studio detect the character set automatically. |
|
10.
|
Optionally, type in the location of the XML schema file using this syntax: |
<namespace> <location> [<namespace> <location>]
|
—
|
<namespace> is the target namespace for the XML schema |
|
—
|
<location> is the absolute path (including the name of the file) to the XSD file. |
|
—
|
A white space is needed between the target namespace and location. |
If you want to use an external XSD file for resolving the schema, specify the location of the XSD file in the Schema Location field. If you want to let the system decide the XML schema for you, leave the Schema Location field blank.
Example:
http://www.compositesw.com/services/webservices/system/admin/resource file:///C:/test.xsd
|
namespace
|
http://www.compositesw.com/services/webservices/system/admin/resource
|
|
location
|
file:///C:/test.xsd
|
|
11.
|
Optionally, type in the No Namespace Schema Location to specify the location for an XML Schema that does not have a target namespace. |
|
12.
|
Accept the default file extensions to filter the root directory for, or type in the file extension values for which you want to filter.
|
Rules for the filters:
|
—
|
* (asterisk) means that any character in the filename occurs zero or more times. |
|
—
|
? (question mark) means that any character in the filename occurs exactly once. |
|
—
|
, (comma) is a separator between filters. |
|
—
|
\ (backslash) is an escape character to escape a filename that contains * (asterisk), ? (question mark), or , (comma). |
|
13.
|
Click one of these buttons: |
|
—
|
Create & Introspect—To proceed immediately with introspection. |
|
—
|
Create & Close—To create the data source; you can introspect at a later time. |
|
14.
|
Refer the User Guide, Chapter Retrieving Data Source Metadata for how to introspect now or later. |