473,405 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Web service throwing XML - XSLT transformation, how?

Hello,
I have sort of a big problem. I would really appreciate any help you
could give me.
I made a web service in C++ that throws XML to the client (browser).
But, the XSLT transormation (xml->html) doen't happen!

I have XSLT files for this, they work, I mean when I put the output of
the app as an XML file on some server, and make it use the XSLT files to
transform into HTML, it works, I get a HTML page.

The XSLT file is on a separate server, the XML is thrown 'inline'
so-to-speak, it's dumped directly on the client's socket. But as I say,
it doesn't render to HTML. How can I make this work? Can I throw an XSLT
file inline too? How do I do that?

Right now I throw the XML output to the client's socket with
Content-type: text/html

Of course I've tried throwing it with Content-type: application/xml but
that didn't ail anything.

Can anybody tell me what I need to do to make the client-side xslt
transformation happen, with this kind of set-up?

So, to summarize :

situation now:
1. Client's browser asks my web service a HTTP GET request.
2. My server dumps XML on the client's socket. (with the correct HTTP
headers etc)
3. My client gets the XML code, but the XSLT transformation (that's
specified in the XML code) does not happen!

how it should be:
3. The XSLT should happen and the client gets HTML on his browser.

Why doesn't this happen? I suspsect it ahs something to do with the MIME
type my web service throws at the client, but what?

Thanks so much for any help,

--
- gipsy boy
Jul 20 '05 #1
12 3189


gipsy boy wrote:

I made a web service in C++ that throws XML to the client (browser).
But, the XSLT transormation (xml->html) doen't happen!

I have XSLT files for this, they work, I mean when I put the output of
the app as an XML file on some server, and make it use the XSLT files to
transform into HTML, it works, I get a HTML page.

The XSLT file is on a separate server


That could be the problem, for security reasons a browser might not
apply a stylesheet from a different server. Mozilla for instance doesn't:
<http://www.mozilla.org/projects/xslt/faq.html>
I think with IE it depends on the configuration.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
Martin Honnen wrote:


gipsy boy wrote:

I made a web service in C++ that throws XML to the client (browser).
But, the XSLT transormation (xml->html) doen't happen!

I have XSLT files for this, they work, I mean when I put the output of
the app as an XML file on some server, and make it use the XSLT files
to transform into HTML, it works, I get a HTML page.

The XSLT file is on a separate server

That could be the problem, for security reasons a browser might not
apply a stylesheet from a different server. Mozilla for instance doesn't:
<http://www.mozilla.org/projects/xslt/faq.html>
I think with IE it depends on the configuration.


Okay, thanks.
Can I provide the xslt transformation file *WITH* the xml code?
I tried just doing an <xsl:stylesheet..> xsl code </xsl:stylesheet>
inside the XML code, but it was treated as junk.
Does it *have* to be in a different file?

--
- gipsy boy
Jul 20 '05 #3
gipsy boy wrote:
Martin Honnen wrote:


gipsy boy wrote:

I made a web service in C++ that throws XML to the client (browser).
But, the XSLT transormation (xml->html) doen't happen!

I have XSLT files for this, they work, I mean when I put the output
of the app as an XML file on some server, and make it use the XSLT
files to transform into HTML, it works, I get a HTML page.

The XSLT file is on a separate server


That could be the problem, for security reasons a browser might not
apply a stylesheet from a different server. Mozilla for instance doesn't:
<http://www.mozilla.org/projects/xslt/faq.html>
I think with IE it depends on the configuration.

Okay, thanks.
Can I provide the xslt transformation file *WITH* the xml code?
I tried just doing an <xsl:stylesheet..> xsl code </xsl:stylesheet>
inside the XML code, but it was treated as junk.
Does it *have* to be in a different file?


I foudn out how to do this now, but:

XML Parsing Error: junk after document element
Location: http://localhost:3232/
Line Number 128, Column 1:<APPLICATION
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Any idea why? this is the literal code :

<?xml version="1.0" encoding="ISO8859-1"?>

<?xml-stylesheet type="text/xsl" href="#xslt"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" id="#xslt">
<xsl:import href="#xsd"/>
<xsl:output method="html" indent="yes" doctype-public="-//W3C//DTD HTML
4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd" />
<xsl:template match="xsl:stylesheet">
<!-- ignore -->
</xsl:template>
<xsl:template match="APPLICATION">
<HTML>
<HEAD>
<TITLE>joesgarage</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"/>
</HEAD>

