This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

=?gb2312?B?tPC4tDogWFNMLUxpc3QgRGlnZXN0IFY0ICM0MTU=?=


I will go later,about 7:30,ok?

-----邮件原件-----
发件人: XSL-List Digest [mailto:owner-xsl-list-digest@lists.mulberrytech.com] 
发送时间: 2002年6月5日 14:30
收件人: xsl-list-digest@lists.mulberrytech.com
主题: XSL-List Digest V4 #415

XSL-List Digest        Wednesday, June 5 2002        Volume 04 : Number 415



In this issue:

     [xsl] Pass an element based on its childrens content
     [xsl] Pass an element based on its childrens content
     Re: [xsl] Pass an element based on its childrens content
     Re: [xsl] back again: child nodes in variable
     [xsl] fo:page-sequence usage
     RE: [xsl] Elements of non-actual position
     Re: [xsl] What is %26 doing in my HTML?

----------------------------------------------------------------------

Date: Tue, 4 Jun 2002 18:29:17 -0400 
From: "CROFT, MICHAEL" <MCROFT@amica.com>
Subject: [xsl] Pass an element based on its childrens content

I need to pass an element to a template based on a condition where its
children would contain certain text(an id).  Here is an example xml element
I would need to pass....

<ListOfInsClaimsElements>
				<InsClaimsElements>
					<AssignmentDate/>
					<AssignmentExcluded/>
					<ClaimCoverage>Bodily
Injury</ClaimCoverage>
					<ClaimElementLimit/>
					<ClaimId>1-14YMG</ClaimId>
					<Claimant>Abrams</Claimant>
	
<ClaimantFirstName>Nancy</ClaimantFirstName>
					<ClaimantId/>
					<ContactId>1-16HHT</ContactId>
					<CurrencyCode>USD</CurrencyCode>
					<ElementClosedDate/>
	
<ElementDeductible>100</ElementDeductible>
				</InsClaimsElements>
				<InsClaimsElements>
					<AssignmentDate/>
					<AssignmentExcluded/>
					<ClaimCoverage>Bodily
Injury</ClaimCoverage>
					<ClaimElementLimit/>
					<ClaimId>1-14YMG</ClaimId>
					<Claimant>Abrams</Claimant>
	
<ClaimantFirstName>Nancy</ClaimantFirstName>
					<ClaimantId/>
					<ContactId>1-16HHT</ContactId>
					<CurrencyCode>USD</CurrencyCode>
					<ElementClosedDate/>
	
<ElementDeductible>100</ElementDeductible>
				</InsClaimsElements>
</ListOfInsClaimsElements>		

I need to find the list of claims elements (ListOfInsClaimsElements) which
contains the claims (InsClaimsElements) that Im interested in (ClaimId).
THen I would pass this entire list to a called template for processing.
THere are multiple lists within the xml document each with possible multiple
claims but each list of claims only belongs to one claimant.

Mike



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the sender and postmaster@amica.com.
**********************************************************************
 


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

------------------------------

Date: Tue, 4 Jun 2002 19:13:41 -0400 
From: "CROFT, MICHAEL" <MCROFT@amica.com>
Subject: [xsl] Pass an element based on its childrens content

I need to pass an element to a template based on a condition where its
children would contain certain text(an id).  Here is an example xml element
I would need to pass....

<ListOfInsClaimsElements>
				<InsClaimsElements>
					<AssignmentDate/>
					<AssignmentExcluded/>
					<ClaimCoverage>Bodily
Injury</ClaimCoverage>
					<ClaimElementLimit/>
					<ClaimId>1-14YMG</ClaimId>
					<Claimant>Abrams</Claimant>
	
<ClaimantFirstName>Nancy</ClaimantFirstName>
					<ClaimantId/>
					<ContactId>1-16HHT</ContactId>
					<CurrencyCode>USD</CurrencyCode>
					<ElementClosedDate/>
	
<ElementDeductible>100</ElementDeductible>
				</InsClaimsElements>
				<InsClaimsElements>
					<AssignmentDate/>
					<AssignmentExcluded/>
					<ClaimCoverage>Bodily
Injury</ClaimCoverage>
					<ClaimElementLimit/>
					<ClaimId>1-14YMG</ClaimId>
					<Claimant>Abrams</Claimant>
	
