Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


XSLT string replacement question

From: jt6211@---------.--- (- -----)
To: NULL
Date: 6/1/2004 4:46:00 PM
I was wondering if anyone knows if it is possible to do basic string
replacement using XSLT even though the strings being replaced may
contain "<" and ">".  Here is my problem:

I need to be able to convert XML like this:

<?xml version="1.0" encoding="UTF-8"?>
<java version="1.4.2_03" class="java.beans.XMLDecoder">
 <object class="javax.swing.JButton">
  <string>Hello, world</string>
 </object>
</java>

Into XML like this(notice each "<" is replaced with "&lt;" and each
">" has been replaced with "&gt; and then it was wrapped in a SOAP
envelope"):

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmln
s:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<SubmitRequest xmlns="http://apps.someurl.com/somePath/">
<xmlRequest>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;java version="1.4.2_03" class="java.beans.XMLDecoder"&gt;
 &lt;object class="javax.swing.JButton"&gt;
  &lt;string&gt;Hello, world&lt;/string&gt;
 &lt;/object&gt;
&lt;/java&gt;
</xmlRequest>
</SubmitRequest>
</soap:Body>
</soap:Envelope>

I know it is possible to do this using just about any programming
language, but I want to know if it can be done using XSLT stylesheets.
 If it is possible does anyone know how?  Or could you direct me to a
tutorial on how to do this?

Thank you,

--J


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent