How is the Export XSLT option used in an XML export?

Article:HOWTO5932  |  Created: 2006-12-01  |  Updated: 2007-03-07  |  Article URL
Article Type
How To

How is the Export XSLT option used in Connector Solution 6.1?

The Export XSLT Advanced Option in an XML data source allows transforming the default XML export format that Connector Solution produces. The XSLT has to align with this default schema in order to work.

The following is a very basic example that can be used and extended to meet other needs.

First create a new XML data source as shown below:

Next, create a Resource Import/Export Rule as shown below, leaving all other Foreign Source Column Names blank other than the Resource Name and IP Address:

Executing the preceeding rule will produce the following output to a file:

    <column name="ComputerName" id="col0" type="System.String" />
    <column name="IPAddress" id="col1" type="System.String" />
  <exportExecution date="12/1/2006 2:31:03 PM" resultsSetId="ba00b117-dc84-4914-976f-5ad64d12b579">
    <dataSource name="XML Source" guid="7eb78411-0870-47e0-a62f-0dbac0e7e4ef" />
      <row rowNumber="0">
        <column ref="col0">AMS3</column>
      <row rowNumber="1">
        <column ref="col0">XP-ASSET1</column>

Next, specify the attached sample.xslt in the XML data source as shown below:

Execute the same XML export rule and you should get the following output to a file:

<?xml version="1.0" encoding="utf-8"?>
  <ResourceType Type="Computer">
      <Field Name="Category">Desktop Hardware</Field>
      <Field Name="ComputerName">AMS3</Field>
      <Field Name="IPAddress"></Field>
  <ResourceType Type="Computer">
      <Field Name="Category">Desktop Hardware</Field>
      <Field Name="ComputerName">XP-ASSET1</Field>
      <Field Name="IPAddress"></Field>

Review and compare the default output, the attached sample.xslt file, and the transformed output to get an idea of what is happening. Then you should be able to extend and customize the sample.xslt file to meet your needs.


sample.xslt (1 kBytes)

Legacy ID


Article URL

Terms of use for this information are found in Legal Notices