<BODY BGCOLOR="#DEF0EC" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0"
MARGINHEIGHT="0"
style="color:#000000;font-family:Trebuchet,Verdana;font-size:11px">
<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR height="100">
<TD COLSPAN="4" bgcolor="#FFFFFF">
<IMG SRC="images/joesgarage.png" WIDTH="321" HEIGHT="100" ALT=""/></TD>
<TD bgcolor="#FFFFFF" width="100%">
<IMG SRC="images/bannerstretch.png" WIDTH="100%" HEIGHT="100"
ALT=""/></TD>
<TD bgcolor="#FFFFFF">
<IMG SRC="images/bannerright.png" WIDTH="432" HEIGHT="100" ALT=""/></TD>
</TR>

<TR height="32">
<TD width="5" bgcolor="#FFFFFF"></TD>
<TD bgcolor="#FFFFFF"><A HREF="browse_catalog_html.asp"><IMG
SRC="images/browsebutton.png" WIDTH="74" HEIGHT="32" ALT=""
BORDER="0"/></A></TD>
<TD bgcolor="#FFFFFF"><A HREF="edit_catalog_html.asp"><IMG
SRC="images/editbutton.png" WIDTH="54" HEIGHT="32" ALT=""
BORDER="0"/></A></TD>
<TD width="185" bgcolor="#FFFFFF"></TD>
<TD valign="bottom" width="100%" colspan="99" align="right"
bgcolor="#FFFFFF"
style="padding-top:3px;padding-right:13px;color:#666666;font-weight:bold;font-size:14px"><FORM
action="search.asp">Search: <INPUT type="text" value="" size="20"
name="query" style="font-size:10px" /></FORM></TD>
</TR>
<TR height="13">
<TD colspan="99"><IMG SRC="images/banner_border.png" WIDTH="100%"
HEIGHT="13" ALT="" BORDER="0"/></TD>
</TR>
<TR height="100%">

<TD colspan="99">
<TABLE width="92%" align="right" cellpadding="0" cellspacing="0"
bgcolor="#426e81">
<TR height="11" ><TD
style="background-image:url(images/ltborder.png);background-repeat:no-repeat;background-align:top
right;" WIDTH="9"></TD>
<TD width="100%"
style="padding:5px;background-image:url(images/topborder.png);background-repeat:repeat-x;font-size:13px;font-weight:bold;font-family:Trebuchet,Verdana,Arial;color:#FFFFFF;backg round-color:#426e81">Kandidaten</TD></TR>
<TR><TD
style="background-image:url(images/leftborder.png);background-repeat:repeat-y;"
WIDTH="9"><IMG SRC="images/leftborder.png"/></TD>
<TD bgcolor="#FFFFFF" style="padding:8px">
<TABLE border="0" width="100%" bgcolor="#333333" cellpadding="0"
cellspacing="0">
<xsl:apply-templates select="CANDIDATE"/>
</TABLE></TD>
</TR>
<TR height="11" ><TD
style="background-image:url(images/blcorner.png);background-repeat:no-repeat;background-align:top
right;background-color:#426e81" WIDTH="9"></TD>
<TD width="100%"
style="background-image:url(images/bottomborder.png);background-repeat:repeat-x;background-color:#426e81"></TD></TR>
</TABLE>
</TD>
</TR>

<TR height="100%">
<TD colspan="99">
<TABLE width="92%" align="right" cellpadding="0" cellspacing="0"
bgcolor="#426e81">
<TR height="11" ><TD
style="background-image:url(images/ltborder.png);background-repeat:no-repeat;background-align:top
right;" WIDTH="9"></TD>
<TD width="100%"
style="padding:5px;background-image:url(images/topborder.png);background-repeat:repeat-x;font-size:13px;font-weight:bold;font-family:Trebuchet,Verdana,Arial;color:#FFFFFF;backg round-color:#426e81">Jury's</TD></TR>
<TR><TD
style="background-image:url(images/leftborder.png);background-repeat:repeat-y;"
WIDTH="9"><IMG SRC="images/leftborder.png"/></TD>
<TD bgcolor="#FFFFFF" style="padding:8px">
<TABLE border="0" width="100%" bgcolor="#333333" cellpadding="0"
cellspacing="0">
<xsl:apply-templates select="JURY"/>
</TABLE></TD>
</TR>
<TR height="11" ><TD
style="background-image:url(images/blcorner.png);background-repeat:no-repeat;background-align:top
right;background-color:#426e81" WIDTH="9"></TD>
<TD width="100%"
style="background-image:url(images/bottomborder.png);background-repeat:repeat-x;background-color:#426e81"></TD></TR>
</TABLE>
</TD>

