0

I have a .txt tab delimited file with a '->' (hexadecimal value 0x1A) in one of the columns (F45).. Is there a way to skip or convert that value before I convert it to xml to my notes section. When I try and parse the hexadecimal value and then send the xml to my web service address, I get this error

exception.InnerException.ToString(): System.ArgumentException: ' ', hexadecimal value 0x1A, is an invalid character. sent to my web service address. (after parsing)

Here is my current xslt

<xsl:strip-space elements="ACode AReceived" />

<xsl:template match="/">
    <soap:Envelope xsl:version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Body>
            <Report xmlns="http://blank.com">
                <DispatchHeader>
                 <Notes>
                  <xsl:if test="string-length(/NewDataSet/Row[F1='INCI']/F45)>0">
                        <Note>
                         <xsl:value-of select="/NewDataSet/Row[F1='INCI']/F45"/>
                        </Note>
                 <Notes>

Thank you for any help Rookie Josh

emmanuel
  • 9,607
  • 10
  • 25
  • 38
Rainwave
  • 1
  • 1
  • 1
  • How are you building your xml from .txt ? It sounds like you're giving the service invalid xml – Phil Dec 01 '14 at 21:12
  • I am converting the text with the xslt in combination with a config file. – Rainwave Dec 01 '14 at 22:38
  • I did a bit of research online. It seems to be a .NET thing due to the strange "cleaning" which Microsoft does when using an XmlReader. Check out this question and answer. http://stackoverflow.com/a/641632/3942121 – Phil Dec 01 '14 at 22:53
  • Thank You for the research. Looks like its in the actual parser code instead of the xslt. I will see what I can do though without digging into the code. :) – Rainwave Dec 01 '14 at 23:47

0 Answers0