• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 912
  • Last Modified:

Max length of string with addParameter?

hi ...

we have an ASP page (VB) generating an XML data string which is loaded into an XSL template using

    proc.addParameter "pageData", loadData.documentElement

however i am pretty new to all this and am attempting to work with someone else's code to amend some pages.

the problem is that when the XML string is too long (or appears to be) i get a "msxml3.dll error '80020005' - Type mismatch" error at the above line of code.

is there a maximum length of string that can be used? if there is a limit is there another way round this?

the full code that is being used is:

Set Append = Server.CreateObject("Msxml2.DOMDocument.3.0")

      Append.loadXML(xmlMenuID)
      xmlDoc.async = false
      xslDoc.async = false
      xmlDoc.load(server.mapPath(xmlPage))
      xslDoc.load(server.mapPath(xslPage))
      
      Set template = Server.CreateObject("MSXML2.XSLTemplate")
            Set template.stylesheet = xslDoc
                  Set proc = template.createProcessor
                        proc.input = xmlDoc
                        proc.output = Response
                  
                        proc.addParameter "pageID", pageID
                        proc.addParameter "companyID", companyID
                        proc.addParameter "menuID", Append.documentElement
                                          
                        If pageData <> "" Then
                              proc.addParameter "pageData", loadData.documentElement
                        End If

                        proc.transform()

please bear in mind that i am an ASP developer and have only 3 days experience of XML / XSL and am floundering quickly!!

many thanks!
0
equentin
Asked:
equentin
  • 2
1 Solution
 
dfiala13Commented:
You are not adding text, you are adding XmlElement objects, and you are adding the entire document.  Are you sure you want do this.  If you are just send the text...

Try this...

             
                    proc.addParameter "pageID", pageID
                    proc.addParameter "companyID", companyID
                    proc.addParameter "menuID", Append.documentElement.Text
                                   
                    If pageData <> "" Then
                         proc.addParameter "pageData", loadData.documentElement.Text
                    End If

                 
0
 
Yury_DelendikCommented:
or ....
proc.addParameter "menuID", Append.selectNodes("*")
....
proc.addParameter "pageData", loadData.selectNodes("*")
0
 
equentinAuthor Commented:
to be honest, i'm not sure what i want to do ... the "text" that is being passed is in data set format, ie:

"<root><data><compSearch><pk_CompanyID>36</pk_CompanyID><CompanyName>Avdef (Aviation Defense Service)</CompanyName><Country>France</Country></compSearch><prodSearch><CompanyID>36</CompanyID><Products>Chaff corridor and break lock | COMMunications jamming and spoofing | doctrine and tactics</Products></prodSearch</data></root>"

i have tried both of the above solutions but in the XSL page nothing is showing. obviously i don't know how to retreive the data in the format you are suggesting. currently i am using the following method:

  <xsl:for-each select="msxsl:node-set($pageData)//compSearch/." >
            <tr>
            <td><A><xsl:attribute name="href">companies.asp?pageID=<xsl:text/><xsl:value-of select="$pageID"/>&amp;menuID=<xsl:value-of select="msxsl:node-set($menuID)/menuitemID[last()]"/>&amp;type=7&amp;companyID=<xsl:value-of select="pk_CompanyID"/></xsl:attribute><strong><xsl:value-of select="./CompanyName" />, <xsl:value-of select="./Country" /></strong></A></td>
            </tr>      
            <tr>
            <xsl:variable name = "coid" select = "./pk_CompanyID" />
            <td>
            <xsl:for-each select="msxsl:node-set($pageData)//prodSearch/." >
                  <xsl:if test="./CompanyID = $coid">
                        <xsl:value-of select="./Products" />
                  </xsl:if>
            </xsl:for-each>
            </td>
            </tr>                  
  </xsl:for-each>

any thoughts?

if this is fast becoming a bigger problem than i originally anticipated then i will gladly increase the points :)

ta muchly,

0
 
Yury_DelendikCommented:
"msxsl:node-set($menuID)/..." can be used as "$menuID/..."
"msxsl:node-set($pageData)/..." as "$pageData/" if you are using
proc.addParameter "pageData", loadData.selectNodes("*")
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now