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.  get parent information

    Posted 10/18/04 05:15 PM

    Hi,

    I am starting in XSLT and I struggle against converting imbricated data into a flat model (that is not really XML compliant).

    here is an extract of the XML source:







    Here is what I need to get:

    category1category2


    name of resource


    http://www.test.com


    I do not understand how to get the categories.

    Thanks a lot for all your suggestions.

    Maxime


    #Tamino
    #API-Management
    #webMethods


  • 2.  RE: get parent information

    Posted 10/18/04 10:22 PM

    This comes close to what you want:

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    
    <xsl:template match="/">
    <path><xsl:apply-templates select="outline"/></path>
    <xsl:apply-templates select="//outline[@title]" mode="res"/>
    </xsl:template>
    
    <xsl:template match="outline[@type]">
    <d></d><xsl:value-of select="@type"/>
    <xsl:apply-templates/>
    </xsl:template>
    
    <xsl:template match="outline"/>
    
    <xsl:template match="outline" mode="res">
    <name><xsl:value-of select="@title"/></name>
    <URL><xsl:value-of select="@URL"/></URL>
    </xsl:template>
    
    </xsl:stylesheet>

    #API-Management
    #webMethods
    #Tamino


  • 3.  RE: get parent information

    Posted 10/20/04 07:23 PM

    Hi

    assume your document looks as follows (just wrapped with ):


    category1category2
    name of resource
    http://www.test.com


    The result when using the following stylesheet

    <xsl:stylesheet xmlns:xsl=“XSLT Namespace” version=“1.0”>
    <xsl:template match=“/root”>
    <xsl:apply-templates select=“path/text()”/>
    </xsl:template>
    <xsl:template match=“text()”>
    text(): <xsl:value-of select=“position()”/>. “<xsl:value-of select=”.“/>”
    </xsl:template>
    </xsl:stylesheet>

    is

    text(): 1. “category1”

    text(): 2. “category2”

    Cheers
    Uli


    #Tamino
    #webMethods
    #API-Management