SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : XML Technologies :

Previous DiscussionNext Discussion
 XML referencing

I want to take my xml file, and convert it into an html file via XSLT/stylesheets. 

To keep the size of my xml file down, I'd like to have something like this:

<goal>
 <player playerid="2"/>
 <goaltime>10:12</goaltime>
</goal>
<teamroster>
<player playerid="2">
   <firstname>mike</firstname>
   <lastname>jones</lastname>
</player>
<player playerid="3">
   <firstname>jim</firstname>
   <lastname>smith</lastname>
</player>
</teamroster>

Rather than this:

<goal>
 <player playerid="2">
   <firstname>mike</firstname>
   <lastname>jones</lastname>
</player>
 <goaltime>10:12</goaltime>
</goal>
<teamroster>
<player playerid="2">
   <firstname>mike</firstname>
   <lastname>jones</lastname>
</player>
<player playerid="3">
   <firstname>jim</firstname>
   <lastname>smith</lastname>
</player>
</teamroster>

I'd prefer not to duplicate all the player information each time I need to describe someone.

I want my final HTML file however to have the player name display with each goal, but within the <goal> element I am only including the playerid attribute there, and hoping that I can extract the name information by referencing the <player> element within the teamroster element with the same playerid attribute.

Is this possible, and how would it be done?

Thanks

Started By dredesigns on Sep 6, 2005 at 1:01:35 PM

1 Response(s) | Reply

Earlier Replies | Replies 1 to 1 of 1 | Later Replies
hazarathreddy11 on Oct 14, 2005 at 5:41:07 AM (# 1)

fine.

I hav a solution for u.

Let me explain..

Remove the '<goal>' element ,as well as the duplicates and do the following.

Add an extra attribute to the element '<player>' like this...

<player playerid="2" goal="yes">

 or

<player playerid="2" goal="no">

Do u und'stand?? I have added an extra attribute goal="no" or goal="yes" to the element <player>.

So later ...during XSLT time...we can find the names of the players using a simple Xpath expression --------->   //player[@goal='yes']/firstname

Hope u understand.

if not ...feel free to mail me at hazarath@hotmail.com

takecare................. & c u.

 

 

 

 


Earlier Replies | Replies 1 to 1 of 1 | Later Replies

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2004 InsideDHTML.com, LLC. All rights reserved.