Check illegal characters in XML file using xml spy

Posted on 2006-05-11
Last Modified: 2008-02-01
I am using  SQLXML parser to insert huge xml files into my database tables.
I am able to insert small files but with big size files(500 MB) i am fiding an error which says "illegal xml character".
I serached online and someone suggested that maybe the xml file has some illegal chars that was causing trouble with the question is does anyone know how to check if an xml file has illegal chars using xmlspy software and if do i get rid of them so that i can do a bulk insert using SQLXML.

urgent help please!!
Question by:angireddy
    1 Comment
    LVL 4

    Accepted Solution

    Once i was having the same problem, it was solved after having cleaned some characters...
    you need to pass your records through function before inserting them into the table, here are the characters that caused me trouble.

    FUNCTION cleanstring
    cString = STRTRAN(cString, '&', '&')
    cString = STRTRAN(cString, '<', '&lt;')
    cString = STRTRAN(cString, '>', '&gt;')
    cString = STRTRAN(cString, '"', '&quot;')
    cString = STRTRAN(cString, "'", '&apos;')
    cString = STRTRAN(cString, CHR(163), '&#163; ')
    cString = STRTRAN(cString, CHR(169), '&copy;')   &&Copyright Mark Sign
    cString = STRTRAN(cString, CHR(174), '&reg;')     &&Registered Mark Sign
    cString = STRTRAN(cString, CHR(153), '&#8482;') &&Trade Mark Sign
    cString = STRTRAN(cString, CHR(128), '&#8364;') &&Euro Sign
    RETURN cString

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
    Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now