0

So I have a node within a XML Document like this:

 <kw>Saurier|Haustier|lieb</kw>

I have to extract the Information with XSLT(Saxon) which is separated with |. I've already tried it with substrings, but the compiler thinks there are multiple items because of | How do I do that?

EDIT:

XML DATA

<?xml version = "1.0" encoding = "ISO-8859-1" ?>
<book>

<title>Unsere Haustiere</title>
<section>
    <title>Fische</title>
    <kw>Fisch</kw>
    <kw>Haustier|leise</kw>
    <para>Fische brauchen immer Wasser</para>
</section>
<section>
    <title>Säugetiere</title>
    <kw>Säugetier</kw>
    <section>
        <title>Katzen</title>
        <kw>Katze</kw>
        <kw>Haustier|lieb</kw>
        <kw>Haustier|gefährlich</kw>
        <para>Katzen kratzen an den Möbeln.</para>
        <section>
            <title>Die Katze</title>
            <kw>Katze</kw>
            <para>Hier Text einfügen...</para>
        </section>
        <section>
            <title>Der Kater</title>
            <kw>Kater</kw>
            <para>Der Kater ist der Mann bei den Katzen.</para>
        </section>
    </section>
</section>
<section>
    <title>Saurier</title>
        <kw>Saurier</kw>
        <kw>Dinosaurier</kw>
        <section>
            <title>Tyrannosaurus rex</title>
            <kw>Tyrannosaurus rex</kw>
            <kw>Saurier|Haustier|lieb</kw>
            <kw>Haustier|lieb</kw>
            <para>Der T-rex ist ein liebes Haustier.</para>
       [...]

Don't know how to explain but I have to make an index looking like this

http://s1.directupload.net/images/140703/obxzuz6x.png

To do so I have to extract the kw elements. There is the information where the animal has to be indexed.

  • 2
    **1.** Please indicate which version of Saxon you are using. **2.** What exactly does "extract" mean in this context? What do you intend to do with the value/s after you extract it/them? – michael.hor257k Jul 03 '14 at 11:36

1 Answers1

0

Depending on your XSLT version you can use either tokenize() or str:tokenize.

See how to make xsl tokenize work

Community
  • 1
  • 1
Jeroen
  • 3,076
  • 1
  • 17
  • 16