Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6064193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:15:13+00:00 2026-05-23T09:15:13+00:00

I’m creating reporting from a SharePoint 2007 system via the provided WebServices on the

  • 0

I’m creating reporting from a SharePoint 2007 system via the provided WebServices on the client-side (this is all due to developer restrictions – I know, if I had permission, this entire exercise would be perfectly simple in SharePoint designer).

Currently I have a working report. In JavaScript I pass in three parameters (a “From” date, “To” date and “Business Category”) which are used to generate a CAML query to web service. The XML response is returned and (after some formatting clean-up) an XSLT is imported (external file) and applied directly to it and the result is pumped into a DIV on the page. All works well.

At this point however I’d like to actually display the input parameters (dates and category) on the report. I have at least a few two kludgy options to do this:

1) Output the values outside of the display DIV. This will work but isn’t very versitile.

2) Ouput place-holders for the values in the XSL and then run through a series of replacements before display. This just feels… odd.

3) Manually add nodes with the desired values to the XML packet before transformation then access them normally in the XSLT. This seems the cleanest to me… but also has some baggage I’m not sure I like.

Is there a “right” way to do this? Any chance one of those is it?

Here’s some (abbreviated) code to illustrate:

    // Set the URL of the XSL to apply
reportXSLURL = "BusinessCategoryReport.xsl";


    // Set the input variables.
var CurCategory = DP_QueryString.get("ForCategory", "first");
var CurFrom = DP_QueryString.get("ForFrom", "first");
var CurTo = DP_QueryString.get("ForTo", "first");


* * Soap Call Censored (Too Hot for the Internet) * * 

    // Load the data
function ProcessResponse(ResponseText) {

        // Create and load the serviceXML
    var serviceXML = new DP_XML();
    serviceXML.parse(ResponseText);

        // Create and Load the XSL
    var reportXSL = new DP_XML();
    reportXSL.load(reportXSLURL);

        // Clean Up
    CleanSharePointColumn(serviceXML.Doc, "ows_Duration", "CalculatedField");
    CleanSharePointColumn(serviceXML.Doc, "ows_Incident_x0020_Manager_x0028_s_x", "UserList");
    CleanSharePointColumn(serviceXML.Doc, "ows_Application_x0020__x0028_EAI_x00", "LookupList");
    CleanSharePointColumn(serviceXML.Doc, "ows_Business_x0020_Category", "LookupList");
    CleanSharePointColumn(serviceXML.Doc, "ows_Incident_x0020_Start", "DateTime_Min");
    CleanSharePointColumn(serviceXML.Doc, "ows_Incident_x0020_End", "DateTime_Min");

        // Present the Results
    document.getElementById("DataDisplay").innerHTML = serviceXML.Doc.transformNode(reportXSL.Doc);

};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:15:13+00:00Added an answer on May 23, 2026 at 9:15 am

    You can pass parameters to an XSLT in javascript, just put

    <xsl:param name="myparam" />

    in the root of your stylesheet. Look into the setParameter method on the XSLTProcessor object in javascript. Here’s a javascript method I use:

    function transform(inputXml, xslt) {
        var xsltProcessor;
        var toReturn;
    
        if (window.XSLTProcessor) {
            xsltProcessor = new XSLTProcessor();
            xsltProcessor.importStylesheet(xslt);
            if (arguments.length > 2 && arguments.length % 2 == 0) {
                for (var i = 0; i < Math.floor((arguments.length)/2)-1; i++) {
                    xsltProcessor.setParameter(null, arguments[2*i+2],arguments[2*i+3]);
                }
            }
            toReturn = xsltProcessor.transformToDocument(inputXml);
        }
        else if (window.ActiveXObject) {
            toReturn = makeDocFromString(inputXml.transformNode(xslt));
        }
        else {
            toReturn = "Unable to transform";
        }
        return toReturn;
    }
    

    Any parameters beyond the first two are treated as name/value pairs to be passed to the xslt as a parameter. inputXml and xslt are both XML Documents.

    EDIT: Just noticed, I forgot to mention this function uses a helper method, ‘makeDocFromString’, that just takes the source of an XML document as a string input, and returns an actual XML document. That function’s define elsewhere in that .js, it’s not part of the standard libraries.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I am currently running into a problem where an element is coming back from
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.