IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  removing namespace when copying from another document

    Posted 08/31/04 12:28 PM

    I have two xml documents, the one is a service request and the other a query response. (This is done in Mediator with multi part message). I want to copy the result of the query into the service request document, this works fine except that the namespaces are copied as wel and I don’t want them.

    Here is my transformation, at the moment the second document is a file.

    <xsl:stylesheet xmlns:xsl=“XSLT Namespace” version=“1.0”>
    <xsl:output method=“xml” indent=“yes” encoding=“UTF-8” media-type=“text/xml”/>
    <xsl:param name=“BD.path”/>
    <xsl:template match=“/” >

    <xsl:copy-of select=“Service”/>
    <Result
    xmlns:xql=“XQL FAQ (XML Query Language - Frequently Asked Questions)
    xmlns:ino=“http://namespaces.softwareag.com/tamino/response2
    xmlns:xq=“http://namespaces.softwareag.com/tamino/XQuery/result
    xsl:exclude-result-prefixes=“ino xql xq”>
    <xsl:copy select=“document(‘C:\Development\BD\QueryTst.xml’)/ino:response/xq:result/*”/>


    </xsl:template>
    </xsl:stylesheet>


    #webMethods
    #Tamino
    #API-Management


  • 2.  RE: removing namespace when copying from another document

    Posted 09/01/04 05:11 PM

    Hi,

    I guess your second xsl:copy must also be a xsl:copy-of since
    xsl:copy does not allow for a select attribute.
    Anyway, to get rid of the namespaces use xsl:apply-templates
    instead of copying to run the nodes taken from the query output
    through a namespace-reducing transformation as follows:

    <xsl:template match=““>
    <xsl:element name=”{local-name()}“>
    <xsl:for-each select=”@
    ”>
    <xsl:attribute name=“{local-name()}”>
    <xsl:value-of select=“.”/>
    </xsl:attribute>
    </xsl:for-each>
    xsl:apply-templates/
    </xsl:element>
    </xsl:template>

    If your stylesheet includes other transformations besides
    those pertaining to xquery output, use modes.

    Regards,
    Juliane


    #webMethods
    #Tamino
    #API-Management


  • 3.  RE: removing namespace when copying from another document

    Posted 09/02/04 12:09 PM

    Thanks Juliane, that was exactly what I needed.


    #API-Management
    #Tamino
    #webMethods