Author: jbeard
Date: Tue Jun 29 19:46:29 2010
New Revision: 959083

URL: http://svn.apache.org/viewvc?rev=959083&view=rev
Log:
Did some work to get stuff owrking in Opera. Problem seems to be that 
non-string params were being set as parameters in the xslt processor. This now 
appears to be fixed, and the ad-hoc testing I have perfomred indicates that 
Opera is now working. I'm now trying to get Opera 10.54 to work with Selenium.

Added:
    commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/
    
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.html
   (with props)
    
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.xml
   (with props)
    
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.xsl
   (with props)
Modified:
    
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/javascript/scxml/cgf/Transformer.js

Modified: 
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/javascript/scxml/cgf/Transformer.js
URL: 
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/javascript/scxml/cgf/Transformer.js?rev=959083&r1=959082&r2=959083&view=diff
==============================================================================
--- 
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/javascript/scxml/cgf/Transformer.js
 (original)
+++ 
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/src/javascript/scxml/cgf/Transformer.js
 Tue Jun 29 19:46:29 2010
@@ -147,7 +147,8 @@ function(xmlUtil){
                                        //set parameters
                                        processors.forEach(function(p){
                                                for(paramName in params){
-                                                        
p.setParameter(null,paramName,params[paramName]);
+                                                        var paramValue = 
params[paramName];
+                                                        if (typeof paramValue 
== "string") p.setParameter(null,paramName,paramValue);
                                                }
                                        });
 

Added: 
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.html
URL: 
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.html?rev=959083&view=auto
==============================================================================
--- 
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.html
 (added)
+++ 
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.html
 Tue Jun 29 19:46:29 2010
@@ -0,0 +1,35 @@
+<html>
+       <head>
+               <script type="text/javascript" 
src="../../../lib/js/requirejs/require.js"></script>
+               <script type="text/javascript" 
src="../../../lib/js/requirejs/require/xml.js"></script>
+               <script type="text/javascript">
+                       var resultText;
+
+                       require(
+                               {
+                                       "baseUrl":"/test/xslt/xslt_js/"
+                               },
+                               [ "xml!test.xml","xml!test.xsl"],
+                               function(xml,xsl){
+                                       var processor = new XSLTProcessor();  
+                                       processor.importStylesheet(xsl); 
+
+                                       
processor.setParameter(null,"second_word","World");
+                                       //Opera doesn't like this, and will 
throw an error. should only pass in strings as values
+                                       
//processor.setParameter(null,"weird-thing",{});
+
+                                       docToTransform = 
processor.transformToDocument(xml);
+
+                                       serializer = new XMLSerializer();
+                                       serializedResultDoc = 
serializer.serializeToString(docToTransform)
+
+                                       serializer
+
+                                       alert(serializedResultDoc); 
+                               }
+                       )
+               </script>
+       </head>
+       <body>
+       </body>
+</html>

Propchange: 
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.xml
URL: 
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.xml?rev=959083&view=auto
==============================================================================
--- 
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.xml
 (added)
+++ 
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.xml
 Tue Jun 29 19:46:29 2010
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<test>
+       <bar bat="Hello"/>
+</test>

Propchange: 
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.xsl
URL: 
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.xsl?rev=959083&view=auto
==============================================================================
--- 
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.xsl
 (added)
+++ 
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.xsl
 Tue Jun 29 19:46:29 2010
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"; 
+       xmlns:s="http://www.w3.org/2005/07/scxml";
+       xmlns:c="http://commons.apache.org/scxml-js";
+       version="1.0">
+       <output method="text"/>
+
+       <param name="second_word"/>
+
+       <template match="/test">
+               <value-of select="bar/@bat"/> <value-of select="$second_word"/>!
+       </template>
+
+</stylesheet>
+

Propchange: 
commons/sandbox/gsoc/2010/scxml-js/branches/SCXML-141-148/test/xslt/xslt_js/test.xsl
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to