Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Newbie: translate() within <template name="">

Reply
Thread Tools

Newbie: translate() within <template name="">

 
 
Yereth Jansen
Guest
Posts: n/a
 
      01-19-2004
Hi everyone,

I have a question about an xslt document I'm producing. Hope I'm in the
right group for that, but I didn't find any other relevant groups on my
news-server.

I had a piece of code:
<xsl:template match="key">
<xsl:element name="{.}">
<xsl:value-of select="following-sibling::integer
following-sibling::string"/>
<xsl:apply-templates select="dict"/>
</xsl:element>
</xsl:template>

Which worked fine, but the "name" attribute of element can contain spaces..
Which is obviously a problem. I wanted to fix this by using the function:
translate({.}," ","_"), but I don't know if I'm using the '{.}' correctly
and I somehow can't get it in the "name" argument without the 'compiler'
complaining.
Can anyone help me with how to translate the spaces to underscores here?

Thanks in advance,
Yereth

 
Reply With Quote
 
 
 
 
Richard Tobin
Guest
Posts: n/a
 
      01-19-2004
In article <400c1a9a$0$66934$>,
Yereth Jansen <> wrote:

>translate({.}," ","_")


You mean

{translate(., " ", "_")}

-- Richard
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

FreeBSD rules!
 
Reply With Quote
 
 
 
 
Yereth
Guest
Posts: n/a
 
      01-19-2004
Richard Tobin wrote:
>>translate({.}," ","_")

>
> You mean
>
> {translate(., " ", "_")}
>
> -- Richard


Exactly. Thank you very much. Just getting into xml and xslt and it's
nothing like any language I've programmed in before. Really have to get
used to all of this.

Yereth

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dealing with nested xml within nested xml within...... Ultrus Python 3 07-09-2007 09:00 PM
GetElementbyID question - within MasterPage/contentpage - within tables Elmo Watson ASP .Net 1 05-08-2007 05:12 PM
How do I include a server tag within a javascript parameter which is itself within a HTML element event? mark4asp ASP .Net 2 11-07-2006 06:23 AM
Referring to a textbox within a web control within an aspx KatB ASP .Net 0 04-22-2005 07:14 PM
search within a search within a search - looking for better way...my script times out Abby Lee ASP General 5 08-02-2004 04:01 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57