Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] Select value from document

From: "Michael Kay" <mike@------------>
To:
Date: 3/2/2006 2:07:00 PM
If you need repeatedly to find nodes given some value, then keys are the
right answer. You haven't explained your problem well enough to know whether
this applies.

Think of keys as follows: if you want (repeatedly) to find the employee with
a given employee number, then "match" should be a pattern than matches
employees, and "use" should be an XPath expression which, starting from an
employee element, returns the employee number. Give the key an arbitrary
name K, and you can then find the employee whose number is $emp-nr as
key('K', $emp-nr).

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: geoff hopkins [mailto:geoffhopkins123@xxxxxxxxx] 
> Sent: 02 March 2006 12:59
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Select value from document
> 
> I am processing a xml document to a new xml document.
> 
> But at one processing point I need to select a node
> containing a specific piece of text in a completly
> different position to the current position.
> 
> My first thought was keys (is there a better way).
> 
> I am currently struggling on how to use them....
> 
> this is what I have come up with so far....
> 
> def key:
> <xsl:key "a" match="data[contains(.,'Name:')] use ?
> "/>
> 
> using key func
> <xsl:value-of select="key('a',? "/>
> 
> 
> example of doc
> 
> <root>
> <data>
> Discipline or report series#10</data>
> <data>SOFTWARE DESIGN REPORT
> Document number#12</data>
> <data>SWD 1111
> Issue#13</data>
> <data>13
> Title#15</data>
> <data>	Name: DSSALD
> Authors#20</data>
> <data>Summary#60</data>
> <data></data>
> <data></data>
> <data>This process is intended to:</data>
> <data></data>
> <data>Generate the final high or low idle N3 select
> signal to be used throughout the control laws.</data>
> <data></data>
> <data>Generate a flag to indicate when the engine is
> above/below idle.</data>
> <data></data>
> <data></data>
> <data></data>
> </root>
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent