xsl-list
[Top] [All Lists]

global find and replace certain "special" characters and replicate structure as it is

2004-09-07 22:27:40
I am using Infopath to collect rich text from a word document and for some 
weird reason the output I get in the XML has the special  character in it. 

I understand that the UTF-8 encoding etcetra causes it to be visible that way. 

Also I have the âEUR" character at several locations. 

I do not have control over the way Infopath converts this rich text into XHTML 
inside mixed custom XML elements. 

I do not have control over the source word documents that have enormous amounts 
of "spaces" in odd locations.

I am wondering how I can write a convenient global find/replacer that would 
essentially go through ANY and EVERY element or text node in the given source 
XML(hybrid HTML) and replace the following:

    with    (nothing) (eliminate it) 
<I don't even want the spaces to appear>
âEUR"  with  - (dash)

<?xml version="1.0" encoding="UTF-8"?>
....

                        <font face="Times New Roman">
                                <strong>Dangerous âEUR" Management Danger 
</strong>
                                <span style="FONT-SIZE: 10pt">(former Danger 
&amp; Is Now)</span>
                                <strong>     
                      (0/99 âEUR" Present)</strong>
                        </font>
                </div>
                <h1>hello1</h1>
......
                                <tr>
                                        <td><div style="PADDING-RIGHT: 0in; 
MARGIN-TOP: 0in; PADDING-LEFT: 0in; FONT-WEIGHT: normal; FONT-SIZE: 12pt; 
MARGIN-BOTTOM: 0pt">
                        <font face="Times New Roman">
                                <strong>Interesting âEUR" Avenue Of  </strong>
                                <span style="FONT-SIZE: 10pt">(formerly earl 
&amp; of england)</span>
                                <strong>     
                      (0/99 âEUR" Present)</strong>
                        </font>
                </div></td>
                                        <td>two</td>
                                        <td>three</td>
                                </tr>
        ....

____________________________________________________________

Abhishek Sanwal
HP - Houston Campus
..........................................................................