Вы находитесь на странице: 1из 15

XMLPARSE FUNCTION FOR INFORMATICA POWERCENTER USER / DEVELOPER GUIDE

8.6.1 Release

Version 2010.06.31.01

XMLParse Function for Informatica PowerCenter User / Developer Guide

ABOUT FYGHTSOFT
F YGHTS OFT P RODUCTS
Our products are created out of real world necessity and based on best business practices. Each of our products aims to solve a business or integration problem that existed at one or more of our current or previous clients. Our products are field tested and battle ready. In order to keep our solutions fresh and products relevant we continually ask our clients and potential buyers of our products to tell us about their integration issues. If you have an idea for a product or an existing integration issue, let us know. Our products are designed to help.

C OPYRIGHT
All rights and ownership of FyghtSoft products are reserved by FyghtSoft, LLC.

LIMIT OF LIABILITY / D ISCLAIMER


While every precaution has been taken in the preparation of this article, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.

T RADEMARKS
Designations used by companies to distinguish their products are often claimed as trademarks or registered trademarks. In all instances in which FyghtSoft is aware of such claim, the product names appear in initial capital or all capital letters. Readers, however, should contact the appropriate companies for more complete information regarding trademarks and registration.

W EBSITE
http://www.fyghtsoft.com

S ALES & S UPPORT


If you have any questions regarding the purchase of this product or require additional product licenses, please contact our sales office, Monday-Friday from 9am 4pm EST at 704-904-3667 or sales@fyghtsoft.com. If you have technical issues or need to report a problem with the software please log the issue on our support forum at http://www.fyghtsoft.com/forums/.

P ARTNERS
FyghtSoft maintains relationships with several organizations, however, mention of any organization within this document does not construe entitlement, relationship, partnership, ownership, or management of any entity unless otherwise explicitly stated.

Copyright 2010 FyghtSoft, LLC All Rights Reserved

Page 2

XMLParse Function for Informatica PowerCenter User / Developer Guide

Table of Contents
About FyghtSoft .......................................................................................................................................................... 2 Getting Started with Development/Usage ................................................................................................................... 4 Introduction ............................................................................................................................................................ 4 Overview ................................................................................................................................................................. 4 License Granted....................................................................................................................................................... 4 Pre-Requisites ......................................................................................................................................................... 4 XMLParse Function Breakdown ................................................................................................................................... 6 Overview ................................................................................................................................................................. 6 References .............................................................................................................................................................. 6 Conclusion............................................................................................................................................................... 6 XMLParse Function Syntax........................................................................................................................................... 7 Overview ................................................................................................................................................................. 7 Example XML Document .......................................................................................................................................... 7 XMLParse XPath Syntax ........................................................................................................................................... 8 Disclaimer ............................................................................................................................................................... 9 Conclusion............................................................................................................................................................... 9 Demo Quickstart ....................................................................................................................................................... 10 Using the XMLParse Custom Function........................................................................................................................ 10 Setting up the Demo Environment ......................................................................................................................... 10 Further Understanding .......................................................................................................................................... 15 Conclusion............................................................................................................................................................. 15

Copyright 2010 FyghtSoft, LLC All Rights Reserved

Page 3

XMLParse Function for Informatica PowerCenter User / Developer Guide

GETTING STARTED WITH DEVELOPMENT/USAGE


INTRODUCTION
The FyghtSoft XMLParse function for Informatica PowerCenter integrates seamlessly into the Informatica Designer client tool and Informatica Server. You will take advantage of a familiar set-up when using this product - now you just have a little bit more power as an Informatica PowerCenter developer. The XMLParse function solves a serious development need of moving data from an XML Document string/file stored in a database table. The XMLParse function can really be stated as an XPath function in that it uses XPath statements to retrieve the elements and data within and XML document that are sought. Unlike existing solutions that only allow parsing of XML data as it exists on the File System, the XMLParse function is dynamic, provides immediate integration into transformation design and existing workflows. Finally, a solution exists to leverage the XML data stored relationally.

OVERVIEW
The XMLParse Function is a key integration function developed as a custom extension for Informatica PowerCenter transformations. Usage of the function is limited only to the creative solution imagination of the end users; however a sample mapping and data source are provided to test the function immediately upon your installation of the product. This document provides a basic to advanced look at using the XMLParse function. It briefly tours through the steps needed to run the demo included with the product and shows syntax related to proper operation of the function. As you read through the document, if some information is vague or you simply need more information on this product, please visit our community forums at http://www.fyghtsoft.com/index.php/support and send us an email at support@fyghtsoft.com.

