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

Article:HOWTO5932  |  Created: 2006-12-01  |  Updated: 2007-03-07  |  Article URL http://www.symantec.com/docs/HOWTO5932
Article Type
How To


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

Answer
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:

<nsDataExport>
  <columns>
    <column name="ComputerName" id="col0" type="System.String" />
    <column name="IPAddress" id="col1" type="System.String" />
  </columns>
  <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" />
    <rows>
      <row rowNumber="0">
        <column ref="col0">AMS3</column>
      </row>
      <row rowNumber="1">
        <column ref="col0">XP-ASSET1</column>
      </row>
    </rows>
  </exportExecution>
</nsDataExport>

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"?>
<ResourceList>
  <ResourceType Type="Computer">
    <FieldList>
      <Field Name="Category">Desktop Hardware</Field>
      <Field Name="ComputerName">AMS3</Field>
      <Field Name="IPAddress">192.168.0.1</Field>
    </FieldList>
  </ResourceType>
  <ResourceType Type="Computer">
    <FieldList>
      <Field Name="Category">Desktop Hardware</Field>
      <Field Name="ComputerName">XP-ASSET1</Field>
      <Field Name="IPAddress">192.168.0.2</Field>
    </FieldList>
  </ResourceType>
</ResourceList>

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.


Attachments

sample.xslt (1 kBytes)

Legacy ID



30682


Article URL http://www.symantec.com/docs/HOWTO5932


Terms of use for this information are found in Legal Notices