</TR>

<TR height="100%">
<TD colspan="99">
<TABLE width="92%" align="right" cellpadding="0" cellspacing="0"
bgcolor="#426e81">
<TR height="11" ><TD
style="background-image:url(images/ltborder.png);background-repeat:no-repeat;background-align:top
right;" WIDTH="9"></TD>
<TD width="100%"
style="padding:5px;background-image:url(images/topborder.png);background-repeat:repeat-x;font-size:13px;font-weight:bold;font-family:Trebuchet,Verdana,Arial;color:#FFFFFF;backg round-color:#426e81">Rondes</TD></TR>
<TR><TD
style="background-image:url(images/leftborder.png);background-repeat:repeat-y;"
WIDTH="9"><IMG SRC="images/leftborder.png"/></TD>
<TD bgcolor="#FFFFFF" style="padding:8px">
<TABLE border="0" width="100%" bgcolor="#333333" cellpadding="0"
cellspacing="0">
<xsl:apply-templates select="ROUND"/>
</TABLE></TD>
</TR>
<TR height="11" ><TD
style="background-image:url(images/blcorner.png);background-repeat:no-repeat;background-align:top
right;background-color:#426e81" WIDTH="9"></TD>
<TD width="100%"
style="background-image:url(images/bottomborder.png);background-repeat:repeat-x;background-color:#426e81"></TD></TR>
</TABLE>

</TD>
</TR>

</TABLE>
</BODY>
</HTML>

</xsl:template>

<xsl:template match="CANDIDATE">
<TR valign="bottom" bgcolor="#FFFFFF">
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Naam: </B><xsl:value-of
select="NAAM"/></TD>
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Voornaam:
</B><xsl:value-of select="FIRSTNAME"/></TD>
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Gdatum:
</B><xsl:value-of select="BIRTHDATE"/></TD>

</TR>
<TR valign="bottom" bgcolor="#FFFFFF">
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Adres: </B><xsl:value-of
select="ADDRESS"/></TD>
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Tel.: </B><xsl:value-of
select="TELNR"/></TD>
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Gsm: </B><xsl:value-of
select="GSMNR"/></TD>
</TR>
<TR valign="bottom" bgcolor="#FFFFFF"><TD bgcolor="#FFFFFF"
style="font-size:16px;font-weight:bold"><xsl:value-of select="titel"/></TD>
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Beroep:
</B><xsl:value-of select="PROFESSION"/></TD>
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Idool: </B><xsl:value-of
select="IDOL"/></TD>
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Motto: </B><xsl:value-of
select="MOTTO"/></TD>
</TR>

<TR valign="bottom" bgcolor="#FFFFFF"><TD bgcolor="#FFFFFF"
style="font-size:16px;font-weight:bold"><xsl:value-of select="titel"/></TD>
<TD colspan="3" bgcolor="#FFFFFF" style="font-size:11px"><B>Motivatie:
</B><xsl:value-of select="MOTIVATION"/></TD>
</TR>
<TR height="1">
<TD colspan="4"></TD>
</TR>
</xsl:template>

</xsl:stylesheet>


<APPLICATION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nonamespaceschemaLocation="#xsd">
<CANDIDATE>
<NAME>
name
</NAME>
<FIRSTNAME>
first
</FIRSTNAME>
<ADDRESS>
first
</ADDRESS>
<BIRTHDATE>
05/12/82
</BIRTHDATE>
<MOTTO>

test
</MOTTO>
<TELNR>
test
</TELNR>
<GSMNR>
test
</GSMNR>
<PROFESSION>
test
</PROFESSION>
<MOTIVATION>
test
</MOTIVATION>
<IDOL>
test
</IDOL>

</CANDIDATE>

<CANDIDATE>
<NAME>
name2
</NAME>
<FIRSTNAME>
firs2t
</FIRSTNAME>
<ADDRESS>
firs2t
</ADDRESS>
<BIRTHDATE>
05/12/82
</BIRTHDATE>
<MOTTO>
test

</MOTTO>
<TELNR>
test
</TELNR>
<GSMNR>
test
</GSMNR>
<PROFESSION>
test
</PROFESSION>
<MOTIVATION>
test
</MOTIVATION>
<IDOL>
test
</IDOL>
</CANDIDATE>