LICENSE GRANTED
Purchase of this product entitles your organization to a single (1) Informatica PowerCenter production server Repository Service license. If you have more than one Informatica PowerCenter Repository Service which will utilize this product, you will need to purchase additional products/licenses to satisfy each instance. Please contact our Sales department (sales@fyghtsoft.com) as volume pricing is available. If you have any questions regarding your license or any compliance thereto, please contact our sales department.

PRE-REQUISITES
As a pre-cursor to reading and utilizing this guide, one should have read and completed the installation of the FyghtSoft Premier Function Toolbox into the Informatica server and client environments. Please reference the Installation Guide included with this product download for this information.

Copyright 2010 FyghtSoft, LLC All Rights Reserved

Page 4

XMLParse Function for Informatica PowerCenter User / Developer Guide In addition, as a developer, one will need developer level access to Informatica PowerCenter Designer and the repository under which the Premier Function Toolbox plug-ins were installed. Please confer with the Informatica administrator if necessary to attain this information.

Copyright 2010 FyghtSoft, LLC All Rights Reserved

Page 5

XMLParse Function for Informatica PowerCenter User / Developer Guide

XMLPARSE FUNCTION BREAKDOWN


OVERVIEW
The Informatica PowerCenter Premier Functions Toolbox extends the existing transformation expression functions in a myriad of ways. Some of these are minor while others provide major functionality that reduces development time and thus cost. The Premier Functions Toolbox also eliminates the need for development of code outside of the Informatica development environment to be performed. Below is a summary breakdown of each function included in the Premier Functions Toolbox. Please see the accompanying demo included with the product download and/or the video demo found in the resources section of our website. Function Name XMLParse

Arguments Returns Description

3 XMLParse(XMLDoc, Default Value, XPath Statement) String (Max 4000 characters) Using XML and XPath technology the XMLParse function takes 3 parameters and returns a scalar value as the XPath query result. The XPath syntax is similar to the base XPath syntax with minor adjustments in order to retrieve scalar values accurately within Informatica PowerCenter.

REFERENCES
For this and more information regarding some technical definitions of functionality provided within the XMLParse function please reference the following: XPath: o http://www.w3.org/TR/xpath/ o http://www.w3schools.com/xpath/default.asp http://www.w3schools.com/xpath/xpath_syntax.asp

CONCLUSION
The above breakdown of each function provides an immediate syntactical reference and brief understanding for the overall capabilities of this product. Importing and running the demo included with this product is highly recommended in order to see how the functions operate. Please also reference the quickstart videos and guides from http://www.fyghtsoft.com/index.php/resources.

Copyright 2010 FyghtSoft, LLC All Rights Reserved

Page 6

XMLParse Function for Informatica PowerCenter User / Developer Guide

XMLPARSE FUNCTION SYNTAX


OVERVIEW
The syntax used for the XPath argument required by the XMLParse function is basically core XPath with a few modifications. Since the XMLParse function can only return a scalar/single value, the XPath syntax is best utilized when requiring a single value from an element or attribute of a single node. Although the XMLParse function will accept core XPath syntax an error is most likely to occur if attempts are made to pull back all values of a sub-element or use similar non-scalar XPath logic. In this section, many of the useful XPath syntax examples are provided based on real-world usage and the demo provided with the product. Clearly, attempts to parse your relation XML documents will vary in path structure but the syntax will be very similar in object/element retrieval.

EXAMPLE XML DOCUMENT


The XML document seen here is the XML document used as an example for the XPath syntax shown within this section.

Copyright 2010 FyghtSoft, LLC All Rights Reserved

Page 7

XMLParse Function for Informatica PowerCenter User / Developer Guide

XMLPARSE XPATH SYNTAX


The items below are desired for retrieval along with the modified XMLParse XPath logic used to retrieve the respective item information from the above XML Document. Please note that all syntax must stem from the core level of the XML Document. This is consistently shown in the examples below. Basic Syntax Matrix Description
Text() Attribute
Retrieves the value of any position declared in the XPath syntax Locates an attribute within an element to provide the desired value

Example
/purchaseOrder/shipTo/name/text() /purchaseOrder/billTo/@country

Copyright 2010 FyghtSoft, LLC All Rights Reserved

Page 8

XMLParse Function for Informatica PowerCenter User / Developer Guide


Node by #
Select a specific node by position within a parent node /purchaseOrder/item/items[2]/productName/text()

DISCLAIMER
This product is only officially certified to retrieve scalar/single value using the text() retrieve method at the end of the XPath statement. This has been tested on multiple platforms and varying XML documents without issue. Furthermore, the XPath syntax for attributes using the @ symbol has been certified for use as well. An example of each of these is shown in the matrix above.

