Web service throwing XML - XSLT transformation, how?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gipsy boy

    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
  • Martin Honnen

    #2
    Re: Web service throwing XML - XSLT transformation, how?



    gipsy boy wrote:

    [color=blue]
    > 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[/color]

    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

    Comment

    • gipsy boy

      #3
      Re: Web service throwing XML - XSLT transformation, how?

      Martin Honnen wrote:[color=blue]
      >
      >
      > gipsy boy wrote:
      >
      >[color=green]
      >> 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[/color]
      >
      >
      > 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.[/color]

      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

      Comment

      • gipsy boy

        #4
        Re: Web service throwing XML - XSLT transformation, how?

        gipsy boy wrote:[color=blue]
        > Martin Honnen wrote:
        >[color=green]
        >>
        >>
        >> gipsy boy wrote:
        >>
        >>[color=darkred]
        >>> 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[/color]
        >>
        >>
        >>
        >> 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.[/color]
        >
        >
        > 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?[/color]

        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="ISO88 59-1"?>

        <?xml-stylesheet type="text/xsl" href="#xslt"?>
        <xsl:styleshe et 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:styl esheet">
        <!-- ignore -->
        </xsl:template>
        <xsl:template match="APPLICAT ION">
        <HTML>
        <HEAD>
        <TITLE>joesgara ge</TITLE>
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"/>
        </HEAD>

        <BODY BGCOLOR="#DEF0E C" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0"
        MARGINHEIGHT="0 "
        style="color:#0 00000;font-family:Trebuche t,Verdana;font-size:11px">
        <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" >
        <TR height="100">
        <TD COLSPAN="4" bgcolor="#FFFFF F">
        <IMG SRC="images/joesgarage.png" WIDTH="321" HEIGHT="100" ALT=""/></TD>
        <TD bgcolor="#FFFFF F" width="100%">
        <IMG SRC="images/bannerstretch.p ng" WIDTH="100%" HEIGHT="100"
        ALT=""/></TD>
        <TD bgcolor="#FFFFF F">
        <IMG SRC="images/bannerright.png " WIDTH="432" HEIGHT="100" ALT=""/></TD>
        </TR>

        <TR height="32">
        <TD width="5" bgcolor="#FFFFF F"></TD>
        <TD bgcolor="#FFFFF F"><A HREF="browse_ca talog_html.asp" ><IMG
        SRC="images/browsebutton.pn g" WIDTH="74" HEIGHT="32" ALT=""
        BORDER="0"/></A></TD>
        <TD bgcolor="#FFFFF F"><A HREF="edit_cata log_html.asp">< IMG
        SRC="images/editbutton.png" WIDTH="54" HEIGHT="32" ALT=""
        BORDER="0"/></A></TD>
        <TD width="185" bgcolor="#FFFFF F"></TD>
        <TD valign="bottom" width="100%" colspan="99" align="right"
        bgcolor="#FFFFF F"
        style="padding-top:3px;padding-right:13px;colo r:#666666;font-weight:bold;fon t-size:14px"><FOR M
        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"><I MG SRC="images/banner_border.p ng" 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="#426e8 1">
        <TR height="11" ><TD
        style="backgrou nd-image:url(image s/ltborder.png);b ackground-repeat:no-repeat;backgrou nd-align:top
        right;" WIDTH="9"></TD>
        <TD width="100%"
        style="padding: 5px;background-image:url(image s/topborder.png); background-repeat:repeat-x;font-size:13px;font-weight:bold;fon t-family:Trebuche t,Verdana,Arial ;color:#FFFFFF; background-color:#426e81"> Kandidaten</TD></TR>
        <TR><TD
        style="backgrou nd-image:url(image s/leftborder.png) ;background-repeat:repeat-y;"
        WIDTH="9"><IMG SRC="images/leftborder.png"/></TD>
        <TD bgcolor="#FFFFF F" style="padding: 8px">
        <TABLE border="0" width="100%" bgcolor="#33333 3" cellpadding="0"
        cellspacing="0" >
        <xsl:apply-templates select="CANDIDA TE"/>
        </TABLE></TD>
        </TR>
        <TR height="11" ><TD
        style="backgrou nd-image:url(image s/blcorner.png);b ackground-repeat:no-repeat;backgrou nd-align:top
        right;backgroun d-color:#426e81" WIDTH="9"></TD>
        <TD width="100%"
        style="backgrou nd-image:url(image s/bottomborder.pn g);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="#426e8 1">
        <TR height="11" ><TD
        style="backgrou nd-image:url(image s/ltborder.png);b ackground-repeat:no-repeat;backgrou nd-align:top
        right;" WIDTH="9"></TD>
        <TD width="100%"
        style="padding: 5px;background-image:url(image s/topborder.png); background-repeat:repeat-x;font-size:13px;font-weight:bold;fon t-family:Trebuche t,Verdana,Arial ;color:#FFFFFF; background-color:#426e81"> Jury's</TD></TR>
        <TR><TD
        style="backgrou nd-image:url(image s/leftborder.png) ;background-repeat:repeat-y;"
        WIDTH="9"><IMG SRC="images/leftborder.png"/></TD>
        <TD bgcolor="#FFFFF F" style="padding: 8px">
        <TABLE border="0" width="100%" bgcolor="#33333 3" cellpadding="0"
        cellspacing="0" >
        <xsl:apply-templates select="JURY"/>
        </TABLE></TD>
        </TR>
        <TR height="11" ><TD
        style="backgrou nd-image:url(image s/blcorner.png);b ackground-repeat:no-repeat;backgrou nd-align:top
        right;backgroun d-color:#426e81" WIDTH="9"></TD>
        <TD width="100%"
        style="backgrou nd-image:url(image s/bottomborder.pn g);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="#426e8 1">
        <TR height="11" ><TD
        style="backgrou nd-image:url(image s/ltborder.png);b ackground-repeat:no-repeat;backgrou nd-align:top
        right;" WIDTH="9"></TD>
        <TD width="100%"
        style="padding: 5px;background-image:url(image s/topborder.png); background-repeat:repeat-x;font-size:13px;font-weight:bold;fon t-family:Trebuche t,Verdana,Arial ;color:#FFFFFF; background-color:#426e81"> Rondes</TD></TR>
        <TR><TD
        style="backgrou nd-image:url(image s/leftborder.png) ;background-repeat:repeat-y;"
        WIDTH="9"><IMG SRC="images/leftborder.png"/></TD>
        <TD bgcolor="#FFFFF F" style="padding: 8px">
        <TABLE border="0" width="100%" bgcolor="#33333 3" cellpadding="0"
        cellspacing="0" >
        <xsl:apply-templates select="ROUND"/>
        </TABLE></TD>
        </TR>
        <TR height="11" ><TD
        style="backgrou nd-image:url(image s/blcorner.png);b ackground-repeat:no-repeat;backgrou nd-align:top
        right;backgroun d-color:#426e81" WIDTH="9"></TD>
        <TD width="100%"
        style="backgrou nd-image:url(image s/bottomborder.pn g);background-repeat:repeat-x;background-color:#426e81"> </TD></TR>
        </TABLE>

        </TD>
        </TR>

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

        </xsl:template>

        <xsl:template match="CANDIDAT E">
        <TR valign="bottom" bgcolor="#FFFFF F">
        <TD bgcolor="#FFFFF F" style="font-size:11px"><B>N aam: </B><xsl:value-of
        select="NAAM"/></TD>
        <TD bgcolor="#FFFFF F" style="font-size:11px"><B>V oornaam:
        </B><xsl:value-of select="FIRSTNA ME"/></TD>
        <TD bgcolor="#FFFFF F" style="font-size:11px"><B>G datum:
        </B><xsl:value-of select="BIRTHDA TE"/></TD>

        </TR>
        <TR valign="bottom" bgcolor="#FFFFF F">
        <TD bgcolor="#FFFFF F" style="font-size:11px"><B>A dres: </B><xsl:value-of
        select="ADDRESS "/></TD>
        <TD bgcolor="#FFFFF F" style="font-size:11px"><B>T el.: </B><xsl:value-of
        select="TELNR"/></TD>
        <TD bgcolor="#FFFFF F" style="font-size:11px"><B>G sm: </B><xsl:value-of
        select="GSMNR"/></TD>
        </TR>
        <TR valign="bottom" bgcolor="#FFFFF F"><TD bgcolor="#FFFFF F"
        style="font-size:16px;font-weight:bold"><x sl:value-of select="titel"/></TD>
        <TD bgcolor="#FFFFF F" style="font-size:11px"><B>B eroep:
        </B><xsl:value-of select="PROFESS ION"/></TD>
        <TD bgcolor="#FFFFF F" style="font-size:11px"><B>I dool: </B><xsl:value-of
        select="IDOL"/></TD>
        <TD bgcolor="#FFFFF F" style="font-size:11px"><B>M otto: </B><xsl:value-of
        select="MOTTO"/></TD>
        </TR>

        <TR valign="bottom" bgcolor="#FFFFF F"><TD bgcolor="#FFFFF F"
        style="font-size:16px;font-weight:bold"><x sl:value-of select="titel"/></TD>
        <TD colspan="3" bgcolor="#FFFFF F" style="font-size:11px"><B>M otivatie:
        </B><xsl:value-of select="MOTIVAT ION"/></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:nonamespace schemaLocation= "#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>
        <LOCATIONADDRES S>
        test

        </LOCATIONADDRESS >
        <LOCATIONTELN R>
        test
        </LOCATIONTELNR>
        </ROUND>


        </APPLICATION>

        --
        - gipsy boy

        Comment

        • gipsy boy

          #5
          Re: Web service throwing XML - XSLT transformation, how?

          gipsy boy wrote:[color=blue]
          > gipsy boy wrote:
          >[color=green]
          >> Martin Honnen wrote:
          >>[color=darkred]
          >>>
          >>>
          >>> 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.[/color]
          >>
          >>
          >>
          >> 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?[/color]
          >
          >
          > 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">
          >[/color]

          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

          Comment

          • Martin Honnen

            #6
            Re: Web service throwing XML - XSLT transformation, how?



            gipsy boy wrote:

            [color=blue]
            > 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 :[/color]

            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

            Comment

            • Martin Honnen

              #7
              Re: Web service throwing XML - XSLT transformation, how?



              gipsy boy wrote:

              [color=blue]
              > Well, now I get a grey screen in Firefox! Wth?[/color]

              [color=blue]
              > I don't have an XSD schema though, is this necessary?[/color]

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

              --

              Martin Honnen

              Comment

              • gipsy boy

                #8
                Re: Web service throwing XML - XSLT transformation, how?

                Martin Honnen wrote:[color=blue]
                >
                >
                > gipsy boy wrote:
                >
                >[color=green]
                >> Well, now I get a grey screen in Firefox! Wth?[/color]
                >
                >
                >[color=green]
                >> I don't have an XSD schema though, is this necessary?[/color]
                >
                >
                > No but you need an internal DTD fragment that declares the id attribute
                > if Mozilla is supposed to find the stylesheet.[/color]

                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="ISO88 59-1"?>
                <?xml-stylesheet type="text/xml" href="xslt"?><! DOCTYPE APPLICATION
                SYSTEM "doc.dtd">
                <APPLICATION xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
                xsi:nonamespace schemaLocation= "#xsd">
                <xsl:styleshe et 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:styl esheet">
                <!-- ignore -->
                </xsl:template>
                <xsl:template match="APPLICAT ION">
                <HTML>
                <HEAD>
                <TITLE>joesgara ge</TITLE>
                <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"/>
                </HEAD>
                <BODY BGCOLOR="#DEF0E C" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0"
                MARGINHEIGHT="0 "
                style="color:#0 00000;font-family:Trebuche t,Verdana;font-size:11px">

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

                <TD width="5" bgcolor="#FFFFF F"></TD>
                <TD bgcolor="#FFFFF F"><A HREF="browse_ca talog_html.asp" ><IMG
                SRC="images/browsebutton.pn g" WIDTH="74" HEIGHT="32" ALT=""
                BORDER="0"/></A></TD>
                <TD bgcolor="#FFFFF F"><A HREF="edit_cata log_html.asp">< IMG
                SRC="images/editbutton.png" WIDTH="54" HEIGHT="32" ALT=""
                BORDER="0"/></A></TD>
                <TD width="185" bgcolor="#FFFFF F"></TD>
                <TD valign="bottom" width="100%" colspan="99" align="right"
                bgcolor="#FFFFF F"
                style="padding-top:3px;padding-right:13px;colo r:#666666;font-weight:bold;fon t-size:14px"><FOR M
                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"><I MG SRC="images/banner_border.p ng" 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="#426e8 1">
                <TR height="11" ><TD
                style="backgrou nd-image:url(image s/ltborder.png);b ackground-repeat:no-repeat;backgrou nd-align:top
                right;" WIDTH="9"></TD>
                <TD width="100%"
                style="padding: 5px;background-image:url(image s/topborder.png); background-repeat:repeat-x;font-size:13px;font-weight:bold;fon t-family:Trebuche t,Verdana,Arial ;color:#FFFFFF; background-color:#426e81"> Kandidaten</TD></TR>
                <TR><TD
                style="backgrou nd-image:url(image s/leftborder.png) ;background-repeat:repeat-y;"
                WIDTH="9"><IMG SRC="images/leftborder.png"/></TD>
                <TD bgcolor="#FFFFF F" style="padding: 8px">
                <TABLE border="0" width="100%" bgcolor="#33333 3" cellpadding="0"
                cellspacing="0" >
                <xsl:apply-templates select="CANDIDA TE"/>
                </TABLE></TD>
                </TR>
                <TR height="11" ><TD
                style="backgrou nd-image:url(image s/blcorner.png);b ackground-repeat:no-repeat;backgrou nd-align:top
                right;backgroun d-color:#426e81" WIDTH="9"></TD>
                <TD width="100%"
                style="backgrou nd-image:url(image s/bottomborder.pn g);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="#426e8 1">
                <TR height="11" ><TD
                style="backgrou nd-image:url(image s/ltborder.png);b ackground-repeat:no-repeat;backgrou nd-align:top
                right;" WIDTH="9"></TD>
                <TD width="100%"
                style="padding: 5px;background-image:url(image s/topborder.png); background-repeat:repeat-x;font-size:13px;font-weight:bold;fon t-family:Trebuche t,Verdana,Arial ;color:#FFFFFF; background-color:#426e81"> Jury's</TD></TR>
                <TR><TD
                style="backgrou nd-image:url(image s/leftborder.png) ;background-repeat:repeat-y;"
                WIDTH="9"><IMG SRC="images/leftborder.png"/></TD>
                <TD bgcolor="#FFFFF F" style="padding: 8px">
                <TABLE border="0" width="100%" bgcolor="#33333 3" cellpadding="0"
                cellspacing="0" >
                <xsl:apply-templates select="JURY"/>
                </TABLE></TD>
                </TR>
                <TR height="11" ><TD
                style="backgrou nd-image:url(image s/blcorner.png);b ackground-repeat:no-repeat;backgrou nd-align:top
                right;backgroun d-color:#426e81" WIDTH="9"></TD>
                <TD width="100%"
                style="backgrou nd-image:url(image s/bottomborder.pn g);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="#426e8 1">
                <TR height="11" ><TD
                style="backgrou nd-image:url(image s/ltborder.png);b ackground-repeat:no-repeat;backgrou nd-align:top
                right;" WIDTH="9"></TD>
                <TD width="100%"
                style="padding: 5px;background-image:url(image s/topborder.png); background-repeat:repeat-x;font-size:13px;font-weight:bold;fon t-family:Trebuche t,Verdana,Arial ;color:#FFFFFF; background-color:#426e81"> Rondes</TD></TR>
                <TR><TD
                style="backgrou nd-image:url(image s/leftborder.png) ;background-repeat:repeat-y;"
                WIDTH="9"><IMG SRC="images/leftborder.png"/></TD>
                <TD bgcolor="#FFFFF F" style="padding: 8px">
                <TABLE border="0" width="100%" bgcolor="#33333 3" cellpadding="0"
                cellspacing="0" >
                <xsl:apply-templates select="ROUND"/>
                </TABLE></TD>
                </TR>
                <TR height="11" ><TD
                style="backgrou nd-image:url(image s/blcorner.png);b ackground-repeat:no-repeat;backgrou nd-align:top
                right;backgroun d-color:#426e81" WIDTH="9"></TD>
                <TD width="100%"
                style="backgrou nd-image:url(image s/bottomborder.pn g);background-repeat:repeat-x;background-color:#426e81"> </TD></TR>
                </TABLE>
                </TD>

                </TR>

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

                </xsl:template>

                <xsl:template match="CANDIDAT E">
                <TR valign="bottom" bgcolor="#FFFFF F">
                <TD bgcolor="#FFFFF F" style="font-size:11px"><B>N aam: </B><xsl:value-of
                select="NAAM"/></TD>
                <TD bgcolor="#FFFFF F" style="font-size:11px"><B>V oornaam:
                </B><xsl:value-of select="FIRSTNA ME"/></TD>
                <TD bgcolor="#FFFFF F" style="font-size:11px"><B>G datum:
                </B><xsl:value-of select="BIRTHDA TE"/></TD>
                </TR>

                <TR valign="bottom" bgcolor="#FFFFF F">
                <TD bgcolor="#FFFFF F" style="font-size:11px"><B>A dres: </B><xsl:value-of
                select="ADDRESS "/></TD>
                <TD bgcolor="#FFFFF F" style="font-size:11px"><B>T el.: </B><xsl:value-of
                select="TELNR"/></TD>
                <TD bgcolor="#FFFFF F" style="font-size:11px"><B>G sm: </B><xsl:value-of
                select="GSMNR"/></TD>
                </TR>
                <TR valign="bottom" bgcolor="#FFFFF F"><TD bgcolor="#FFFFF F"
                style="font-size:16px;font-weight:bold"><x sl:value-of select="titel"/></TD>
                <TD bgcolor="#FFFFF F" style="font-size:11px"><B>B eroep:
                </B><xsl:value-of select="PROFESS ION"/></TD>
                <TD bgcolor="#FFFFF F" style="font-size:11px"><B>I dool: </B><xsl:value-of
                select="IDOL"/></TD>
                <TD bgcolor="#FFFFF F" style="font-size:11px"><B>M otto: </B><xsl:value-of
                select="MOTTO"/></TD>
                </TR>
                <TR valign="bottom" bgcolor="#FFFFF F"><TD bgcolor="#FFFFF F"
                style="font-size:16px;font-weight:bold"><x sl:value-of select="titel"/></TD>

                <TD colspan="3" bgcolor="#FFFFF F" style="font-size:11px"><B>M otivatie:
                </B><xsl:value-of select="MOTIVAT ION"/></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>
                <LOCATIONADDRES S>
                test
                </LOCATIONADDRESS >
                <LOCATIONTELN R>
                test
                </LOCATIONTELNR>
                </ROUND>


                </APPLICATION>

                --
                - gipsy boy

                Comment

                • Martin Honnen

                  #9
                  Re: Web service throwing XML - XSLT transformation, how?



                  gipsy boy wrote:
                  [color=blue]
                  > Martin Honnen wrote:[/color]
                  [color=blue][color=green]
                  >>
                  >> No but you need an internal DTD fragment that declares the id
                  >> attribute if Mozilla is supposed to find the stylesheet.[/color]
                  >
                  >
                  > How do I do this exactly?[/color]

                  [color=blue]
                  > <?xml version="1.0" encoding="ISO88 59-1"?>[/color]

                  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:styleshe et id="xslt"
                  xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
                  version="1.0">


                  --

                  Martin Honnen

                  Comment

                  • gipsy boy

                    #10
                    Re: Web service throwing XML - XSLT transformation, how?

                    Martin Honnen wrote:[color=blue]
                    >
                    >
                    > gipsy boy wrote:
                    >[color=green]
                    >> Martin Honnen wrote:[/color]
                    >
                    >[color=green][color=darkred]
                    >>>
                    >>> No but you need an internal DTD fragment that declares the id
                    >>> attribute if Mozilla is supposed to find the stylesheet.[/color]
                    >>
                    >>
                    >>
                    >> How do I do this exactly?[/color]
                    >
                    >
                    >[color=green]
                    >> <?xml version="1.0" encoding="ISO88 59-1"?>[/color]
                    >
                    >
                    > 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:styleshe et id="xslt"
                    > xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
                    > version="1.0">[/color]

                    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="ISO88 59-1"?>
                    <!DOCTYPE APPLICATION [
                    <!ATTLIST xsl:stylesheet id ID #REQUIRED>
                    ]>
                    <?xml-stylesheet type="text/xml" href="xslt"?>
                    <APPLICATION>
                    <xsl:styleshe et 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:styl esheet">
                    <!-- ignore -->
                    </xsl:template>
                    <xsl:template match="APPLICAT ION">
                    <HTML>
                    <HEAD>
                    <TITLE>joesgara ge</TITLE>

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

                    </xsl:template>

                    <xsl:template match="CANDIDAT E">
                    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

                    Comment

                    • gipsy boy

                      #11
                      Re: Web service throwing XML - XSLT transformation, how?

                      gipsy boy wrote:
                      [color=blue]
                      >
                      > 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="ISO88 59-1"?>
                      > <!DOCTYPE APPLICATION [
                      > <!ATTLIST xsl:stylesheet id ID #REQUIRED>
                      > ]>
                      > <?xml-stylesheet type="text/xml" href="xslt"?>
                      > <APPLICATION>
                      > <xsl:styleshe et xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
                      > version="1.0" id="#xslt">[/color]

                      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

                      Comment

                      • gipsy boy

                        #12
                        Re: Web service throwing XML - XSLT transformation, how?

                        gipsy boy wrote:[color=blue]
                        > gipsy boy wrote:
                        >[color=green]
                        >>
                        >> 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="ISO88 59-1"?>
                        >> <!DOCTYPE APPLICATION [
                        >> <!ATTLIST xsl:stylesheet id ID #REQUIRED>
                        >> ]>
                        >> <?xml-stylesheet type="text/xml" href="xslt"?>
                        >> <APPLICATION>
                        >> <xsl:styleshe et xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
                        >> version="1.0" id="#xslt">[/color]
                        >
                        >
                        > 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.
                        >[/color]

                        Nevermind, solved it already. Doing very silly things today..
                        Thanks again,
                        --
                        - gipsy boy

                        Comment

                        • Martin Honnen

                          #13
                          Re: Web service throwing XML - XSLT transformation, how?



                          gipsy boy wrote:
                          [color=blue]
                          > 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.[/color]

                          You can run load the XML in the DOM inspector then you will be able to
                          see the result tree of the transformation.
                          [color=blue]
                          > Can I see the rest of your xml code? I'm sure I'll be able to figure out
                          > then.[/color]

                          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:styleshe et 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:va lue-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

                          Comment

                          Working...