473,473 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

tricky xsl transformation needed...

Hi ng,

how can i transform this source-xml in the target xml? is it possible
to get <a>Ax</aenclosed?

source-xml:
<z>
A1
<b>B1</b>
A2
</z>
desired target-xml:
<z>
<a>A1</a>
<b>B1</b>
<a>A2</a>
</z>
....anyone?

Jun 27 '08 #1
2 1099
st***************@googlemail.com wrote:
how can i transform this source-xml in the target xml? is it possible
to get <a>Ax</aenclosed?

source-xml:
<z>
A1
<b>B1</b>
A2
</z>
desired target-xml:
<z>
<a>A1</a>
<b>B1</b>
<a>A2</a>
</z>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:output method="xml" indent="yes"/>

<xsl:template match="z/text()[starts-with(normalize-space(.), 'A')]">
<a>
<xsl:value-of select="normalize-space(.)"/>
</a>
</xsl:template>

<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jun 27 '08 #2
Hi Martin,

thanks a lot...!!!

//stefan
Jun 27 '08 #3

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

Similar topics

0
by: Sergio del Amo | last post by:
Hi, I use the xslt functions provided by php. I am running in my computer the package xampp(www.apachefriends.org) which includes php/apache/mysql .. In this package the php includes the sablotron...
4
by: Jyrki Keisala | last post by:
I have an XML file: <document> <record> <element1>Text</element1> <element2>More text</element2> <element3>Even more text</element3> <element4>Some text <link><title>Google</title><url>...
6
by: dave | last post by:
I really have 2 questions regarding the following xml snippet. The xml is a directory representation. <?xml version="1.0" standalone="yes"?> <FileSystem> <Row> <ID>1</ID> <Name>Root</Name>...
7
by: pivote | last post by:
I'm trying to transform a XML file to another XML file. The first file must describe what I want to say in a more abstract way than the second. But in order to do the transformation, I need an...
3
by: The Frog | last post by:
Hi everyone, I am trying to refine some ADO code that is used to extract data from excel spreadsheets and do a simple ETL type process to place the data into a table. The code works fine and is...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.