469,344 Members | 5,505 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,344 developers. It's quick & easy.

Attribue, array of values.

8
I have an xml file, with next attribute:

x="a b c".

How can I choose a or b or c, without knowing their names (I need a generic form).

When I write @x[1] all three values are chosen.

I just want to be able to choose any value of the attribute, using values' place.
Mar 11 '07 #1
3 1047
dorinbogdan
839 Expert 512MB
Use the XSL substring function.
It returns the substring of the first argument starting at the position specified in the second argument with length specified in the third argument. For example, substring("12345",2,3) returns "234".

if @x = "a b c" then try:
[html]<xsl:value-of select="substring(@x,1,1)" />
<xsl:value-of select="substring(@x,3,1)" />
<xsl:value-of select="substring(@x,5,1)" />[/html]
Mar 12 '07 #2
dorinbogdan
839 Expert 512MB
See also the Split function (it splits up a string and returns a node set of token elements, each containing one token from the string).
Mar 12 '07 #3
dorinbogdan
839 Expert 512MB
Hi,
Did you succeed to solve the problem ?
If yes, please let me know, in order to close the thread.
Thanks,
Dorin.
Mar 21 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by csx | last post: by
9 posts views Thread by buda | last post: by
11 posts views Thread by rayreeves | last post: by
5 posts views Thread by Stephen3776 | last post: by
2 posts views Thread by yeshello54 | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.