Distinct Values Function Not Working
Hi All,
I am trying to find distinct values coming as input so i tried to use the function distinct-Values in my code . the usage is s follows .
I get input as follows
<Input>1</input>
<Input>2</input>
<Input>2</input>
<Input>3</input>
<Input>1</input>
<Input>4</input>
<Input>3</input>
<Input>5</input>
<Input>2</input>
<Input>1</input>
<Input>5</input>
<Input>1</input>
and i need oto convert as
<result>1</result>
<result>2</result>
<result>3</result>
<result>4</result>
<result>5</result>
<?xml version="1.0" encoding="UTF-8" ?>
<?oracle-xsl-mapper <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
<mapSources>
<source type="XSD">
<schema location="DistinctTest.xsd"/>
<rootElement name="DistinctTestProcessRequest" namespace="http://xmlns.oracle.com/DistinctTest"/>
</source>
</mapSources>
<mapTargets>
<target type="XSD">
<schema location="DistinctTest.xsd"/>
<rootElement name="DistinctTestProcessResponse" namespace="http://xmlns.oracle.com/DistinctTest"/>
</target>
</mapTargets>
<!-- GENERATED BY ORACLE XSL MAPPER 10.1.3.4.0(build 080718.0645) AT [TUE DEC 11 08:01:25 GMT 2012]. -->
?>
<xsl:stylesheet version="2.0"
xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
xmlns:ns0="http://www.w3.org/2001/XMLSchema"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
xmlns:ns1="http://xmlns.oracle.com/DistinctTest"
exclude-result-prefixes="xsl ns0 ns1 xref xp20 bpws ora ehdr orcl ids hwf">
<xsl:template match="/">
<xsl:for-each select="fn:distinct-values(/ns1:DistinctTestProcessRequest/ns1:input))">
<xsl:variable name="boxNo" select="."/>
<ns1:DistinctTestProcessResponse>
<ns1:result>
<xsl:value-of select="$boxNo"/>
</ns1:result>
</ns1:DistinctTestProcessResponse>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
I m using Jdeveloper 10.1.3.4 and i am getting the following error why i try to test the same ...
<part name="summary">
<summary>
XPath expression failed to execute.
Error while processing xpath expression, the expression is "ora:processXSLT('Transformation_1.xsl',bpws:getVariableData('inputVariable','payload'))", the reason is FOTY0001: type error.
Please verify the xpath query.
</summary>
I know the above error doesnt give much update but i am unsure whether the function is applicable in 10.1.3.5 version . any help will be greatly appreciated
Thanks
Sathish
Edited by: Sathish KS on Dec 11, 2012 5:58 AM