<JURY>
<NAME>
naamjury
</NAME>
<FIRSTNAME>
voornaamjury
</FIRSTNAME>
<BIRTHDATE>
06/13/50
</BIRTHDATE>
<TELNR>
test
</TELNR>
<GSMNR>
test
</GSMNR>

<EXPERTISE>
test
</EXPERTISE>
<GENRE>
test
</GENRE>
</JURY>

<ROUND>
<NAME>
naamronde
</NAME>
<LOCATION>
locatieronde
</LOCATION>
<LOCATIONADDRESS>
test

</LOCATIONADDRESS>
<LOCATIONTELNR>
test
</LOCATIONTELNR>
</ROUND>
</APPLICATION>

--
- gipsy boy
Jul 20 '05 #4
gipsy boy wrote:
gipsy boy wrote:
Martin Honnen wrote:


gipsy boy wrote:
I made a web service in C++ that throws XML to the client (browser).
But, the XSLT transormation (xml->html) doen't happen!

I have XSLT files for this, they work, I mean when I put the output
of the app as an XML file on some server, and make it use the XSLT
files to transform into HTML, it works, I get a HTML page.

The XSLT file is on a separate server


That could be the problem, for security reasons a browser might not
apply a stylesheet from a different server. Mozilla for instance
doesn't:
<http://www.mozilla.org/projects/xslt/faq.html>
I think with IE it depends on the configuration.


Okay, thanks.
Can I provide the xslt transformation file *WITH* the xml code?
I tried just doing an <xsl:stylesheet..> xsl code </xsl:stylesheet>
inside the XML code, but it was treated as junk.
Does it *have* to be in a different file?

I foudn out how to do this now, but:

XML Parsing Error: junk after document element
Location: http://localhost:3232/
Line Number 128, Column 1:<APPLICATION
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


Nevermind! Silly..
Well, now I get a grey screen in Firefox! Wth?
Page source gives the correct xml file..
I don't have an XSD schema though, is this necessary?

--
- gipsy boy
Jul 20 '05 #5


gipsy boy wrote:

I foudn out how to do this now, but:

XML Parsing Error: junk after document element
Location: http://localhost:3232/
Line Number 128, Column 1:<APPLICATION
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Any idea why? this is the literal code :


Well an XML document can only have exactly one document element but you
have tried to put both the XML and the XSLT into one document by simply
appending the source of the XML to the XSLT.
You would need to have the stylesheet as a child node of the document
element of the XML.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #6


gipsy boy wrote:

Well, now I get a grey screen in Firefox! Wth?
I don't have an XSD schema though, is this necessary?


No but you need an internal DTD fragment that declares the id attribute
if Mozilla is supposed to find the stylesheet.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #7
Martin Honnen wrote:


gipsy boy wrote:

Well, now I get a grey screen in Firefox! Wth?

I don't have an XSD schema though, is this necessary?

No but you need an internal DTD fragment that declares the id attribute
if Mozilla is supposed to find the stylesheet.


How do I do this exactly?
Now I have an error with the parsing of the XSLT sheet.
There are no syntax errors in the xslt sheet, I tested it externally.
I think this is the only obstacle left, the DTD fragment. Thanks so much
if you can help me with that.

Error:Error loading stylesheet: Parsing an XSLT stylesheet failed.
This is the code now:

<?xml version="1.0" encoding="ISO8859-1"?>
<?xml-stylesheet type="text/xml" href="xslt"?><!DOCTYPE APPLICATION
SYSTEM "doc.dtd">
<APPLICATION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nonamespaceschemaLocation="#xsd">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" id="#xslt">
<xsl:output method="html" indent="yes" doctype-public="-//W3C//DTD HTML
4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd" />
<xsl:template match="xsl:stylesheet">
<!-- ignore -->
</xsl:template>
<xsl:template match="APPLICATION">
<HTML>
<HEAD>
<TITLE>joesgarage</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"/>
</HEAD>
<BODY BGCOLOR="#DEF0EC" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0"
MARGINHEIGHT="0"
style="color:#000000;font-family:Trebuchet,Verdana;font-size:11px">

<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR height="100">
<TD COLSPAN="4" bgcolor="#FFFFFF">
<IMG SRC="images/joesgarage.png" WIDTH="321" HEIGHT="100" ALT=""/></TD>
<TD bgcolor="#FFFFFF" width="100%">
<IMG SRC="images/bannerstretch.png" WIDTH="100%" HEIGHT="100"
ALT=""/></TD>
<TD bgcolor="#FFFFFF">
<IMG SRC="images/bannerright.png" WIDTH="432" HEIGHT="100" ALT=""/></TD>
</TR>
<TR height="32">

<TD width="5" bgcolor="#FFFFFF"></TD>
<TD bgcolor="#FFFFFF"><A HREF="browse_catalog_html.asp"><IMG
SRC="images/browsebutton.png" WIDTH="74" HEIGHT="32" ALT=""
BORDER="0"/></A></TD>
<TD bgcolor="#FFFFFF"><A HREF="edit_catalog_html.asp"><IMG
SRC="images/editbutton.png" WIDTH="54" HEIGHT="32" ALT=""
BORDER="0"/></A></TD>
<TD width="185" bgcolor="#FFFFFF"></TD>
<TD valign="bottom" width="100%" colspan="99" align="right"
bgcolor="#FFFFFF"
style="padding-top:3px;padding-right:13px;color:#666666;font-weight:bold;font-size:14px"><FORM
action="search.asp">Search: <INPUT type="text" value="" size="20"
name="query" style="font-size:10px" /></FORM></TD>
</TR>
<TR height="13">
<TD colspan="99"><IMG SRC="images/banner_border.png" WIDTH="100%"
HEIGHT="13" ALT="" BORDER="0"/></TD>
</TR>
<TR height="100%">
<TD colspan="99">

<TABLE width="92%" align="right" cellpadding="0" cellspacing="0"
bgcolor="#426e81">
<TR height="11" ><TD
style="background-image:url(images/ltborder.png);background-repeat:no-repeat;background-align:top
right;" WIDTH="9"></TD>
<TD width="100%"
style="padding:5px;background-image:url(images/topborder.png);background-repeat:repeat-x;font-size:13px;font-weight:bold;font-family:Trebuchet,Verdana,Arial;color:#FFFFFF;backg round-color:#426e81">Kandidaten</TD></TR>
<TR><TD
style="background-image:url(images/leftborder.png);background-repeat:repeat-y;"
WIDTH="9"><IMG SRC="images/leftborder.png"/></TD>
<TD bgcolor="#FFFFFF" style="padding:8px">
<TABLE border="0" width="100%" bgcolor="#333333" cellpadding="0"
cellspacing="0">
<xsl:apply-templates select="CANDIDATE"/>
</TABLE></TD>
</TR>
<TR height="11" ><TD
style="background-image:url(images/blcorner.png);background-repeat:no-repeat;background-align:top
right;background-color:#426e81" WIDTH="9"></TD>
<TD width="100%"
style="background-image:url(images/bottomborder.png);background-repeat:repeat-x;background-color:#426e81"></TD></TR>
</TABLE>
</TD>
</TR>
<TR height="100%">
<TD colspan="99">
<TABLE width="92%" align="right" cellpadding="0" cellspacing="0"
bgcolor="#426e81">
<TR height="11" ><TD
style="background-image:url(images/ltborder.png);background-repeat:no-repeat;background-align:top
right;" WIDTH="9"></TD>
<TD width="100%"
style="padding:5px;background-image:url(images/topborder.png);background-repeat:repeat-x;font-size:13px;font-weight:bold;font-family:Trebuchet,Verdana,Arial;color:#FFFFFF;backg round-color:#426e81">Jury's</TD></TR>
<TR><TD
style="background-image:url(images/leftborder.png);background-repeat:repeat-y;"
WIDTH="9"><IMG SRC="images/leftborder.png"/></TD>
<TD bgcolor="#FFFFFF" style="padding:8px">
<TABLE border="0" width="100%" bgcolor="#333333" cellpadding="0"
cellspacing="0">
<xsl:apply-templates select="JURY"/>
</TABLE></TD>
</TR>
<TR height="11" ><TD
style="background-image:url(images/blcorner.png);background-repeat:no-repeat;background-align:top
right;background-color:#426e81" WIDTH="9"></TD>
<TD width="100%"
style="background-image:url(images/bottomborder.png);background-repeat:repeat-x;background-color:#426e81"></TD></TR>
</TABLE>
</TD>
</TR>

<TR height="100%">
<TD colspan="99">
<TABLE width="92%" align="right" cellpadding="0" cellspacing="0"
bgcolor="#426e81">
<TR height="11" ><TD
style="background-image:url(images/ltborder.png);background-repeat:no-repeat;background-align:top
right;" WIDTH="9"></TD>
<TD width="100%"
style="padding:5px;background-image:url(images/topborder.png);background-repeat:repeat-x;font-size:13px;font-weight:bold;font-family:Trebuchet,Verdana,Arial;color:#FFFFFF;backg round-color:#426e81">Rondes</TD></TR>
<TR><TD
style="background-image:url(images/leftborder.png);background-repeat:repeat-y;"
WIDTH="9"><IMG SRC="images/leftborder.png"/></TD>
<TD bgcolor="#FFFFFF" style="padding:8px">
<TABLE border="0" width="100%" bgcolor="#333333" cellpadding="0"
cellspacing="0">
<xsl:apply-templates select="ROUND"/>
</TABLE></TD>
</TR>
<TR height="11" ><TD
style="background-image:url(images/blcorner.png);background-repeat:no-repeat;background-align:top
right;background-color:#426e81" WIDTH="9"></TD>
<TD width="100%"
style="background-image:url(images/bottomborder.png);background-repeat:repeat-x;background-color:#426e81"></TD></TR>
</TABLE>
</TD>

</TR>

</TABLE>
</BODY>
</HTML>

</xsl:template>

<xsl:template match="CANDIDATE">
<TR valign="bottom" bgcolor="#FFFFFF">
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Naam: </B><xsl:value-of
select="NAAM"/></TD>
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Voornaam:
</B><xsl:value-of select="FIRSTNAME"/></TD>
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Gdatum:
</B><xsl:value-of select="BIRTHDATE"/></TD>
</TR>

<TR valign="bottom" bgcolor="#FFFFFF">
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Adres: </B><xsl:value-of
select="ADDRESS"/></TD>
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Tel.: </B><xsl:value-of
select="TELNR"/></TD>
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Gsm: </B><xsl:value-of
select="GSMNR"/></TD>
</TR>
<TR valign="bottom" bgcolor="#FFFFFF"><TD bgcolor="#FFFFFF"
style="font-size:16px;font-weight:bold"><xsl:value-of select="titel"/></TD>
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Beroep:
</B><xsl:value-of select="PROFESSION"/></TD>
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Idool: </B><xsl:value-of
select="IDOL"/></TD>
<TD bgcolor="#FFFFFF" style="font-size:11px"><B>Motto: </B><xsl:value-of
select="MOTTO"/></TD>
</TR>
<TR valign="bottom" bgcolor="#FFFFFF"><TD bgcolor="#FFFFFF"
style="font-size:16px;font-weight:bold"><xsl:value-of select="titel"/></TD>

<TD colspan="3" bgcolor="#FFFFFF" style="font-size:11px"><B>Motivatie:
</B><xsl:value-of select="MOTIVATION"/></TD>
</TR>
<TR height="1">
<TD colspan="4"></TD>
</TR>
</xsl:template>

</xsl:stylesheet>
<CANDIDATE>
<NAME>
name
</NAME>
<FIRSTNAME>
first
</FIRSTNAME>
<ADDRESS>

first
</ADDRESS>
<BIRTHDATE>
05/12/82
</BIRTHDATE>
<MOTTO>
test
</MOTTO>
<TELNR>
test
</TELNR>
<GSMNR>
test
</GSMNR>
<PROFESSION>
test
</PROFESSION>

<MOTIVATION>
test
</MOTIVATION>
<IDOL>
test
</IDOL>
</CANDIDATE>

<CANDIDATE>
<NAME>
name2
</NAME>
<FIRSTNAME>
firs2t
</FIRSTNAME>
<ADDRESS>
firs2t

</ADDRESS>
<BIRTHDATE>
05/12/82
</BIRTHDATE>
<MOTTO>
test
</MOTTO>
<TELNR>
test
</TELNR>
<GSMNR>
test
</GSMNR>
<PROFESSION>
test
</PROFESSION>
<MOTIVATION>

test
</MOTIVATION>
<IDOL>
test
</IDOL>
</CANDIDATE>

<JURY>
<NAME>
naamjury
</NAME>
<FIRSTNAME>
voornaamjury
</FIRSTNAME>
<BIRTHDATE>
06/13/50
</BIRTHDATE>

<TELNR>
test
</TELNR>
<GSMNR>
test
</GSMNR>
<EXPERTISE>
test
</EXPERTISE>
<GENRE>
test
</GENRE>
</JURY>

<ROUND>
<NAME>
naamronde

