Solved

Max length of string with addParameter?

Posted on 2004-04-28
4
856 Views
Last Modified: 2007-12-19
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
Comment
Question by:equentin
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
dfiala13 earned 125 total points
ID: 10941369
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
 
LVL 10

Expert Comment

by:Yury_Delendik
ID: 10944194
or ....
proc.addParameter "menuID", Append.selectNodes("*")
....
proc.addParameter "pageData", loadData.selectNodes("*")
0
 

Author Comment

by:equentin
ID: 10946991
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
 
LVL 10

Expert Comment

by:Yury_Delendik
ID: 10949879
"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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now