Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Max length of string with addParameter?

Posted on 2004-04-28
4
Medium Priority
?
909 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
dfiala13 earned 250 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
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. 
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

636 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