String-Replace

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

String-Replace

Octavian, Yuan (GILW)
Dear all,
I need to split the author element.

from:
<inm:Author>Keating, Michael|Oktafian, Yuan|Hailu, Michael</inm:Author>

into:
<author>Keating, Michael<author>
<author>Oktafian, Yuan<author>
<author>Hailu, Michael<author>

I try using string-replace function and try to replace every | into
</autor><author>
but, instead of getting < character, I get &lt;

could you please help

cheers,
yuan

splitplease.xml (1K) Download Attachment
title.xsl (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: String-Replace

Octavian, Yuan (GILW)
Please ignore :)
I found the solution already:


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Octavian, Yuan
(GILW)
Sent: 27 October 2005 13:17
To: [hidden email]
Subject: [saxon] String-Replace


Dear all,
I need to split the author element.

from:
<inm:Author>Keating, Michael|Oktafian, Yuan|Hailu, Michael</inm:Author>

into:
<author>Keating, Michael<author>
<author>Oktafian, Yuan<author>
<author>Hailu, Michael<author>

I try using string-replace function and try to replace every | into
</autor><author> but, instead of getting < character, I get &lt;

could you please help

cheers,
yuan


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: String-Replace

Octavian, Yuan (GILW)
In reply to this post by Octavian, Yuan (GILW)
Please ignore :)
I found the solution already:
I just need to add, disable-output-escaping="yes

                <xsl:value-of select="$to" disable-output-escaping="yes"/>

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Octavian, Yuan
(GILW)
Sent: 27 October 2005 13:17
To: [hidden email]
Subject: [saxon] String-Replace


Dear all,
I need to split the author element.

from:
<inm:Author>Keating, Michael|Oktafian, Yuan|Hailu, Michael</inm:Author>

into:
<author>Keating, Michael<author>
<author>Oktafian, Yuan<author>
<author>Hailu, Michael<author>

I try using string-replace function and try to replace every | into
</autor><author> but, instead of getting < character, I get &lt;

could you please help

cheers,
yuan


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: String-Replace

Michael Kay
In reply to this post by Octavian, Yuan (GILW)
The result of an XSLT transformation is a tree, not a set of tags. This
means you can't create the start tag and end tag as separate operations, you
need to create an element node as a single operation. You need to take this
sequence of three authors and create three elements, which you can do easily
like this:

<xsl:for-each select="tokenize(inm:author, '\|')">
  <author><xsl:value-of select="."/></author>
</xsl:for-each>

Michael Kay

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of
> Octavian, Yuan (GILW)
> Sent: 27 October 2005 12:17
> To: [hidden email]
> Subject: [saxon] String-Replace
>
> Dear all,
> I need to split the author element.
>
> from:
> <inm:Author>Keating, Michael|Oktafian, Yuan|Hailu,
> Michael</inm:Author>
>
> into:
> <author>Keating, Michael<author>
> <author>Oktafian, Yuan<author>
> <author>Hailu, Michael<author>
>
> I try using string-replace function and try to replace every | into
> </autor><author>
> but, instead of getting < character, I get &lt;
>
> could you please help
>
> cheers,
> yuan
>





-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: String-Replace

Michael Kay
In reply to this post by Octavian, Yuan (GILW)
> I found the solution already:
> I just need to add, disable-output-escaping="yes
>


No, that's not the solution! That's a horrible way of doing it (just Google
for disable-output-escaping to see why). See the solution I gave you
earlier.

Michael Kay





-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help