473,320 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to concat in XML

Hi,
I have the following problem:
I want create a xslt template that appends strings from
a arbitrary occurrence of Sub-tags.
I will explain it with an example:

Input:
<root>
<Parent>
<SUB1>
<VALUE>someString1</VALUE>
<OTHERVALUES>...</OTHERVALUES>
</SUB1>
<SUB1>
<VALUE>someString2</VALUE>
<OTHERVALUES>...</OTHERVALUES>
</SUB1>
<!-- ... -->
</Parent>
</root>

<!-- SUB1 can be occure more than 2 times...
VALUE occures one time in a SUB1-->

What i need from root:
Output:

<VALUES>someString1;someString2;</VALUES>

this is not possible with concat?

Thanks for your help

alex

Jul 19 '07 #1
1 3915

ea***********@freenet.de < ea***********@freenet.dewrote
in <11**********************@g4g2000hsf.googlegroups. com>:
I want create a xslt template that appends strings from
a arbitrary occurrence of Sub-tags.

<root>
<Parent>
<SUB1>
<VALUE>someString1</VALUE>
<OTHERVALUES>...</OTHERVALUES>
</SUB1>
<SUB1>
<VALUE>someString2</VALUE>
<OTHERVALUES>...</OTHERVALUES>
</SUB1>
<!-- ... -->
</Parent>
</root>

Output:

<VALUES>someString1;someString2;</VALUES>
Read a tutorial.

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="root">
<VALUES>
<xsl:apply-templates select="Parent/SUB1"/>
</VALUES>
</xsl:template>
<xsl:template match="SUB1">
<xsl:apply-templates select="VALUE"/>
<xsl:text>;</xsl:text>
</xsl:template>
</xsl:stylesheet>

--
....the pleasure of obedience is pretty thin compared with
the pleasure of hearing a rotten tomato hit someone in the
rear end. -- Garrison Keillor
Jul 19 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Gerald Aichholzer | last post by:
Hello, I need to specify the following attribute in an xhtml-file containing TAL templates: <div tal:attributes="onMouseOver concat('func(',xyz,')')"> which results in <div...
5
by: F. Da Costa | last post by:
Hi, Could it be correct that the following code does *not* work because i'm not using the var arr = new Array("a","b","c"); methodology?? Read through...
3
by: Bryan Valencia | last post by:
Ok, I tried to use the concat function. It's in the Help, but it claims it can't find the namespace that contains 'concat'. You'd think there'd be a note in the help system if I have to use some...
16
by: Jacky | last post by:
Hi, Concat wors as tmpStr = tmpStr.Concat(tmpStr, tmpStr2) Why it do not refer to owner object so tmpStr.Concat(tmpStr, tmpStr2) and now tmpStr has same value as upper?
8
by: Doug Stiers | last post by:
Is there a downside to using string.concat? Other than a little overhead? str1 = string.concat(str1,str2) vs. str1 &= str2 It seems to me like the string class should be optimized to do this...
4
by: Martin Fletcher | last post by:
I cant get the Concat function to work, please help. Here's some of my code. Module modTCP Public TCP_RECEIVED_DATA As String Private WithEvents TCP_SERVER As New WinSockSVR Private Sub...
1
by: Trint Smith | last post by:
Ok, I have a webform that has these checkboxes: 1. something 2. something else 3. and something else When the user clicks on the checkbox, I want all of the selections to go into a textbox...
3
by: Mythran | last post by:
Out of curiosity, only, which is recommended for SHORT concatenation...or concatenating two or three strings that are relatively small in size? Dim a As String = "bah" Dim b As String = "bah2"...
4
by: Martin Evans | last post by:
Hi, I'm getting: DBD::DB2::db do failed: SQL0440N No authorized routine named "CONCAT" of type "FUNCTION" having compatible arguments was found. SQLSTATE=42884 for some SQL like this:
6
by: antmail | last post by:
Hi guys, I have spend several days now trying to solve this problem inside a stored procedure. I want to call a procedure providing 3 variables. The variables area used to select the appropriate...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.