?
Solved

Max length of string with addParameter?

Posted on 2004-04-28
4
Medium Priority
?
904 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

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!

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

743 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