Invalid XML character

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark

    #1

    Invalid XML character

    Hello,

    I'm doing some data manipulation using an XML parser and am getting the
    following error message:

    Character reference "&#22" is an invalid XML character.

    Any thoughts upon what this character could be? I've looked at all instances
    of "22" and "#" in the data I've got and can't find any obviously wrong with
    any of them.

    I'm guessing it's a rogue control character or similar somewhere, but I'd be
    grateful if someone could identify what it is I should be looking for!

    Thanks in advance,

    Mark


  • Martin Honnen

    #2
    Re: Invalid XML character



    Mark wrote:[color=blue]
    > I'm doing some data manipulation using an XML parser and am getting the
    > following error message:
    >
    > Character reference "&#22" is an invalid XML character.
    >
    > Any thoughts upon what this character could be? I've looked at all instances
    > of "22" and "#" in the data I've got and can't find any obviously wrong with
    > any of them.
    >
    > I'm guessing it's a rogue control character or similar somewhere, but I'd be
    > grateful if someone could identify what it is I should be looking for![/color]

    XML 1.0 excludes certain control characters and  is one of those, see
    http://www.w3.org/TR/REC-xml/#charsets
    This has changed in XML 1.1, see
    http://www.w3.org/TR/xml11/#charsets
    but so far most parsers only support XML 1.0.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • Mark

      #3
      Re: Invalid XML character

      > XML 1.0 excludes certain control characters and  is one of those, see[color=blue]
      > http://www.w3.org/TR/REC-xml/#charsets
      > This has changed in XML 1.1, see
      > http://www.w3.org/TR/xml11/#charsets
      > but so far most parsers only support XML 1.0.[/color]

      I see. Any idea where I could find the ASCII equivalent of &#22? (I need to
      amend a script so that this control character is removed whilst I'm
      importing this data)

      Thanks,

      Mark


      Comment

      • Martin Honnen

        #4
        Re: Invalid XML character



        Mark wrote:[color=blue][color=green]
        >>XML 1.0 excludes certain control characters and  is one of those, see
        >> http://www.w3.org/TR/REC-xml/#charsets
        >>This has changed in XML 1.1, see
        >> http://www.w3.org/TR/xml11/#charsets
        >>but so far most parsers only support XML 1.0.[/color]
        >
        >
        > I see. Any idea where I could find the ASCII equivalent of &#22? (I need to
        > amend a script so that this control character is removed whilst I'm
        > importing this data)[/color]

        If you write &#dd; you are using a numeric character reference in XML
        where the number is the Unicode of the character. So the Unicode
        character with code 22 is what you are looking for and for the codes
        0..127 Unicode describes the same characters as ASCII.

        --

        Martin Honnen
        http://JavaScript.FAQTs.com/

        Comment

        • Mark

          #5
          Re: Invalid XML character

          > If you write &#dd; you are using a numeric character reference in XML[color=blue]
          > where the number is the Unicode of the character. So the Unicode
          > character with code 22 is what you are looking for and for the codes
          > 0..127 Unicode describes the same characters as ASCII.[/color]

          Thank you very much for your help.

          Mark


          Comment

          • Richard Tobin

            #6
            Re: Invalid XML character

            In article <4123541a$0$115 44$afc38c87@new s.easynet.co.uk >,
            Mark <mark.harris.no spam@ukonline.c o.uk.nospam> wrote:
            [color=blue]
            >Character reference "&#22" is an invalid XML character.
            >
            >Any thoughts upon what this character could be?[/color]

            It's control-V, but the message implies that it's appearing as a character
            reference ().

            My guess is that it's a typo for &#x22; which would be a double quote
            character.

            -- Richard

            Comment

            Working...