Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Mar 2005
    Posts
    735
    Thanks
    4
    Thanked 1 Time in 1 Post

    php dhtml vbscript problem

    I have a page of vbscript included by "include file" in a php.
    Line 443 shows error:

    Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\search\cat\cdynlistbox.php on line 443
    Line 443 is:
    Code:
    sTemp = sTemp & "<xsl:stylesheet xmlns:xsl=""http://www.w3.org/TR/WD-xsl"">" & vbCrlf
    Code:
    <script language="VBScript" runat="server">
    ...
    
    	Private Function GetXSLStream()
    		Dim sTemp
    		sTemp = "<?xml version='1.0'?>" & vbCrlf
    		sTemp = sTemp & "<xsl:stylesheet xmlns:xsl=""http://www.w3.org/TR/WD-xsl"">" & vbCrlf
    		sTemp = sTemp & "<xsl:template match=""/"">" & vbCrlf
    		sTemp = sTemp & "if (!assocArray) var assocArray = new Object();<xsl:for-each select=""root/table1"">" & vbCrlf
    		sTemp = sTemp & "assocArray[""%listname%=<xsl:value-of select=""@search"" />""] = new Array(" & vbCrlf
    		sTemp = sTemp & "<xsl:for-each select=""table2"">" & vbCrlf
    		sTemp = sTemp & "<xsl:value-of select=""table2"" />    ""<xsl:value-of select=""@dvalue"" />"",""<xsl:value-of select=""@display"" />""," & vbCrlf
    		sTemp = sTemp & "</xsl:for-each>    ""EOF"");</xsl:for-each>" & vbCrlf
    		sTemp = sTemp & "</xsl:template>" & vbCrlf
    		sTemp = sTemp & "</xsl:stylesheet>" & vbCrlf
    		GetXSLStream = sTemp
    	End Function
    
    ...
    </script>
    If you want the full script then check out the attached file zipped and in a txt file.
    Attached Files Attached Files

  • #2
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    <?xml version='1.0'?> is probably causing the problem, the <? and ?> open and close php code. I would recommend turning short_open_tag off in your php.ini

  • #3
    Regular Coder
    Join Date
    Mar 2005
    Posts
    735
    Thanks
    4
    Thanked 1 Time in 1 Post
    Oh Ok thanks.
    sTemp = "<" & "?xml version='1.0'?>" & vbCrlf
    I split it with " & ". And it worked.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •