The TIBCO Platform is a real-time, composable data platform that will bring together an evolving set of your TIBCO solutions - and it's available now!
A chart showing the TIBCO Platform vision
Jump to content
Articles
Read more about TIBCO use cases, product features, capabilities and more
  • Working with Namespace Prefixes in TIBCO ActiveMatrix BusinessWorks?


    Manoj Chaurasia

    Table of Contents


    This article discusses the options available for controlling the way TIBCO ActiveMatrix BusinessWorks? creates/manages namespaces and namespace prefixes. Download the sample project that illustrates the options from Resources below.

    Moving namespace declarations to root node

    When a schema imports elements from different namespaces, a mapping places the namespace declarations in the child nodes of the output. See the following example.

          AB12     2              XY34                   Test                   Priority      

    To move these to the root node, follow these steps:

    1. Select the root node under the "Input" tab of the activity

    2. Click the "Edit Statement" button (!)

    3. Select the option "Exclude result prefixes"

    ActiveMatrix BusinessWorks does not output the prefixes that are used in the stylesheet but not used in the resulting XML. When processing a node, ActiveMatrix BusinessWorks outputs only the necessary prefixes of the node and, therefore, the prefixes needed by child nodes have to be declared multiple times (see ProductID and ProductDescription in the above sample XML). When you check "Exclude result prefixes" but set its value to an empty string, ActiveMatrix BusinessWorks starts outputting the prefixes. More prefixes appear in the output XML but only in the root node. Then, when ActiveMatrix BusinessWorks processes the child nodes it no longer needs to write the prefixes.

    The process defined in the folder Case1 in the attached project covers this scenario. After following the above steps, run the process and you should see the following output:

          AB12     2     XY34     Test     Priority 

    Please note that this is applicable to mapping in any activity.

    Stopping automatic namespace prefix generation in Render XML

    When using Render XML activity, BW defines a namespace prefix and uses it in the output XML string. You can select the option"Format using default namespace prefix" under the "Configuration" tab for the activity to prevent this.

    Run the process definition in folder Case2. The output should be:

          test     123 

    After selecting the option "Format using default namespace prefix", the output will be:

          test     123 

    Removing namespaces and namespace prefixes

    If you want to remove all namespaces and prefixes in an XML instance, you can use a Transform XML activity with the following stylesheet:

       

    The process definition in folder Case 3 demonstrates this. Run the process definition and compare the output of Render XML activity and Transform XML activity.

    Specifying the namespace prefix to be used

    You can specify the prefix to be used for a particular namespace the following way:

    1. Select the process definition and click "Namespace Registry" under the "Configuration" tab

    2. Specify the desired prefix for the namespace

    3. Select the activity in the process definition

    4. Select the root node under the "Input" tab of the activity

    5. Click the "Edit Statement" button (!)

    6. Select the option "Exclude result prefixes"

    In the process definition under folder Case4, the prefix ?test? is used for the namespace ?http://example.com/ord.xsd?.

    Please note that this is applicable to mapping in any activity.

    Information to be sent to TIBCO Support

    For any related issues, please open a Support Request (SR) with TIBCO Support and upload the following:

    • Simplified ActiveMatrix BusinessWorks project with all necessary files.

    namespace.zip


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...