Dealing with < and > characters in XML data

Discussion in 'XML' started by seeCoolGuy, Aug 2, 2006.

  1. seeCoolGuy

    seeCoolGuy Guest

    I've been using Access to import some data straight into a sql server
    database by simply importing the xml file. However lately some of the
    newer xml files will contain vaild data such as

    "m<sup>3</sup>" within the tags so it reads like the following

    <TblPartDesriptions_to_translate>
    <intpartid>79</intpartid>
    <strpartdescription>Part Description Here</strpartdescription>
    <strlongdescription>some really long text here
    m<sup>3</sup>/min.)</strlongdescription>
    </TblPartDesriptions_to_translate>


    The data inside the strlongdescription should just parse correctly but
    it could just be a microsoft thing, since it does parse correctly in
    other products such as "XML PAD" and Firefox for viewing the file.

    any help is appreciated, perhaps a modified xsl file?
     
    seeCoolGuy, Aug 2, 2006
    #1
    1. Advertising

  2. seeCoolGuy

    Andy Dingley Guest

    seeCoolGuy wrote:

    > I've been using Access to import some data straight into a sql server
    > database by simply importing the xml file.


    I'm not sure what "simply importing the xml file." means.

    Does Access expect to see XML here, and _treat_it_as_ XML ?
    Or will it expect to see CDATA here, and will thus encode it so as to
    be suitable for inclusion inside XML (as CDATA), i.e. it'll convert to
    &lt;

    > it reads like the following
    >
    > <TblPartDesriptions_to_translate>
    > <intpartid>79</intpartid>
    > <strpartdescription>Part Description Here</strpartdescription>
    > <strlongdescription>some really long text here
    > m<sup>3</sup>/min.)</strlongdescription>
    > </TblPartDesriptions_to_translate>


    _Does_ it read like this? This is what you'd expect, and I'd expect
    other tools to then process it corrrectly.

    However I suspect that Access may have helpfully(sic) delivered you
    this instead:
    <strlongdescription>some really long text here
    m&lt;sup&gt;3&lt;/sup&gt;/min.)</strlongdescription>


    > any help is appreciated, perhaps a modified xsl file?


    XSL is rarely any use for this sort of problem. What you need is a very
    clear mental model of what's text (i.e. CDATA), what's XML, and to make
    sure that exactly the right type and number of encodings is applied
    when moving between each.
     
    Andy Dingley, Aug 3, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Drummond

    Dealing with accented characters

    Mark Drummond, May 31, 2006, in forum: Perl
    Replies:
    0
    Views:
    2,944
    Mark Drummond
    May 31, 2006
  2. ronrsr
    Replies:
    13
    Views:
    786
    Leo Kislov
    Dec 18, 2006
  3. Ultrus
    Replies:
    3
    Views:
    414
    Stefan Behnel
    Jul 9, 2007
  4. sophie_newbie

    Dealing with "funny" characters

    sophie_newbie, Oct 20, 2007, in forum: Python
    Replies:
    6
    Views:
    718
    Diez B. Roggisch
    Oct 22, 2007
  5. Mark Drummond

    Dealing with accented characters

    Mark Drummond, Jun 8, 2006, in forum: Perl Misc
    Replies:
    1
    Views:
    156
    Ben Morrow
    Jun 8, 2006
Loading...

Share This Page