CONCLUSION
The above breakdown of each function provides an immediate syntactical reference and brief understanding for the overall capabilities of this product. There are very few caveats inherent within this custom functions product and we sought to highlight those items in this section. Importing and running the demo included with this product is highly recommended in order to see how the functions operate. Please also reference the quickstart section of this guide or visit other support resource from our website at http://www.fyghtsoft.com/index.php/resources.

Copyright 2010 FyghtSoft, LLC All Rights Reserved

Page 9

XMLParse Function for Informatica PowerCenter User / Developer Guide

DEMO QUICKSTART
Several quickstart videos have been produced to educate developers on usage of this product. The quickstart videos are not a replacement for the core documentation found here and within the product directory. The quickstart videos can be found on the FyghtSoft website at http://www.fyghtsoft.com/index.php/resources.

USING THE XMLPARSE CUSTOM FUNCTION


If the XMLParse custom function was installed correctly following by installation guide (see /_Docs/ directory) each developer workstation with the Informatica PowerCenter client tools will see a folder for FyghtSoft within the transformation editor in PowerCenter Designer. Under this folder will reside the XMLParse function object. Behind the scenes the Informatica administrator will have installed the XMLParse binaries on the Integration Services server as well. The steps outlined below provide a quickstart on using the XMLParse function. The quickstart is based on demo data and Informatica PowerCenter mappings created by FyghtSoft in order to ramp up developers.

SETTING UP THE DEMO ENVIRONMENT


1. Locate the extract directory for this products main zip file.

2.

The demo that was created for this quickstart is for an Oracle RDBMS. You may convert the SQL to another database if desired, but this quickstart will continue to reference the Oracle RDBMS. Open your favorite RDBMS GUI Editor (SQL*Plus, SQLDeveloper, etc.). /Demo/SQL/ORCL/. Execute the script, Demo_InstallX.sql. Navigate to the folder path

NOTE: An existing database scheme is expected when running the script. Typically for demo purposes our team utilizes the HR schema. Please contact your RDBMS administrator if you are not familiar with a test schema available for use.

Copyright 2010 FyghtSoft, LLC All Rights Reserved

Page 10

XMLParse Function for Informatica PowerCenter User / Developer Guide

3.

Confirm that your schema now has the following new objects.

4. 5.

Open Informatica PowerCenter Repository Manager. Connect to a Repository Service that will be used for this demo purpose. The next step requires an importing of objects into a Repository Service. If a demo folder already exists for your testing purposes then you may use it. Otherwise, choose Folder > Create from the menu bar to create a new folder called Demo.

Copyright 2010 FyghtSoft, LLC All Rights Reserved

Page 11

XMLParse Function for Informatica PowerCenter User / Developer Guide

6. 7.

From the menu bar choose Repository > Import Objects On the Import Objects wizard, click the Browse button and navigate to the /Demo/Informatica_Objects/ path under the extract product folder. Select the .XML file.

Click Next. 8. Select Add All from the Import Objects step. Click Next.

Copyright 2010 FyghtSoft, LLC All Rights Reserved

Page 12

XMLParse Function for Informatica PowerCenter User / Developer Guide

9.

Choose the folder name you determined in Step 5 above.

10. Determine any conflict resolutions and complete the import utility.

Copyright 2010 FyghtSoft, LLC All Rights Reserved

Page 13

XMLParse Function for Informatica PowerCenter User / Developer Guide

Click Import. Click Done. 11. Open Workflow Manager. 12. Modify your connection to ensure that you have a connection that references the database schema under which you executed the script in Step 2 above.

Copyright 2010 FyghtSoft, LLC All Rights Reserved

Page 14

XMLParse Function for Informatica PowerCenter User / Developer Guide Be sure that in the workflow you assign the connection to the session appropriately. 13. You should now be able to successfully run the demo workflow. Execute the workflow and once completed (use Workflow Monitor to view completion), in your favorite GUI IDE, run any of the queries from the script XMLParse_Queries.sql found in the /Demo/SQL/ORCL/ folder of the extracted product.

FURTHER UNDERSTANDING
As detailed above, the XMLParse custom function is based on XPath syntax. Although the demo provides several examples of how the XMLParser function may be used in a real-world situation, there may be several other uses for the function not provided in the quickstart demo. Further understanding may be accomplished by unit testing the function. If there are any issues, please contact the FyghtSoft support team.

CONCLUSION
The above function is unique to Informatica PowerCenter in that FyghtSoft is adding some new approaches to the way that transformation expressions have been utilized in the past. FyghtSoft aims to continue the education of our customers about our products so that ease of use and transparency exists. If there are any questions, comments, or concerns please express these through our forums at http://www.fyghtsoft.com/forums/ so that other users may also share in discovery and solutions.

Copyright 2010 FyghtSoft, LLC All Rights Reserved

Page 15

Вам также может понравиться