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

RE: two questions

Subject: RE: two questions
From: "Lars Huttar" <lars_huttar@xxxxxxx>
Date: Fri, 23 May 2003 14:23:18 -0500
select non distinct
> 1) I have an XML doc that has several non-distinct
> values under one distinct element.
> 
> <dsml:attr name="cn"><dsml:value>David 
> Godbey</dsml:value><dsml:value>David J
> Godbey</dsml:value><dsml:value>David J 
> Godbey-1</dsml:value><dsml:value>dgodbey</dsml:value></dsml:attr>
> 
> What I need to do is figure out a way to access the
> node that has the "-1" in it. I would like to do this
> in a template rule, i.e.
> 
> <xsl:apply-templates select="dsml:attr[@name='cn']???"
> />
> 
> but I have no idea how to do that. Can I do that? If
> not, how else can I get to that value?

<xsl:apply-templates select="dsml:attr[@name='cn']/
    dsml:value[contains(., '-1')]" />

> 2) I have an element that contains a list of values
> separated by a comma "," and then a colon ":"
> 
> <dsml:attr name="userClass">
> <dsml:value>Organization: CI-1, Employer:
> SAICIS</dsml:value></dsml:attr>
> 
> Again, I would like to somehow make a template rule to
> access both of these as separate templates, i.e. 
> 
> <xsl:apply-templates
> select="dsml:attr[@name='userClass']???" />
> 
> but I have no idea how to do that. Can I do that? If
> not, how else can I get to that value?

I'm not sure what you want to do ...
Do you want to select a <dsml:value> node whose
Organization is "CI-1", for example?

<xsl:apply-templates select="dsml:attr[@name='userClass']/
  dsml:value[contains(., 'Organization: CI-1')]" />

Or do you want a template that matches any <dsml:value>
and extracts the field/value pairs like
('Organization', 'CI-1')
('Employer', 'SASCIS') etc.
?

Lars


 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.