[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Creating internal lists

Subject: RE: Creating internal lists
From: Sundar Shanmugasundaram <SSHANMUGASUNDARAM@xxxxxxxxxxxxx>
Date: Mon, 28 Apr 2003 19:14:35 +0530
internal lists
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" indent="yes" /> 	
  
<xsl:template match="o">
<xsl:variable name="item" select="'item'"/>
<xsl:for-each select="CITATION">
	<xsl:variable name="citationid">
		<xsl:value-of select="@id"/>
	</xsl:variable>
	<xsl:element name="{concat('item',@id)}">
	<xsl:for-each select="../CITEREF[@rid=$citationid]">
		<xsl:element name="{concat('item',@id)}"/>

	</xsl:for-each>
	</xsl:element>
</xsl:for-each>

</xsl:template>
</xsl:stylesheet>

for the xml file
<?xml version="1.0"?>
<o>
<CITATION id="c9"/>
<CITATION id="c10"/>
<CITEREF id="cr9-1" rid="c9"/>
<CITEREF id="cr9-2" rid="c10"/>
</o>

Does this help you?

sundar

-----Original Message-----
From: Shellenberger, Mark [mailto:MShellenberger@xxxxxxx]
Sent: Monday, April 28, 2003 6:12 PM
To: 'XSL-List@xxxxxxxxxxxxxxxxxxxxxx'
Subject:  Creating internal lists


At least this is what I think I am trying to do.....

I am trying to take a large document and convert it into something much
smaller.  The document has a References list and then citations within the
document body.  I want to create a list where each citation in the
References is matched up with all instances of matching citation references
in the body.

The citation elements are like this:
<CITATION ID="c9">

The reference elements are like this:
<CITEREF ID="cr9-1" RID="c9">

I want the end result to be like this:

item 9
  item9-1

item10
  item10-1
  item10-2
  item10-3

item11
  item11-1
  item11-2

I am not even sure what to call this....thus looking within the FAQ/Archives
and at Developerworks, and XML.com/.org has been difficult at best.

Any suggestions or assistance is greatly appreciated.  Heck just tell me
where to read about it and I will be eternally grateful.

Thanks,
Mark


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.