Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

XSL Transform UCCX

Hi

Is there any way to do an XSL Transform on a XML document with some param's rather than creating an internal XML document which the XSL doc then transforms?

What i am trying to achive is to have a single XML document which is used to control the call center and depending on the call it will extract specific info for that call (open closed states as well as routing numbers)

<?xml version="1.0" encoding="ISO-8859-1" ?>

<CC>

<SITE SITEID="NY">

<ANNOUCEMENT>true</ANNOUCEMENT>

<SALESOPEN>true</SALESOPEN>

<SUPPORTOPEN>true</SUPPORTOPEN>

<VARSALESVM>12345</VARSALESVM>

<VARSALESOP>12345</VARSALESOP>

<VARSUPPORTVM>12345</VARSUPPORTVM>

<VARSUPPORTOP>12345</VARSUPPORTOP>

</SITE>

<SITE SITEID="BA">

<ANNOUCEMENT>true</ANNOUCEMENT>

<SALESOPEN>fase</SALESOPEN>

<SUPPORTOPEN>fase</SUPPORTOPEN>

<VARSALESVM>12345</VARSALESVM>

<VARSALESOP>12345</VARSALESOP>

<VARSUPPORTVM>12345</VARSUPPORTVM>

<VARSUPPORTOP>12345</VARSUPPORTOP>

</SITE>

</CC>

What i want to be able to do is update the open closed states from an admin menu for a specific site - i have created an xsl style sheet that peforms the updates using parameters

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" indent="yes"/>

<xsl:strip-space elements="*"/>

<xsl:param name="PARAM_SITE"/>

<xsl:param name="PARAM_ANNOUCEMENT"/>

<xsl:param name="PARAM_SALES"/>

<xsl:param name="PARAM_SUPPORT"/>

<xsl:template match="/CC">

<CC>

<xsl:apply-templates select="SITE"/>

</CC>

</xsl:template>

<xsl:template match="SITE">

<xsl:choose>

<xsl:when test="@SITEID=$PARAM_SITE">

<SITE>

<xsl:attribute name="SITEID">

<xsl:value-of select="$PARAM_SITE"/>

</xsl:attribute>

<ANNVAR>

<xsl:value-of select="$PARAM_ANA"/>

</ANNVAR>

<SALESVAR>

<xsl:value-of select="$PARAM_SALES"/>

</SALESVAR>

<SUPPORTVAR>

<xsl:value-of select="$PARAM_SUPPORT"/>

</SUPPORTVAR>

<xsl:copy-of select="VARSALESVM"/>

<xsl:copy-of select="VARSALESOP"/>

<xsl:copy-of select="VARSUPPORTVM"/>

<xsl:copy-of select="VARSUPPORTOP"/>

</SITE>

</xsl:when>

<xsl:otherwise>

<xsl:copy>

<xsl:copy-of select="@*|node()"/>

</xsl:copy>

</xsl:otherwise>

</xsl:choose>

</xsl:template>

</xsl:stylesheet>

But I have not been able to work out how to call it - I have the UCCX premium so I can use java if needed but would prefer not to if possible

Or is there a way to use the Apache Xerces XSL Processor from CRS?

Cheers

6 REPLIES

Re: XSL Transform UCCX

Did you ever figure out a solution?

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
New Member

Re: XSL Transform UCCX

i havent had time to look into it any further - i just came up with a work around to use multiple XML files and rewrite the whole file including the static fields... I think it is possible with some java code or class i just havent got around to it

New Member

Re: XSL Transform UCCX

Have made some progress From looking at the jar files i worked out that i could do this

openclosed.xml



    
          true
          true
          true
          12345
          12345
          12345
          12345
    

    
          true
          fase
          fase
          12345
          12345
          12345
          12345
    

openclosed.xsl


http://www.w3.org/1999/XSL/Transform">
    
    
    
    
    
    
    
    

Go to Program Files\wfavvid\lib and run

java -jar xalan.jar -IN openclosed.xml -XSL openclosed.xsl -PARAM PARAM_SITE NY -PARAM PARAM_ANNOUCEMENT false -PARAM PARAM_SALES false -PARAM PARAM_SUPPORT false -OUT out.xml

out.xml




false
false
false
12345
12345
12345
12345


true
fase
fase
12345
12345
12345
12345

New Member

XSL Transform UCCX

Did you ever get this to work with 8.x? Since you mentioned doing it with JAR, I assuming you are using an external java class/jar? I am attempting to do something similar, but am not having any luck with the XSL transform step.

New Member

XSL Transform UCCX

Dennis, I got it sort of working but there was a limitation that i hit where you could not use parameters with the XSL transform step so i had to use a dedicated transform step for each combination which was far from ideal. I did start to write an exernal class for it and it did work but i didnt end up using it

New Member

XSL Transform UCCX

I ended up using the 3rd party xalan.jar (apache) jar. I uploaded it as a 3rd party jar file. I wrote a uccx script that sets up and performs the transformation with java objects. That script it setup as a subflow, so it is taking the XMLFile, XSLTFile, uploadString, and Parameter-Values as a 2x2 array.

The array is passed in and cycled through, and it is passed as an entire array.

928
Views
0
Helpful
6
Replies