473,395 Members | 1,891 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,395 software developers and data experts.

Skipping xml entries with xsl

Hello everybody,

i got a problem in building a xsl construct to skip xml entries. Xml
looks like this:

....
<textblock>
<text_crlf></text_crlf>
<text_crlf></text_crlf>
<text_crlf></text_crlf>
<text_crlf></text_crlf>
<text_crlf></text_crlf>
<text_crlf></text_crlf>
</textblock>
....

Above xml code is a little part out of a whole xml tree. The problem
i try to solve is to print out the first text_crlf tag (which will be
translated in <br> via a match function. All the following text_crlf
entries should be skipped, _if_ they are empty.
I tried to work with following/preceding-sibling and such but can't get it
to work.
I am not very xml expirienced, so maybe one of you wizards can give me a hint
how to get that problem solved.

Greetings
Andreas W. Wylach
aw (at) ioc3.de
Jul 20 '05 #1
1 1463
Hello, Andreas!
You wrote on 15 Apr 2004 01:55:32 -0700:

AWW> i got a problem in building a xsl construct to skip xml entries. Xml
AWW> looks like this:

AWW> ...
AWW> <textblock>
AWW> <text_crlf></text_crlf>
AWW> <text_crlf></text_crlf>
AWW> <text_crlf></text_crlf>
AWW> <text_crlf></text_crlf>
AWW> <text_crlf></text_crlf>
AWW> <text_crlf></text_crlf>
AWW> </textblock>
AWW> ...

AWW> Above xml code is a little part out of a whole xml tree. The problem
AWW> i try to solve is to print out the first text_crlf tag (which will be
AWW> translated in <br> via a match function. All the following text_crlf
AWW> entries should be skipped, _if_ they are empty.
AWW> I tried to work with following/preceding-sibling and such but can't
AWW> get it to work.
AWW> I am not very xml expirienced, so maybe one of you wizards can give me
AWW> a hint how to get that problem solved.

<xsl:template match="text_crlf[1]">
<br>
</xsl:template>

<xsl:template match="text_crlf[position() != 1 and . = '']"/>

<xsl:template match="text_crlf[position() != 1 and . != '']">
<!-- do some stuff here -->
</xsl:template>

With best regards, Alex Shirshov.
Jul 20 '05 #2

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

Similar topics

0
by: Cj B | last post by:
Hello, While trying to compile PHP with Oracle Support (--with-oci8), I get the following error: /usr/local/sparc-sun-solaris2.8/bin/ld: skipping incompatible...
9
by: Chuck Anderson | last post by:
I have a function with 7 inputs. The last three have default values. I want to call that function specifying the first four, skip two and then specify the last. I thought I could write this...
1
by: Rick | last post by:
After being frustrated with this issue on several occasions I think I found the secret sauce for solving the issue after reading a few different messages about what others thought and trying a...
9
by: Ken | last post by:
I have a small program , wi tha menu (only option 1,2 and 6 are working for now) Something weird is happening, my array works to input all the data the user puts in, but whebn I choose option 2,...
5
by: Geoff Bennett | last post by:
While parsing an XML document, my TextReader instance skips nodes. For example, in this fragment: <Person Sex="Male" FirstHomeBuyer="No" YearsInCurrentProfession="14"> <RelatedEntityRef...
7
by: Gustaf | last post by:
Hi all, Just for fun, I'm working on a script to count the number of lines in source files. Some lines are auto-generated (by the IDE) and shouldn't be counted. The auto-generated part of files...
0
by: 92balaji | last post by:
hi there is skipping of pages in my printer model:5210 make:printronix it is skipping pages is there any way to change the settings to stop the skipping of pages
1
by: printronixprinterfourm | last post by:
i am using p7-1500 printer pages are skipping heavily please give the experts solution to solve the skipping of empty pages from printer cat : cannot open /users/cusimp/tmp/257637.chl if any...
4
by: BibI | last post by:
Hi there, I just started programming with PERL and am trying to put together my first little data manipulation program. I am working on a MAC with OSX. I have a data file with the following...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.