[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Passing an external value to an xml file


xml external file
You can do this using client-side scripting. You can't do it by simply
loading the XML file into your browser, because that technique doesn't allow
the stylesheet to be parameterized. But if you invoke the transformation
from JavaScript in your HTML page, you can supply a parameter indicating
which records to display. You can find examples of this in the MSXML
Appendix of my "XSLT Programmer's Reference" and no doubt many other XSLT
resources.

A word of warning: downloading the entire employee database to the client
machine, in order to display one record, may be very inefficient, and may
also have security implications. This is definitely a case where a
server-side solution seems preferable.

Michael Kay
Software AG
home: Michael.H.Kay@n...
work: Michael.Kay@s...

> -----Original Message-----
> From: Anoop A V [mailto:anoopav@h...]
> Sent: 24 March 2002 16:30
> To: xml-dev@l...
> Subject:  Passing an external value to an xml file
>
>
> Hi,
>          I have an XML file(employees.xml) which holds the
> information of
> all the employees in a company. I have created an xsl
> file(emp.xsl) too,
> which is used to transform this xml file. I have included
> '<?xml-stylesheet
> type="text/xsl" href="emp.xsl"?>' in the xml file. A link in
> an HTML page
> points to this xml file. When you click on this link the
> details 'of a
> particular employee' have to be displayed in the browser. So the href
> attribute of the <a> tag will be 'employees.xml?empid=4". The
> xml file need
> to get this 'empid' and pass it to the xsl file, so that I
> can use something
> like :
>
> <xsl:template match="/">
> 	<xsl:apply-templates select="//employee[employeeid=...]"/>
> </xsl:template>
>
> in the xsl file.
>
> My files reside in an NT Server running IIS, but I am asked
> not to use ASP
> or any other server side scripting techniques. Can I get the
> work done with
> the help of just the xml and xsl files. Someone suggested
> <xsl:param> but I
> don't know how it can be implemented. Even if it can be successfully
> implemented, I guess it won't work with xml version 1.0. But
> still can
> anybody show me how to use xsl:param to tackle the problem?
> Or is there some
> other way to solve the issue? I will be extremely grateful if
> somebody can
> show me the way.
>
> Thanks.
> Anoop A.V.
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at
> http://explorer.msn.com/intl.asp.
>
>
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>
>


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.