Itachi Uchiha
Itachi Uchiha

Reputation: 13

I want to read a file which is in datapower through api gateway v10

I'm using url-open() function but I'm getting an empty response.

Upvotes: 0

Views: 626

Answers (1)

Matt
Matt

Reputation: 41

Something like this should work. You don't need to do urlopen if you are running the code from the same appliance.

<!-- Load config file -->
<xsl:variable name="configFile" select="document('local:///myfolder/servers.xml')" />

<!-- Look in the XML file to find your server -->
<xsl:variable name="myURL">
            <xsl:copy-of select="$configFile/config/Servers/Server[@name='prod']/url" />
</xsl:variable>
<?xml version="1.0" encoding="utf-8"?>
<config>
    <Servers>
        <Server name="prod">
            <url>www.google.com</url>
        </Server>
        <Server name="dev">
            <url>www.yahoo.com</url>
        </Server>
    </Servers>  
</config>

Upvotes: 0

Related Questions