Click to See Complete Forum and Search --> : Getting xslt templates to work with cursors and grouping of xml


cr7
12-28-2008, 07:50 AM
Hi everyone,

I am a complete newbie and I am trying to output someone of my xsql using xslt templates. Everytime I try to create a template I keep on getting XML Parsing Error: no element found or XML Parsing Error: syntax error. What I want to show is basically on my browser the tracks of each mp3player as a list. There are two mp3players that have many tracks. I am completely stuck please could somebody help me this would be very appreciated. :)
The xml out put is given below


<a>
−<ROWSET>
−<ROW num="1">
<mp3playertype>random</mp3playertype>
−<mp3players>
−<mp3players_ROW num="1">
<trackid>35</trackid>
<trackname>Lonely</trackname>
</mp3players_ROW>
−<mp3players_ROW num="2">
<trackid>36</trackid>
<trackname>Stumble</trackname>
</mp3players_ROW>
−</mp3players>
</ROW>
−<ROW num="2">
<mp3playertype>tiny</mp3playertype>
−<mp3players>
−<mp3players_ROW num="1">
<trackid>38</trackid>
<trackname>Life</trackname>
</mp3players_ROW>
−<mp3players_ROW num="2">
<trackid>63</trackid>
<trackname>Cash Machine</trackname>
</mp3players_ROW>
−<mp3players_ROW num="3">
<trackid>240</trackid>
<trackname>Lovely 2 C U</trackname>
</mp3players_ROW>
</mp3players>
</ROW>
</ROWSET>
</a>

cr7
12-30-2008, 08:21 AM
anyone?

Charles
12-30-2008, 08:28 AM
anyone?Not without a good bit more information. It would seem that you have a syntax error in your XSL but you haven't share that with us.

cr7
12-30-2008, 12:56 PM
Hi there thank you for your reply here is my syntax for my xslt page, please any help would be great thanks...


<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="b.xsl" ?>
<mypage connection="oracle" xmlns:xsql="urn:oracle-xsql">
<xsql:query>
<![CDATA[
SELECT
m.dbmp3playertype AS "mp3playertype",
CURSOR(
SELECT
t.dbtrackid as "trackid",
t.dbtrackname as "trackname"
FROM track t
WHERE
t.dbtrackonplayer = m.dbmp3playerid
) AS "mp3players"
FROM mp3player m
]]>
</xsql:query>
</mypage>

Charles
12-30-2008, 01:09 PM
That's not XSL; Do you have a file "b.xsl"?

cr7
12-30-2008, 01:48 PM
My bad... This will through an error... or even a simple "rowset" or "/" will through an error, what I am trying to do is to list each track under the 2 mp3players, but this just wont work as it through an error which is

XML Parsing Error: syntax error
Line Number 2, Column 1:
random35Lonely36Stumble37Dig A Hole39Steves Critique47Insomnia48Mass Destruction49God Is A DJ64Middl etc


<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/rowset">
</xsl:template>
</xsl:stylesheet>

cr7
12-30-2008, 06:46 PM
Hey Charles after hours I got it to show up on my screen. There are two lists with two heading called tracks. But instead of tracks I want the mp3players name two show as a title so Tiny and Random being the titles.

cr7
12-31-2008, 08:33 AM
got it working.