Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Virtualization Tutorial: XSLT and Streaming Transformations

Similar presentations


Presentation on theme: "Data Virtualization Tutorial: XSLT and Streaming Transformations"— Presentation transcript:

1 Data Virtualization Tutorial: XSLT and Streaming Transformations
Hello, and welcome to the Tutorial Series for Cisco Information Server, or CIS. In this tutorial, we discuss XSLT and Streaming Transformations.

2 For more details… Resources: Additional information: Archives
Documentation Training Resources: Archives Data files Tutorial Document Note that Tutorials are NOT meant to be comprehensive training modules. Instead, they demonstrate a very basic use case that can be built quickly and easily. However, the Data Virtualization Knowledge Base contains additional information that will help you learn more and go deeper. Additional resources in the Knowledge Base include: <CLICK> Resources used to build the tutorial, such as Data Virtualization Archive files, data source files, and a document version of this tutorial. <CLICK> Additional information, including documentation and training materials.

3 Agenda What are they and why do they matter? How-to Summary
Here is our agenda. We begin by defining XSLT and Streaming Transformations and outlining their importance in Data Virtualization projects. Next we demonstrate the basics of these Transformations. Finally, we summarize the contents of this tutorial.

4 Agenda What are they and why do they matter? How-to Summary
Let’s begin by discussing what XSLT and Streaming Transformations are, and why they are important for Data Virtualization.

5 What are they? XSLT Transformations
Extensible Stylesheet Language Transformations Industry-standard transformation language In DV, most commonly used for flattening XML Streaming Transformations Similar to XSLT Editor Useful for large data sets XSLT stands for Extensible Stylesheet Language Transformations. It is an industry-standard language that is used for transforming XML data structures into different formats, including other XML structures, HTML, plain text, and so on. For Data Virtualization, the most common use case for XSLT is flattening XML documents so that they can easily be joined with data from databases and flat files. CIS Studio includes an XSLT Transformation Editor that provides graphical tools for defining XSLT transformations. CIS Studio also includes a Streaming Transformation Editor. Its interface is identical to the XSLT Editor, but it adds the capability of working with very large data sets that cannot be completely held in memory. Because its functionality is identical to the XSLT editor, some developers use the Streaming Transformation Editor for all use cases. However, the XSLT editor allows the user to edit the raw XSLT statements, while the Streaming editor does not.

6 Why do they matter? XSLT and Streaming Transformations
Relational data structures provide a common format for data federation Hierarchical XML structures must be flattened in order to participate in data federation projects. XSLT and Streaming Transformations are important for Data Virtualization because flat relational data structures provide a common format for federation of data that comes from multiple physical data sources. In order for XML data structures to be used in Data Virtualization projects, they must be flattened into this common format so that they can be joined with data from databases, flat files, and other sources.

7 Agenda What are they and why do they matter? How-to Summary
Next, let’s walk through a very basic demo of XSLT and Streaming Transformations.

8 Here is the business problem…
CIS Here is the business problem that we illustrate in this demo. We have an XML document that contains descriptions of products. We need to flatten this document into a relational structure so that it can be joined with data from an Inventory database in order to produce a federated virtual view. We’ll use the XSLT and Streaming Transformation Editors to accomplish this.

9 Creating an XSLT Transformation
Let’s create an XSLT transformation to flatten the XML product description document. In Studio, make a folder to hold your work. <CLICK> Right-click the folder and select New Transformation. <CLICK> Studio supports several different kinds of Transformation Editors. Select XSLT Transformation and click Next.

10 Creating an XSLT Transformation
Give the Transformation a name. <CLICK> Now navigate to the Examples folder that is part of the standard Studio installation. <CLICK> Expand the ds_XML data source, and select the productCatalog.xml resource. Click Finish.

11 Creating an XSLT Transformation
The XSLT Editor appears. Expand the source and examine its structure. <CLICK> Notice that wrapper tags appear with folder icons… <CLICK> … while leaf-level data tags appear with icons indicating their data types. <CLICK> Since we are flattening this hierarchical structure, we don’t want the wrapper tags. Select only the data items, using Control-Click and/or Shift-Click. <CLICK> On the toolbar, click the Create Link and Target icon. <CLICK> The flat output structure is created.

12 Creating an XSLT Transformation
Execute the Transformation… <CLICK> … to verify that a flat relational structure is returned. Notice that CategoryID and CategoryName fields, which were at a higher level in the original hierarchy, are repeated for each leaf-level row in the new flat structure.

13 Using the Transformation in a View
Now let’s use the Transformation in a Virtual View. Create a new View, and drag the Transformation onto the Model canvas of the View. Because a Transformation is a type of Procedure, you will see this parameter panel appear when you drag in the Transformation. It is blank because this Transformation does not have any input parameters. Simply click OK. <CLICK> Now open the Examples folder, expand the ds_inventory data source, and drag in the InventoryTransactions table. Join the two resources on the ProductID column, fill out the projection in the Grid Panel, and execute the View. We have successfully created a Join between an XML document and a Database.

