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 August 30th, 2006, 05:06 AM
Registered User
 
Join Date: Aug 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamic XML Scripts

Hi,

I'm in a bit of a pickle to say the least.
I've come up with an idea which I'd like to implement, but haven't a clue how to go about doing such a thing.

Basically what I want to do is have an XML script, but certain parts of the script will need to be mapped to a Database field.

So here's a sample of my XML File.

Code:
<script>
    <question>
        <name>
            Dear #FirstName#
        </name>
    </question>
    <question>
        <name>
            Dear Mr. #Surname#
        </name>
    </question>
    </script.
So what I need to do is to have the parts #FirstName# and #Surname# updated to the customer actual first and second name. I'll have an ID for the customer in the database which I'll need to use.

So has anyone any ideas on how to achieve this...

I thought that XSLT might have the answer...

Thanks,

Eoin...

 
Old August 30th, 2006, 05:14 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

XSLT does not have built-in database facilities, two alternative approaches come to mind:
 
  • Set up a web service to return some XML that has the user's details based on the id given. You can then use the document function to access this data and incorporate it in your output.
  • Use the extension functionality, e.g. using .NET you can write C# code to call into a database from within a transform.

If you still have problems let us know what XML library you are using and whether the web service is a possibility or you can only access via traditional database interfaces.

--

Joe (Microsoft MVP - XML)
 
Old August 30th, 2006, 05:33 AM
Registered User
 
Join Date: Aug 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Joe,

Thanks for the quick reply.

I'll most likely be using the extension functionality in .Net.
The scripts will be displayed on an ASP.Net page, and I'll be using VB.Net for the behind code.

Do you have any examples, or can you point me in the right direction.

Thanks again,

Eoin...

PS What is the Document function that you speak of, I'm not too sure what you mean... :)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic XML Manipulation Discussion dparsons ASP.NET 1.0 and 1.1 Professional 1 April 11th, 2007 08:46 AM
Crystal Reports with dynamic XML kncd2005 Crystal Reports 0 May 27th, 2005 12:11 PM
Dynamic XML site NeilS21 XML 1 April 18th, 2005 07:35 PM
Dynamic Email --> XML MadMaxMan XML 2 June 4th, 2003 04:04 PM





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