Re: AW: AW: [xsl] Display order

Subject: Re: AW: AW: [xsl] Display order
From: "Joseph Tan" <Joseph.Tan@xxxxxxxxxxxxxxxxxx>
Date: Wed, 10 Sep 2003 13:04:05 -0500
No.1 is correct...and <B4> containing ONLINELIB is not counted as well.

Thanks 

Joseph

>>> abt@xxxxxxxx Saturday, September 06, 2003 9:22:06 AM >>>
Well, the "and so on" is not so clear to me. There are four <B4> and
seven <B5>.

I can think of two correlations:

1. the n-th <B4> corresponds to the n-th <B5>, where the <B5>
containing
   "NC-JOURNAL --", "LIBWEBSITE --" or "JOURNALS --" are not counted.

2. The ending " --" signals that this <B5> and the following <B5>
belong to the
    same logical record.

Both of my interpretations would of course give the same result in this
special
case, but not in the general case.

Which one is correct?

Cheers,
Markus
__________________________
Markus Abt
Comet Computer GmbH
http://www.comet.de 


----------
Von: 	Joseph Tan
Gesendet: 	Freitag, 5. September 2003 17:13
An: 	abt@xxxxxxxx; xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
Betreff: 	Re: AW: [xsl] Display order

OK, got a slightly different input:

<B1>American journal of cardiology.</B1> 
<B4>NORTHLIB</B4> 
<B4>ONLINELIB</B4> 
<B4>ONLINELIB</B4> 
<B4>SOUTHLIB</B4> 
<B5>NC-JOURNAL --</B5> 
<B5>Vol 71-86 1993-2000 Not owned: 71n18(1993)</B5> 
<B5>Online access; years vary.</B5> 
<B5>LIBWEBSITE --</B5> 
<B5>Online access; years vary.</B5> 
<B5>JOURNALS --</B5> 
<B5>Vol 1- 1958- Not Owned: 84n5c(1999)</B5> 
<B6>Am. j. cardiol.</B6> 
<B6>Am. j. cardiol.</B6> 

We know that the first the occurance of B4 always conincide with the
first occurance of B5 and so on.. 

Joseph

>>> abt@xxxxxxxx Thursday, August 28, 2003 5:24:49 PM >>>
Hi,

how should one deduce this:
  South Campus Library, Vol 1- 1958- Not Owned: 84n5c(1999),
  North Campus Library, Vol 71-86 1993-2000 Not owned: 71n18(1993)

from this input?
  <B4>NC-JOURNAL --</B4> 
  <B4>Vol 71-86 1993-2000 Not owned: 71n18(1993)</B4> 
  <B4>Online access; years vary.</B4> 
  <B4>LIBWEBSITE --</B4> 
  <B4>Online access; years vary.</B4> 
  <B4>JOURNALS --</B4> 
  <B4>Vol 1- 1958- Not Owned: 84n5c(1999)</B4> 
  <B4>NORTHLIB</B4> 
  <B4>ONLINELIB</B4> 
  <B4>ONLINELIB</B4> 
  <B4>SOUTHLIB</B4> 

Sorry, but insist on getting a senseful input!!
(or ask your local Oracle?)


Cheers,
Markus
__________________________
Markus Abt
Comet Computer GmbH
http://www.comet.de 


----------
Von: 	Joseph Tan
Gesendet: 	Donnerstag, 28. August 2003 22:40
An: 	xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
Betreff: 	[xsl] Display order

How do I achieve the display below. (this is a record retrieved from
the
library catalog)

Holdings: South Campus Library, Vol 1- 1958- Not Owned: 84n5c(1999),
North Campus Library, Vol 71-86 1993-2000 Not owned: 71n18(1993) 

Current display: 

Holdings:Vol 71-86 1993-2000 Not owned: 71n18(1993), Vol 1- 1958- Not
Owned: 84n5c(1999), North Campus Library, South Campus Library

XSL code:

<xsl:template name="DisplayRemainder">
	<xsl:param name="items"/>
	<xsl:variable name="separator1" select="', '"/>
	<xsl:variable name="separator2" select="'; '"/>

	<br/>
	<xsl:choose>
		<!-- ##### IF RECORD IS FROM LIBRARY CATALOG
########-->
		<xsl:when test="DBN='Library catalog'">
			<xsl:text>Holdings:</xsl:text> 
			<xsl:for-each
select="$items[text()!='ONLINELIB'
and text()!='JOURNALS --' and text()!='LIBWEBSITE --' and
text()!='Online access; years vary.' and text()!='NC-JOURNAL --']">
							
				<xsl:choose>
					<xsl:when
test="contains(.,'SOUTHLIB')">South Campus Library</xsl:when>	
					<xsl:when
test="contains(.,'NORTHLIB')">North Campus Library</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="text()"/>
				</xsl:otherwise>
				</xsl:choose>
							
				<xsl:if test="position() != last()">
						<xsl:variable
name="pos"
select="position()"/>
						<xsl:variable
name="next" select="$items[$pos+1]"/>
					<xsl:choose>
						<xsl:when test="name()
=
name($next)"><xsl:value-of select="$separator1"/></xsl:when>
						<xsl:otherwise><xsl:value-of
select="$separator2"/></xsl:otherwise>
					</xsl:choose>
				</xsl:if>
			</xsl:for-each>
		</xsl:when>
		
		<!-- ##### IF RECORD IS FROM EJOURNALS COLLECTION 
######-->
		<xsl:otherwise>
			<xsl:for-each select="$items[name()='B2']">
				<xsl:call-template name="DisplayItem"/>
			</xsl:for-each>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

XML Input:

<SETTAGS num="1">
  <CL>1</CL> 
  <RI>2</RI> 
  <OI>100000016</OI> 
  <POI>0</POI> 
  <CI>0</CI> 
  <LCI>0</LCI> 
  <RR>100</RR> 
  <OTI>4</OTI> 
  <B1>American journal of cardiology.</B1> 
  <B4>NC-JOURNAL --</B4> 
  <B4>Vol 71-86 1993-2000 Not owned: 71n18(1993)</B4> 
  <B4>Online access; years vary.</B4> 
  <B4>LIBWEBSITE --</B4> 
  <B4>Online access; years vary.</B4> 
  <B4>JOURNALS --</B4> 
  <B4>Vol 1- 1958- Not Owned: 84n5c(1999)</B4> 
  <B4>NORTHLIB</B4> 
  <B4>ONLINELIB</B4> 
  <B4>ONLINELIB</B4> 
  <B4>SOUTHLIB</B4> 
  <B5>Am. j. cardiol.</B5> 
  <B5>Am. j. cardiol.</B5> 
  <DBC>LIBCAT</DBC> 
  <DBN>Library catalog</DBN> 
  </SETTAGS>

No, the xml input does not appear to be same for every record but if
an
item is available at both NORTHLIB and SOUTHLIB, it should have very
similar input as above.

Thanks!

Joseph 


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



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


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



 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