Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > [xsl] pleaz help

Reply
Thread Tools

[xsl] pleaz help

 
 
Tjerk Wolterink
Guest
Posts: n/a
 
      04-20-2005
I have xsl code like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlnssl="http://www.w3.org/1999/XSL/Transform"
xmlnsage="http://www.wolterinkwebdesign.com/xml/page"
xmlnsc="http://www.wolterinkwebdesign.com/xml/xcontent">

<xsl:include href="xsl/xhtml/standard.xsl"/>
<xsl:include href="xsl/xhtml/collectielib.xsl"/>

<!-- the file collectielib.xsl defines templates for xc:fauteuil elements -->

<xslutput method="xml" indent="yes"/>

<xslaram name="absolute_url"/>
<xslaram name="upload_url"/>
<xslaram name="cols" select="3"/>

<xsl:template match="/xccontent">
<pageage type="module">
<page:section>
<page:content>
<h2>Fauteuils</h2>
<center>
<table class="collectie">
<xsl:for-each select="./xc:fauteuil[(position() mod $cols)=1]">
<xsl:sort data-type="text" select="xc:naam" order="descending"
/>
<tr>
<xsl:apply-templates select="."/>
<xsl:apply-templates
select="following-sibling:c:fauteuil[position() &lt; $cols]"/>
</tr>
</xsl:for-each>
</table>
</center>

</page:content>
</page:section>
</pageage>
</xsl:template>
</xsl:stylesheet>



But with an XML input like this:


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

<!DOCTYPE xccontent [
<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"schema/xhtml/xhtml1-strict.dtd">%xhtml;]>

<xccontent xmlnsc="http://www.wolterinkwebdesign.com/xml/xcontent"
xmlns="http://www.w3.org/1999/xhtml" module="collectie">
<xc:content type="html">
<xc:empty/>
</xc:content>
<xc:fauteuil>
<xc:id>1</xc:id>
<xc:naam type="string"><![CDATA[test]]></xc:naam>
<xc:afmetingen type="string"><![CDATA[test]]></xc:afmetingen>
<xc:foto type="img" width="2592" height="1944"><![CDATA[Rutger
faut1.JPG]]></xc:foto>
<xc:content type="html">
etet
</xc:content>
</xc:fauteuil>
<xc:fauteuil>
<xc:id>2</xc:id>
<xc:naam type="string"><![CDATA[rutger]]></xc:naam>
<xc:afmetingen type="string"><![CDATA[rutger]]></xc:afmetingen>
<xc:foto type="img" width="2592" height="1944"><![CDATA[Rutger
faut2.JPG]]></xc:foto>
<xc:content type="html">
rr
</xc:content>
</xc:fauteuil>
<xc:fauteuil>
<xc:id>3</xc:id>
<xc:naam type="string"><![CDATA[rutger]]></xc:naam>
<xc:afmetingen type="string"><![CDATA[rutger]]></xc:afmetingen>
<xc:foto type="img" width="2592" height="1944"><![CDATA[Rutger
faut2.JPG]]></xc:foto>
<xc:content type="html">
rr
</xc:content>
</xc:fauteuil>
<xc:fauteuil>
<xc:id>4</xc:id>
<xc:naam type="string"><![CDATA[rutger]]></xc:naam>
<xc:afmetingen type="string"><![CDATA[rutger]]></xc:afmetingen>
<xc:foto type="img" width="2592" height="1944"><![CDATA[Rutger
faut2.JPG]]></xc:foto>
<xc:content type="html">
rr
</xc:content>
</xc:fauteuil>
<xc:fauteuil>
<xc:id>5</xc:id>
<xc:naam type="string"><![CDATA[rutger]]></xc:naam>
<xc:afmetingen type="string"><![CDATA[rutger]]></xc:afmetingen>
<xc:foto type="img" width="2592" height="1944"><![CDATA[Rutger
faut2.JPG]]></xc:foto>
<xc:content type="html">
rr
</xc:content>
</xc:fauteuil>
<xc:fauteuil>
<xc:id>6</xc:id>
<xc:naam type="string"><![CDATA[rutger]]></xc:naam>
<xc:afmetingen type="string"><![CDATA[rutger]]></xc:afmetingen>
<xc:foto type="img" width="2592" height="1944"><![CDATA[Rutger
faut2.JPG]]></xc:foto>
<xc:content type="html">
rr
</xc:content>
</xc:fauteuil>
<xc:fauteuil>
<xc:id>7</xc:id>
<xc:naam type="string"><![CDATA[rutger]]></xc:naam>
<xc:afmetingen type="string"><![CDATA[rutger]]></xc:afmetingen>
<xc:foto type="img" width="2592" height="1944"><![CDATA[Rutger
faut2.JPG]]></xc:foto>
<xc:content type="html">
rr
</xc:content>
</xc:fauteuil>
</xccontent>


----


now i want this to be sort of like this

<pageage type="module">
<page:section>
<page:content>
<h2>Fauteuils</h2>
<center>
<table class="collectie">
<tr>
- fauteuil1
- fauteuil2
- fauteuil3
</tr>
<tr>
- fauteuil4
- fauteuil5
- fauteuil6
</tr>
<tr>
- fauteuil7
</tr>
</xsl:for-each>
</table>
</center>

</page:content>
</page:section>
</pageage>




But the output is like this:


--

<pageage type="module">
<page:section>
<page:content>
<h2>Fauteuils</h2>
<center>
<table class="collectie">
<tr>
- fauteuil7
</tr>
<tr>
- fauteuil1
- fauteuil2
- fauteuil3
</tr>
<tr>
- fauteuil4
- fauteuil5
- fauteuil6
</tr>
</xsl:for-each>
</table>
</center>

</page:content>
</page:section>
</pageage>




----


i know i am asking much, but im stuck here.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Help Help Pentax S5i Help needed (Please) The Martian Digital Photography 14 06-20-2008 07:56 AM
HELP - HELP - HELP =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?= ASP .Net 4 03-09-2006 12:46 PM
HELP WANTED HELP WANTED HELP WANTED Harvey ASP .Net 1 07-16-2004 01:12 PM
HELP WANTED HELP WANTED HELP WANTED Harvey ASP .Net 0 07-16-2004 10:00 AM
HELP! HELP! HELP! Opening Web Application Project Error =?Utf-8?B?dHJlbGxvdzQyMg==?= ASP .Net 0 02-20-2004 05:16 PM



Advertisments