</NAME>
<LOCATION>
locatieronde
</LOCATION>
<LOCATIONADDRESS>
test
</LOCATIONADDRESS>
<LOCATIONTELNR>
test
</LOCATIONTELNR>
</ROUND>
</APPLICATION>

--
- gipsy boy
Jul 20 '05 #8


gipsy boy wrote:
Martin Honnen wrote:

No but you need an internal DTD fragment that declares the id
attribute if Mozilla is supposed to find the stylesheet.

How do I do this exactly?


<?xml version="1.0" encoding="ISO8859-1"?>


That should be
<?xml version="1.0" encoding="ISO-8859-1"?>
Here is a snippet of an example that works for me with Netscape 7.2 and
Firefox 1.0:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xml" href="#xslt"?>
<!DOCTYPE riders [
<!ELEMENT xsl:stylesheet ANY>
<!ATTLIST xsl:stylesheet
id ID #REQUIRED
version CDATA #FIXED "1.0"
xmlns:xsl CDATA #FIXED "http://www.w3.org/1999/XSL/Transform">
]>
<riders>
<xsl:stylesheet id="xslt"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #9
Martin Honnen wrote:


gipsy boy wrote:
Martin Honnen wrote:



No but you need an internal DTD fragment that declares the id
attribute if Mozilla is supposed to find the stylesheet.


How do I do this exactly?

<?xml version="1.0" encoding="ISO8859-1"?>

That should be
<?xml version="1.0" encoding="ISO-8859-1"?>
Here is a snippet of an example that works for me with Netscape 7.2 and
Firefox 1.0:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xml" href="#xslt"?>
<!DOCTYPE riders [
<!ELEMENT xsl:stylesheet ANY>
<!ATTLIST xsl:stylesheet
id ID #REQUIRED
version CDATA #FIXED "1.0"
xmlns:xsl CDATA #FIXED "http://www.w3.org/1999/XSL/Transform">
]>
<riders>
<xsl:stylesheet id="xslt"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">


Thanks again!
I did this for myself now, and get a parsing error in the XSLT.

Is the root tag in your xslt the tag "RIDERS"?

I simplified the stylesheet, and now I have this code for the xml file.
It says "Error loading stylesheet: Parsing an XSLT stylesheet failed."
Any ideas?
<?xml version="1.0" encoding="ISO8859-1"?>
<!DOCTYPE APPLICATION [
<!ATTLIST xsl:stylesheet id ID #REQUIRED>
]>
<?xml-stylesheet type="text/xml" href="xslt"?>
<APPLICATION>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" id="#xslt">
<xsl:output method="html" indent="yes" doctype-public="-//W3C//DTD HTML
4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd" />
<xsl:template match="xsl:stylesheet">
<!-- ignore -->
</xsl:template>
<xsl:template match="APPLICATION">
<HTML>
<HEAD>
<TITLE>joesgarage</TITLE>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"/>
</HEAD>
<BODY BGCOLOR="#DEF0EC" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0"
MARGINHEIGHT="0"
style="color:#000000;font-family:Trebuchet,Verdana;font-size:11px">
</BODY>
</HTML>

</xsl:template>

<xsl:template match="CANDIDATE">
Candidate
</xsl:template>

<xsl:template match="JURY">
Jury
</xsl:template>

<xsl:template match="ROUND">

Round
</xsl:template>
</xsl:stylesheet>
<CANDIDATE>
<NAME>
name
</NAME>
<FIRSTNAME>
first
</FIRSTNAME>
<ADDRESS>
first
</ADDRESS>
<BIRTHDATE>
05/12/82

</BIRTHDATE>
<MOTTO>
test
</MOTTO>
<TELNR>
test
</TELNR>

--
- gipsy boy
Jul 20 '05 #10
gipsy boy wrote:

Thanks again!
I did this for myself now, and get a parsing error in the XSLT.

Is the root tag in your xslt the tag "RIDERS"?

I simplified the stylesheet, and now I have this code for the xml file.
It says "Error loading stylesheet: Parsing an XSLT stylesheet failed."
Any ideas?
<?xml version="1.0" encoding="ISO8859-1"?>
<!DOCTYPE APPLICATION [
<!ATTLIST xsl:stylesheet id ID #REQUIRED>
]>
<?xml-stylesheet type="text/xml" href="xslt"?>
<APPLICATION>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" id="#xslt">


Sorry I made a mistake here of course, with the id/href.
I get an empty document now, it seems like the only tag that is
transformed is the root, APPLICATION tag.
The other tags aren't.
Can I see the rest of your xml code? I'm sure I'll be able to figure out
then.
Thanks so much for your help, btw, never coudl've done this without.

--
gipsy boy
Jul 20 '05 #11
gipsy boy wrote:
gipsy boy wrote:

Thanks again!
I did this for myself now, and get a parsing error in the XSLT.

Is the root tag in your xslt the tag "RIDERS"?

I simplified the stylesheet, and now I have this code for the xml
file. It says "Error loading stylesheet: Parsing an XSLT stylesheet
failed."
Any ideas?
<?xml version="1.0" encoding="ISO8859-1"?>
<!DOCTYPE APPLICATION [
<!ATTLIST xsl:stylesheet id ID #REQUIRED>
]>
<?xml-stylesheet type="text/xml" href="xslt"?>
<APPLICATION>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" id="#xslt">

Sorry I made a mistake here of course, with the id/href.
I get an empty document now, it seems like the only tag that is
transformed is the root, APPLICATION tag.
The other tags aren't.
Can I see the rest of your xml code? I'm sure I'll be able to figure out
then.
Thanks so much for your help, btw, never coudl've done this without.


Nevermind, solved it already. Doing very silly things today..
Thanks again,
--
- gipsy boy
Jul 20 '05 #12


gipsy boy wrote:
I get an empty document now, it seems like the only tag that is
transformed is the root, APPLICATION tag.
The other tags aren't.
You can run load the XML in the DOM inspector then you will be able to
see the result tree of the transformation.
Can I see the rest of your xml code? I'm sure I'll be able to figure out
then.


The example is this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xml" href="#xslt"?>
<!DOCTYPE riders [
<!ELEMENT xsl:stylesheet ANY>
<!ATTLIST xsl:stylesheet
id ID #REQUIRED
version CDATA #FIXED "1.0"
xmlns:xsl CDATA #FIXED "http://www.w3.org/1999/XSL/Transform">
]>
<riders>
<xsl:stylesheet id="xslt"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" />
<xsl:template match="/">
<html>
<head>
<title>Riders</title>
</head>
<body>
<xsl:apply-templates select="riders" />
</body>
</html>
</xsl:template>
<xsl:template match="riders">
<table border="1">
<tbody>
<xsl:apply-templates select="rider" />
</tbody>
</table>
</xsl:template>
<xsl:template match="rider">
<tr><td><xsl:value-of select="." /></td></tr>
</xsl:template>
</xsl:stylesheet>

<rider>Lance Armstrong</rider>
<rider>Jan Ullrich</rider>

</riders>

But be aware that IE/MSXML do not support the embedded stylesheet e.g. the
<?xml-stylesheet type="text/xml" href="#xslt"?>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sergio del Amo | last post by:
Hi, I use the xslt functions provided by php. I am running in my computer the package xampp(www.apachefriends.org) which includes php/apache/mysql .. In this package the php includes the sablotron...
6
by: Pete | last post by:
I am just getting to grips with XML and I was wondering if you could help me with something that no-one seems able or willing to help with.. I have an XSLT file which should be transforming a...
6
by: Ramon M. Felciano | last post by:
Helo all -- I'm trying to gain a deeper understand for what type of semi-declarative programming can be done through XML and XPath/XSLT. I'm looking at graph processing problems as a testbed for...
1
by: Jens Mueller | last post by:
Hi there, this is a Java-XML Question, so I am not sure whether this is the right place, haven't found anything better .... I try to convert a Java object to XML via SAX and let the FOP...
4
by: Stephen | last post by:
I have the following that outputs an xml file to a div using ajax: <script type="text/javascript"> function ajaxXML(url,control_id){ if (document.getElementById) { var x =...
5
by: shauldar | last post by:
Is there a way (tool, hack...) to create an XSL:FO from an XSLT + XML files? My motivation is that we want to use a tool to design reports, and from that "design" generate both HTML (via XSLT)...
4
by: simon.a.hulbert | last post by:
Hi, I'm trying to view the following xslt transformation using firefox <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" > <xsl:output method = "xml" indent =...
4
by: stuart.jones | last post by:
Dear all I have a Windows Service that retrieves some data as XML, applies an XSLT to produce a CSV which is saved to the filesystem as a text file. This all works fine. Depending upon the...
2
by: Jonny B | last post by:
Hi all, I'm working on an a clientside xslt using jscript that passes a parameter to the xsl. I've got it working no problem in IE but cant get it to work in Mozilla. Can anyone help? This is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.