DataPower

DataPower

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Extract complete xml with tag and values using xslt

  • 1.  Extract complete xml with tag and values using xslt

    Posted 09/12/21 08:16 PM

    Dears,

    I tried to extract xml from below.

    but when we traverse it is only giving me values without tag using xslt.

    Input:

    <Message>

    <Test1>

    <ComponentID>4130</ComponentID>

    <ProductId>281119747809265858</ProductId>

    </Test1>

    <ProductTypeId>713119747765799789</ProductTypeId>

    <Name>Financial loan</Name>

    <ProductStructureType>100001</ProductStructureType>

    <ProductStructureValue>Structure 01</ProductStructureValue>

    <ProductLastUpdateDate>2007-12-12 11:48:12.658</ProductLastUpdateDate>

    </Message>

    Expected Output:

    <Test1>

    <ComponentID>4130</ComponentID>

    <ProductId>281119747809265858</ProductId>

    </Test1>

    But after traverse we are getting only below value no complete tag:

    4130

    281119747809265858

    Please suggest xslt

    thankyou



    #DataPower
    #Support
    #SupportMigration


  • 2.  RE: Extract complete xml with tag and values using xslt
    Best Answer

    Posted 09/12/21 10:52 PM

    Minor changes in output:

    we just want below non well formed:

    <ComponentID>4130</ComponentID>

    <ProductId>281119747809265858</ProductId>

    how can we get this in output, stylesheet is failing because of no root tag.

    any suggestion, but our destination system need the data like this only



    #DataPower
    #Support
    #SupportMigration


  • 3.  RE: Extract complete xml with tag and values using xslt
    Best Answer

    Posted 09/12/21 11:32 PM

    am able to get the output now



    #DataPower
    #Support
    #SupportMigration