Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6930981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:31:05+00:00 2026-05-27T11:31:05+00:00

I have a complex XML document that the informatica XML parser struggles with normalizing,

  • 0

I have a complex XML document that the informatica XML parser struggles with “normalizing”, how can I run a XML transformation such as XSLT to simplfy it prior to sending it into the XML parser.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:31:05+00:00Added an answer on May 27, 2026 at 11:31 am

    One way of doing this is to use the standard Java transform and use the standard javax.xml.transform API to perform the transformation.

    To do this add a Java Transform to your flow

    enter image description here

    In the Import Packages pane, import the required java packages

    enter image description here

    import java.io.*;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.*;
    

    In the Helper Code pane we construct a transformer object. As I understand non static fields are created per instance, so there should be no concurrency issues. (comments?)

    enter image description here

    private final Transformer transformer = getNewTransformer();
    
    public Transformer getNewTransformer()
    { 
      // /opt/informatica/infadev/DataTransformation
      final String IFCMPath = System.getenv("IFCONTENTMASTER_HOME"); 
      final String xslt = IFCMPath + "/ServiceDB/xst/mytransform.xslt";
      logInfo("Using XSLT File" + xslt);
      try{
       return TransformerFactory.newInstance().newTransformer(new StreamSource(xslt));
      } catch(TransformerConfigurationException ex) {
        logError("Could not create TransformerFactory with xslt " + xslt );
    
      }
      return null;
    }
    

    Finally we execute the transform on the incoming xml document by executing the transform method on the transformer object.

    enter image description here

    if( transformer == null ) {
        failSession("Transformer was null");
    }
    
    //final long startTime = System.nanoTime();
    //final long endTime;
    
    try {
        //logInfo("Recieved xml with size " + xmlin.length() );
        // logInfo("Recieved xml " + xmlin );
        final StringReader reader = new StringReader(xmlin);
        final StringWriter writer = new StringWriter();
    
        transformer.transform(new StreamSource(reader),new StreamResult(writer));
        xmlout = writer.toString();
       // logInfo("xmlout  " + xmlout  );
    } catch (Exception e) {
         incrementErrorCount(1);
         logError(e.getMessage());
         logError(xmlin);
    } 
    
    //finally { 
    //  endTime = System.nanoTime(); 
    //} 
    
    //final long duration = endTime - startTime; 
    //logInfo("Duration  " + duration / 1000000000.0 );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a number rather large, complex xml documents that I need to loop
I have a 'complex item' that is in XML, Then a 'workitem' (in xml)
I have a complex XML document. I have used the iText library to create
I have a complex graph of XML-serializable classes that I'm able to (de)serialize to
I have a reasonably complex XML document which I want to flatten down to
I have a dataset that I read in from a complex xml structure.... here
I'm trying to build a rather complex XML document. I have a bunch of
I have a very complex task - create a software that imports XMl files
I have a rather complex XML document <ItemSearchResponse xmlns=-------> <OperationRequest> <HTTPHeaders> </HTTPHeaders> <RequestId>0S57WGDPNC7T8HNBV76K</RequestId> <Arguments>
I have some XML that looks something like this: <Root> <Documents> <Document id=1/> </Documents>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.