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:
Dell PowerEdge Servers
  #1  
Old April 15th, 2008, 01:47 PM
Hysteria86 Hysteria86 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 111 Hysteria86 User rank is Lance Corporal (50 - 100 Reputation Level)Hysteria86 User rank is Lance Corporal (50 - 100 Reputation Level)Hysteria86 User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 3 h 23 m 43 sec
Reputation Power: 3
XSL Group Results

Hi I'm trying to produce some XSLT output, I have some search results that return an item and a number of keywords associated with it. It works fine but the results print each keyword out separately with the result instead of as a group.
For example.

Result 1 - http://www.csd.abdn.ac.uk/~sttaylor...amily.owl#Woman - person
Result 2 - http://www.csd.abdn.ac.uk/~sttaylor...amily.owl#Woman - female
Result 3 - http://www.csd.abdn.ac.uk/~sttaylor...amily.owl#Woman - woman

How can I group together all keywords with the correct item as opposed to printing them out individually?
E.g.
Result 1 - http://www.csd.abdn.ac.uk/~sttaylor...amily.owl#Woman - person female woman


Thanks

The XML
Code:
- <rdf:Description rdf:about="http://www.csd.abdn.ac.uk/~sttaylor/simplefamily.owl#Woman">
  <os:hasKeyword>person</os:hasKeyword> 
  <os:hasKeyword>female</os:hasKeyword> 
  <os:hasKeyword>woman</os:hasKeyword> 
  <rdf:type rdf:resource="http://www.csd.abdn.ac.uk/~sttaylor/taggr.owl#Result" /> 
  </rdf:Description>
- <rdf:Description rdf:about="http://www.csd.abdn.ac.uk/~sttaylor/simplefamily.owl#Boy">
  <os:hasKeyword>young</os:hasKeyword> 
  <os:hasKeyword>boy</os:hasKeyword> 
  <os:hasKeyword>man</os:hasKeyword> 
  <rdf:type rdf:resource="http://www.csd.abdn.ac.uk/~sttaylor/taggr.owl#Result" /> 
  </rdf:Description>
- <rdf:Description rdf:about="http://www.csd.abdn.ac.uk/~sttaylor/simplefamily.owl#Male">
  <os:hasKeyword>male</os:hasKeyword> 
  <os:hasKeyword>animal</os:hasKeyword> 
  <rdf:type rdf:resource="http://www.csd.abdn.ac.uk/~sttaylor/taggr.owl#Result" /> 
  </rdf:Description>



XSLT I'm using
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:tgr="http://www.csd.abdn.ac.uk/~sttaylor/taggr.owl#" 
xmlns:os="http://www.ontosearch.org/NS/">
<xsl:template match="/rdf:RDF">

  <html>
  <body>
    <h2>Results</h2> 
    <table border="1">
      <tr bgcolor="#9acd32">
        <th align="left">Description</th> 
        <th align="left">Keywords</th> 
      </tr>
      <xsl:for-each select="rdf:Description">
      <tr>
	<td><xsl:value-of select="@rdf:about" /></td>
        <td><xsl:value-of select="os:hasKeyword" /></td>
       
      </tr>
      </xsl:for-each>
  </table>
  </body>
  </html>
</xsl:template></xsl:stylesheet> 

Reply With Quote
  #2  
Old April 16th, 2008, 09:46 AM
jkmyoung jkmyoung is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 474 jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level)jkmyoung User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 18 m 31 sec
Reputation Power: 52
Code:
<td>
  <xsl:for-each select="os:hasKeyword">
    <xsl:value-of select="." />
    <xsl:text> </xsl:text>
  </xsl:for-each>
</td>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XSL Group Results


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





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