14 Refining a Transformation
In the previous example we showed a quick and easy way to flatten an entire XML structure. Now let’s look at some additional features of the XSLT Transformation Editor that will help us customize the Transformation. Create a new Transformation, name it, and once again select the productCatalog.xml document from the Examples folder.

15 Refining a Transformation
Now select ONLY the CategoryID field… <CLICK> … and click Create Link and Target. <CLICK> Our output structure contains only the selected column.

16 Refining a Transformation
In the output Target, right-click the new column and select Rename. <CLICK> You can change the output column name to anything you like.

17 Refining a Transformation
We can also build a Transformation by defining the output first. Click in the output area, then on the toolbar Click Add… <CLICK> … select a Decimal data type… <CLICK> … and an output column is created… <CLICK> … which you can rename. Here we call it PROD_ID. <CLICK> Next, add a VARCHAR… <CLICK> … and name it PROD_DESC.

18 Refining a Transformation
Now that we have created two new output columns, return to the Source side of the Editor and select the ProductID field. <CLICK> Click the Create Link icon. <CLICK> A link is created from the input ProductID to the first available output, which is PROD_ID.

19 Refining a Transformation
I can also use drag-and-drop… <CLICK> … to create a link.

20 Refining a Transformation
Oops, I picked the wrong input field. I select Delete Link… <CLICK> … confirm… <CLICK> … and the link is removed.

21 Refining a Transformation
If I want to change the order of the output columns, I can use the up and down arrows. <CLICK> Finally, if I want to perform some highly custom transformation steps, I can edit the actual XSLT statements. This capability is beyond the scope of this tutorial.

22 Creating a Streaming Transformation
We have examined XSLT Transformations. Now let’s look at Streaming Transformations. This is an appropriate choice when an XML data source is too large to be completely held in memory.

23 Creating a Streaming Transformation
As you can see, the editor interface for the Streaming Transformation Editor is identical to the XSLT Editor, except that the XSLT tab is not present. You can use the Data Map tab just as we did before to flatten the document. We have seen how to flatten XML documents using both the XSLT Transformation Editor and the Streaming Transformation Editor. Our demo is complete.

24 Agenda What are they and why do they matter? How-to Summary
Let’s summarize what we have seen in this tutorial.

25 Summary: Definition XSLT Transformations
Extensible Stylesheet Language Transformations Industry-standard transformation language In DV, most commonly used for flattening XML Streaming Transformations Similar to XSLT Editor Useful for large data sets XSLT stands for Extensible Stylesheet Language Transformations. It is an industry-standard language that is used for transforming XML data structures into different formats, including other XML structures, HTML, plain text, and so on. For Data Virtualization, the most common use case for XSLT is flattening XML documents so that they can easily be joined with data from databases and flat files. CIS Studio includes an XSLT Transformation Editor that provides graphical tools for defining XSLT transformations. CIS Studio also includes a Streaming Transformation Editor. Its interface is identical to the XSLT Editor, but it adds the capability of working with very large data sets that cannot be completely held in memory. Because its functionality is identical to the XSLT editor, some developers use the Streaming Transformation Editor for all use cases. However, the XSLT editor allows the user to edit the raw XSLT statements, while the Streaming editor does not.

26 Summary: Benefits XSLT and Streaming Transformations
Relational data structures provide a common format for data federation Hierarchical XML structures must be flattened in order to participate in data federation projects. XSLT and Streaming Transformations are important for Data Virtualization because flat relational data structures provide a common format for federation of data that comes from multiple physical data sources. In order for XML data structures to be used in Data Virtualization projects, they must be flattened into this common format so that they can be joined with data from databases, flat files, and other sources.

27 Summary: Key Take-aways
XSLT Transformations Can be used when the entire input XML structure fits in memory Allows custom editing of raw XSLT Streaming Transformations Does not require entire input XML structure in memory Does not allow custom editing of raw XSLT As you work with Transformations in CIS, keep these key take-aways in mind. The XSLT Transformation Editor is a good choice when your entire input XML structure fits into memory. This editor gives you the option of hand-editing raw XSLT if you wish. The Streaming Transformation Editor does not require the entire XML data structure to be held in memory. However, it does not allow hand-editing of raw XSLT.

28 Summary: What’s next? Use your knowledge to transform XML data into relational structures that can be joined with data from other sources Leverage your knowledge to create more complex transformations based on XSLT Learn to use other included Transformation Editors After completing this tutorial, you are ready to expand the types of data sources you can use in CIS. Use your learning from this tutorial to transform XML data into flat relational structures that are ready to be joined with data from other sources. Leverage your knowledge to create more complex XSLT-based transformations. Use other Tutorials to learn about additional Transformation Editors that are included in CIS Studio. Thank you.

29


Download ppt "Data Virtualization Tutorial: XSLT and Streaming Transformations"

Similar presentations


Ads by Google