Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 19th, 2008, 02:36 PM
Authorized User
Join Date: Mar 2008
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old March 19th, 2008, 03:08 PM
Authorized User
Join Date: Mar 2008
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts

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

Reply With Quote
  #3 (permalink)  
Old March 20th, 2008, 08:53 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
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)
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 03:54 AM.

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