Solved

Max length of string with addParameter?

Posted on 2004-04-28
4
877 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Trouble parsing soap xml result 3 51
XML to Excel using XSL - formatting 3 33
read an xml file in perl 2 32
Powershell XML in variable 4 21
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 …
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 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