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]

Re: ordering and iteration problem



It was a pleasant suprise to see some of my code cited.


Jeni Tennison writes:

[...]

 > So I'd adapt the keys to include information about the parent
 > circuit-breaker-panel of the circuit-breaker, as follows:
 > 
 > <xsl:key name="breakers-by-column" match="b:circuit-breaker"
 >          use="concat(generate-id(parent::b:circuit-breaker-panel),
 >                      ':', @column)" />
 > <xsl:key name="breakers" match="b:circuit-breaker"
 >          use="concat(generate-id(parent::b:circuit-breaker-panel),
 >                      @row, ':', @column)" />
 > 
 > If a circuit-breaker-panel was given an ID of 'abc' then you could get
 > the circuit breaker in the first cell in the first row with:
 > 
 >   key('breakers', 'abc:1:1')

I take it that the generate-id() is needed because there is no other
way to test for node identity?

Rather than using concat() to generate a compound key, would it also
work to use the same key as before but then select from the resulting
node-set only the circuit-breaker with the right parent?



 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]