<ClaimantFirstName>Nancy</ClaimantFirstName>
					<ClaimantId/>
					<ContactId>1-16HHT</ContactId>
					<CurrencyCode>USD</CurrencyCode>
					<ElementClosedDate/>
	
<ElementDeductible>100</ElementDeductible>
				</InsClaimsElements>
</ListOfInsClaimsElements>		

I need to find the specific list of claims elements
(ListOfInsClaimsElements) which contains the claims (InsClaimsElements) that
Im interested in (ClaimId).  There are multiple lists
(ListOfInsClaimsElements) within the xml document each containing possible
multiple claims (InsClaimsElements) but each list of claims belongs only to
one claimant.  So if Im working with Claimant A, I need to find the list
that contains Claimant A claims(i.e <ClaimId>A</ClaimId>), and pass the
entire list holding those claims (ListOfInsClaimsElements) to a template for
processing.

Mike





**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the sender and postmaster@amica.com.
**********************************************************************
 


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

------------------------------

Date: Tue, 4 Jun 2002 19:00:33 -0600 (MDT)
From: Mike Brown <mike@skew.org>
Subject: Re: [xsl] Pass an element based on its childrens content

CROFT, MICHAEL wrote:
> I need to pass an element to a template based on a condition where its
> children would contain certain text(an id).  

<xsl:param name="cid"/>  <!-- $cid comes from somewhere.. it is either a
                              string or a node-set containing the claim
                              IDs to find. it doesn't have to be a param -->

<!-- template to process the root node (always the first node processed) -->
<xsl:template match="/">
  <!-- go process the matching InsClaimElements elements, one at a time -->
  <xsl:apply-templates select="ListOfInsClaimsElements/InsClaimsElements[ClaimId=$cid]"/>
</xsl:template>

<!-- template to process an InsClaimsElements element -->
<xsl:template match="InsClaimsElements">
  <result>
    <xsl:text>The claim ID is </xsl:text>
    <xsl:value-of select="ClaimId"/>
    <xsl:text>and the claimant is </xsl:text>
    <xsl:value-of select="concat(ClaimantFirstName,' ',Claimant,'.')"/>
  </result>
</xsl:template>

> I need to find the list of claims elements (ListOfInsClaimsElements) which
> contains the claims (InsClaimsElements) that Im interested in (ClaimId).

The above will work even if $cid is a node-set.

> THen I would pass this entire list to a called template for processing.

The way XSLT works, you generally just select nodes for processing
with xsl:apply-templates or xsl:for-each. Select the right nodes, and
have a template to match them. You don't need to pass node-sets as
parameters to named templates.

> THere are multiple lists within the xml document each with possible multiple
> claims but each list of claims only belongs to one claimant.

See the FAQ at www.dpawson.co.uk for more sorting and grouping examples.

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

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

------------------------------

Date: Tue, 4 Jun 2002 19:01:31 -0600 (MDT)
From: Mike Brown <mike@skew.org>
Subject: Re: [xsl] back again: child nodes in variable

Greg Newton wrote:
> Mike - I think the NOT will guarantee empty output:
> 
> <xsl:variable name="conhijos" select="mercados/mercado[not(subyacentes/*)]"/>
> 
> 
> Shouldn't it be:
> 
> <xsl:variable name="conhijos" select="mercados/mercado[subyacentes/*]"/>

Yes, that's what I meant. I misread his email.

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

------------------------------

Date: Tue, 4 Jun 2002 21:14:23 -0400
From: "Matthew L. Avizinis" <mla@gleim.com>
Subject: [xsl] fo:page-sequence usage

Hello all,
  Here's my situation:
  I have an outline.xml and a question.xml.  The data from each is combined
via xslt into a single fo file which is then use for pdf generation.
  Typically, the outline information is in one page sequence and questions
