Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 19th, 2008, 02:36 PM
Authorized User
Join Date: Mar 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default XML XSLT AJAX and Database Advice Pls

Question 1: I need to get info from a database... I would like this information in XML so I can process it with XSLT and use that in the browser. The current plan is to use a server side scripting language (PHP) to generate the XML file. My question is, is there an easier way to do this? Do SQL servers have modules/methods to go directly to XML output... (not really XSLT question, but this next one is..)

Question 2: I would like to keep the SQL queries as simple as possible and add the processing of the database results to XSLT files... (for the sorting / filtering through XPATH) ... my question is, how can I pass parameters from my AJAX load script directly to the XSLT file? Would I again need to generate the XSLT file through server side script?


goal: loadandtranslate("file.xml","file2.xsl?sort=artist ");
expected: loadandtranslate("file.xml","file2.php?sort=artist ");

or do you think it would just be most efficient to generate the XML file instead of the XSLT file?


loadandtranslate("file.php?filterby=someconstraint ","file2.xsl");

any advice is appreciated

Old March 19th, 2008, 03:08 PM
Authorized User
Join Date: Mar 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts

I have done did found the answer to #2... XSLTProcessor.setParameter()

Old March 20th, 2008, 08:53 AM
joefawcett's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

The main databases have such as SQL Server and Oracle have methods for returning XML directly from queries. Otherwise you can create your own by looping through the returned records and building an in memory DOM or using string manipulation depending on the complexity and re-usability you find and need. There's coverage of this in Beginning XML, 4th edition.


Joe (Microsoft MVP - XML)

Similar Threads
Thread Thread Starter Forum Replies Last Post
pls give the query for XML data in Sqlserver2005 veeruu SQL Server 2005 0 July 27th, 2006 05:07 AM
Database connectivity - pls help nmmure Crystal Reports 6 June 13th, 2006 01:15 PM
Using Ajax with XSLT rajshekhar XSLT 0 May 3rd, 2006 12:35 PM
DataGrid cant rebind... pls help o any advice life_s Ng General .NET 3 August 30th, 2004 07:32 AM
Database advice skipinator Access ASP 1 July 5th, 2003 08:39 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.