<tr>
<td>
Title: <xsl:value-of select="FIELD[@NAME='title
Artist: <xsl:value-of select="FIELD[@NAME='artis
Year: <xsl:value-of select="FIELD[@NAME='year'
</td>
</tr>
Main Topics
Browse All Topics
a have a XML-file with data represented as
<FIELD NAME="title">St. Anger</FIELD>
<FIELD NAME="artist">Metallica</F
<FIELD NAME="year">2003</FIELD>
a looked at w3schools pages to find out how to display XML inside HTML elements,
e.g: http://www.w3schools.com/x
How can a do this when the data is represented as <FIELD NAME="title> instead of <TITLE>?
Thanks in advance for any help or alternative solutions :)
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thanks a lot, and sorry for the late response, but I've been away for i while.
I'll have to increase the points for this question from 250 to 500 because I have a follow-up-question:
The XML I'm transforming I get from a querystring, therefore I can't refer to my XSL in the XML-file.
Is it possible to do something like this?
- create a XML-file that can handle the parameters, include them and do the call to the external site where I get my XML from and refer to the XSL-file there?
<my XML-file>
<include external XML-file with querystring>
<my XSL-file>
Thanks!
I've tried this with success:
Create a XML-file like this:
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="GS_include.xsl"?>
<TEST>
</TEST>
where the beginning of the XSL-file looks like this:
<xsl:stylesheet xmlns:xsl="http://www.w3.o
version="1.0">
<xsl:output method="html" omit-xml-declaration="yes"
<xsl:variable name="doc" select="document('GS.xml')
<xsl:template match="TEST">
<xsl:for-each select="$doc//TEST2">
....... <do the parsing - - - - - - ->
My problem is: how can I replace the document name (GS.xml) with the URL for the external XML-site?
If the XML document comes from a different domain than the one referred to in the XSLT document() function, it may not work because of security issues. I've never tried to do it that way...
Your design seems rather peculiar. Normally, the parameters are set in the XSLT with something like:
xslProc.addParameter(sPara
depending, of course, on the platform. But this doesn't work easily in a cross browser situation. I would think that a much safer solution is to use a more typical design where the transform occurs on the server. Is there some reason you can't do it this way? I would say that as a general rule, using accepted design patterns is a better way to go, unless there is some bizarre requirement that precludes this.
In any case, there are sevaral ways to modify the string in the document() function. One is to use an XSLT parameter as in the example above. Or, you can put the URL in the XML, and refer to it in the document function (this is generally how the function is supposed to work anyway). Another is to use the DOM to find and modify the select attribute (clunky approach, used to be necessary in the early days, but not any more) and one other is to use some sort of server-side processing to get it done. For example, if you were using ASP, you could do this:
<xsl:variable name="doc" select="document('<%= myServerVariable %>')"/>
Of couse, the extension of the XSLT would have to be *.asp or else you'd need to tweak your web server to process this file type. All in all, a very clunky solution.
Regards,
Mike Sharp
Business Accounts
Answer for Membership
by: rdcproPosted on 2004-06-28 at 09:57:27ID: 11417572
I'd give up on databinding. It was originally meant as a quick and dirty way of linking a tabular XML format to HTML elements. But your requirements are starting to drift away from that, and databinding is pretty restrictive when it comes to how the XML is formed.
XML and XSLT is the way to go. You've got much better control over both the UI/Look and feel, and how you interact with the XML. And if you use XML and XSLT, you'll be able to reach a larger number of browsers, as not only IE but Netscape/Mozilla and others will be able to read an XML file with an XSLT processing instruction, and render the transformed result. I did a lot of experimenting with databinding back in 1999, and finally decided the little convenience it offered was not worth sacrificing the versatility of an XSLT based solution. It was also much slower on larger recordsets than an XML/XSLT transformation.
Regards,
Mike Sharp