XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 11th, 2004, 06:53 AM
dadelcas dadelcas is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Venezuela
Posts: 95 dadelcas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 28 sec
Reputation Power: 6
XSL params

Hi people...

I'm trying to pass parameters to my XSL sheet. This is a part of my code:

PHP Code:
function XML2HTML($XMLData$XSLFilePath$XSLParams)

    
$arguments = array('/_xml'=>$XMLData);
    
$xsltproc xslt_create();
    
xslt_set_encoding($xsltproc'ISO-8859-1');
    
$html xslt_process($xsltproc'arg:/_xml'"$XSLFilePath"NULL$arguments$XSLParams);
    if(empty(
$html))
        return 
'';
    
xslt_free($xsltproc);
    return 
$html;


function 
makequery($SQL)
{
$DB mysql_pconnect('localhost''jeje''jeje');
mysql_select_db('DB'$DB);
$query mysql_query($SQL$DB);
return 
$query;
}

$userAlias = array();
$select 'SELECT Id, Login FROM Users';
$query makequery($select);
while(
$row mysql_fetch_row($query))
  
$userAlias['id'.$row[0]] = $row[1];
mysql_free_result($query);
//I'm passing the $XMLTable content from a webservice
$HTMLTable XML2HTML($XMLTable$AppPath.'Styles/UserList.xsl'$userAlias); 


the XML is someting like that

<USER>
<ID>1</ID>
</USER>
...
<USER>
<ID>2</ID>
</USER>

and this is a part of the XSL where I need refer the parameter:

<xsl:template match="USER">
<xsl:variable name="uid"><xsl:value-of select="ID" /></xsl:variable>
<TR>
<TD><xsl:value-of select="id{$uid}" /></TD>
</TR>
</xsl:template>

But nothig is shown
What's wrong?

Thanks in advance...
__________________
-DdC

Reply With Quote
  #2  
Old January 13th, 2004, 12:07 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Didn't look through the php code, but <xsl:template match="USER"> won't match anything. It needs to be <xsl:template match="/USER">

Also,
Code:
<xsl:value-of select="id{$uid}" />
should be
Code:
<xsl:value-of select="$uid" />

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XSL params


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway