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 September 30th, 2003, 08:57 AM
mufid mufid is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Brasov
Posts: 1 mufid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
some kind of search

I encountered a problem trying to create a complex (for me) XSL.

There are 3 files to be created if someone wants to "solve" my problem.

index.htm
-------------------------
<html>
<body>
<a href="catalog.xml">click here</a>
</body>
</html>



catalog.xml
-------------------------
<?xml version="1.0"?>

<?xml-stylesheet type="text/xsl" href="formatare.xsl"?>

<CATALOG>

<GALERIE id="George">

<TITLU>gal 01</TITLU>

<PERSOANE>George</PERSOANE>

<CATEGORII>aaa, bbb, zzz</CATEGORII>

<COMENTARIU>c1</COMENTARIU>

<NRPOZE>1</NRPOZE>

</GALERIE>

<GALERIE id="Mihai, George">

<TITLU>gal 02</TITLU>

<PERSOANE>Mihai, George</PERSOANE>

<CATEGORII>zzz, ccc</CATEGORII>

<COMENTARIU>c2</COMENTARIU>

<NRPOZE>4</NRPOZE>

</GALERIE>

<GALERIE id="Mihai, Vasile">

<TITLU>gal 03</TITLU>

<PERSOANE>Mihai, Vasile</PERSOANE>

<CATEGORII>xxx</CATEGORII>

<COMENTARIU>c3</COMENTARIU>

<NRPOZE>5</NRPOZE>

</GALERIE>

</CATALOG>


and


formatare.xsl
---------------------------------

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xslutput method="html" omit-xml-declaration="yes"/>



<xsl:template match="/">

<html>

<head>

<script>

var i = 1;

var cecaut = document.location.href.split("=");

var aiasta = cecaut[1];

function asta() {

}

</script>

</head>

<body>

<font face="Verdana, Arial" size="4">Pornstar collection</font>

<form method="GET">

<table cellpadding="4" cellspacing="4" border="0"><tr>

<td><input type="text" name="cauta" value="" /></td><td><input type="submit" value="Cauta" action="javascript:asta()"/></td>

</tr></table>

</form>

-----------------------------------------------------------

<xsl:apply-templates/>

</body>

</html>

</xsl:template>




<xsl:template match="GALERIE">


<form>

<input type="text" name="ceval" value="{@id}"/>

</form>


<script>
var xxx = document.forms[i].ceval.value;
var yyy = xxx.indexOf(aiasta);
if (yyy>=0) {
document.write('ok');
};
i++;
</script>

<p><font face="Verdana, Arial" size="2">

<xsl:apply-templates select="PERSOANE"/>

<xsl:apply-templates select="TITLU"/>

</font></p>

----------------------------------------

</xsl:template>




<xsl:template match="PERSOANE">

Protagoniste: <b><xsl:value-of select="."/></b><br/>

</xsl:template>



<xsl:template match="TITLU">

Galeria: <b><xsl:value-of select="."/></b><br/><br/>

</xsl:template>



</xsl:transform>


THE PROBLEM: I want to be displayed

<xsl:apply-templates select="PERSOANE"/>

and

<xsl:apply-templates select="TITLU"/>

only when yyy>=0 (from JS; like it's writing "ok")

HELP ME PLEASE!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > some kind of search


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 5 hosted by Hostway
Stay green...Green IT