are in another in order to insure that they start on a new page, but also so
that I have the opportunity to use different page headers in the
static-content area (but this isn't essential).  But really I guess the main
reason is to make pdf generation less memory intensive.
  However, it now appears that some chapters do not start questions on a new
page.  The code between the <fo:page-sequence> and </fo:page-sequence>
remains the same in either case.  However, what it looks like I need to be
able to do is not use the fo:page-sequence element in certain cases.  So,
here's what I need to be able to do --
  <fo:page-sequence>
    code to generate outline fo
  </fo:page-sequence>
  <fo:page-sequence><!-- if questions should start on a new page -->
    code to generate questions fo
  </fo:page-sequence>

<!-- if questions should continue from the last page of outline -->
  <fo:page-sequence>
    code to generate outline fo
    code to generate questions fo  <!-- this code is the same as above, but
can be quite long -->
  </fo:page-sequence>

Does anybody have any suggestions for handling this condition in an
efficient manner?
thanks much,
   Matthew L. Avizinis <mailto:mla@gleim.com>
Gleim Publications, Inc.
   4201 NW 95th Blvd.
 Gainesville, FL 32606
(352)-375-0772 ext. 101
      www.gleim.com <http://www.gleim.com>


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

------------------------------

Date: Wed, 5 Jun 2002 11:46:50 +1000
From: "Michael Leditschke" <mike@ammd.com.au>
Subject: RE: [xsl] Elements of non-actual position

Hi Joerg. Isn't there a level missing here? Shouldn't it be
<xsl:template match="table/rows/row">
  <xsl:for-each select="col">

Otherwise pos is the row number not the column number.

Regards
Michael

> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com 
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Joerg Heinicke
> Sent: Wednesday, 5 June 2002 5:55 AM
> To: xsl-list@lists.mulberrytech.com
> Subject: Re: [xsl] Elements of non-actual position
> 
> 
> <xsl:template match="table/rows">
>    <xsl:for-each select="row">
>      <xsl:variable name="pos" select="position()"/>
>      <xsl:if test="/table/cols/col[$pos]/@visible = '1'">
>        do what you want
>      </xsl:if>
>    </xsl:for-each>
> </xsl:template>
> 
> Regards,
> 
> Joerg
> 
> Rudolf Pischek wrote:
> > Hi, 
> > I have a problem of searching in my XML data:
> > <table>
> >   <cols>
> >     <col visible="1"/>
> >     <col visible="1"/>
> >     <col visible="1"/>
> >     <col visible="0"/>
> >     <col visible="1"/>
> >     <col visible="1"/>
> >     <col visible="0"/>
> >   </cols>
> >   <rows>
> >     <row>
> >       <cell>1</cell>
> >       <cell>2</cell>
> >       <cell>3</cell>
> >       <cell>4</cell>
> >       <cell>5</cell>
> >       <cell>6</cell>
> >       <cell>7</cell>
> >     </row>
> >     <row>
> >       ...
> >     </row>
> >     ...
> >   </rows>
> > </table>
> > 
> > and if I have a template:
> > 
> > <xsl:template match="table/rows">
> >   <!-- and I want in for-each: Give me all elements cell which 
> position is the same as the position of elements cols which 
> attribute visible is 1 -->
> >   <xsl:for-each="...">
> >     <!-- than this for-each must contain: cell 1, cell 2, cell 
> 3, cell 5, cell 6 -->
> > 
> >   </xsl:for-each>
> > </xsl:template>
> > 
> > I have no idea how I can get elements, one element I can...
> > Thanks very much
> > Rudolf
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 


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

------------------------------

Date: Tue, 4 Jun 2002 19:14:50 -0700
From: Zack Brown <zbrown@tumblerings.org>
Subject: Re: [xsl] What is %26 doing in my HTML?

On Tue, Jun 04, 2002 at 05:08:44PM -0600, Mike Brown wrote:
> Michael Kay wrote:
> > What XSLT processor are you using?
> 
> The message you quoted said
> 
> > > [zbrown] ~/work/KT/source/xslt/tmp$ xsltproc names.xsl 1.xml 
> > > <a href="%26amp;">&amp;</a>
> 
> Zack - I'm unable to reproduce this error, with the same stylesheet and source
> file. Perhaps you just aren't using a new enough version of xsltproc?

On my Debian system xsltproc returns the following version info:

19:06:34 [zbrown] ~/site$ xsltproc --version
Using libxml 20420, libxslt 10016 and libexslt 707
xsltproc was compiled against libxml 20419, libxslt 10016 and libexslt 707
libxslt 10016 was compiled against libxml 20419
libexslt 707 was compiled against libxml 20419
19:06:35 [zbrown] ~/site$ 

Also Debian's package handler reports the version as:

xsltproc 1.0.16

It looks difficult to find out the current version of xsltproc, as it
appears to be bundled as part of libxslt.

> 
>    - Mike
> ____________________________________________________________________________
>   mike j. brown                   |  xml/xslt: http://skew.org/xml/
>   denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

- -- 
Zack Brown

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

------------------------------

End of XSL-List Digest V4 #415
******************************


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]