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.  Unexpected path behaviour using "document()"

    Posted 12/17/04 12:20 PM

    Hi all,

    I’m using XSLT to merge two XML files. I specify the external XML file containing data with a “document” function:

    <xsl:variable name=“instances” select=“document(‘Instances-Data.xml’)”/>

    This document has the following structure:


    12
    10




    If I want to retrieve the value of “hasOleicAcid”, I would write this:

    <xsl:value-of test=‘$instances/Instances/Anchovies/hasOleicAcid’>

    But it doesn’t work. Instead, I have to write:

    <xsl:if test=‘$instances//[name(.)=“Anchovies”]/[name(.)=“hasOleicAcid”]’>

    Does anybody know why? Am I forced to perform a square brackets check every time I use an external XML file?

    Thank you very much


    #API-Management
    #Tamino
    #webMethods


  • 2.  RE: Unexpected path behaviour using "document()"

    Posted 12/17/04 03:37 PM

    I tried cutting and pasting your xsl:value-of element into a test stylesheet. When I tried running it with Saxon, it pointed out that the correct attribute for xsl:value-of is “select”, not “test”, and that the element needed a closing tag. Once I fixed those problems, it worked just fine.

    If you just made a mistake when you transcribed the element into your post, and these errors did not exist in your original stylesheet, then you might have a bug in your XSLT processor.


    #webMethods
    #API-Management
    #Tamino


  • 3.  RE: Unexpected path behaviour using "document()"

    Posted 12/17/04 05:11 PM

    Yes, I made a mistake when writing the post. I meant <xsl:value-of select… /> in both cases.

    Anyway maybe it’s a problem with my XSLT processor. I’m currently using msxsl 3.0 I’ll try using Saxon


    #Tamino
    #webMethods
    #API-Management