XML value contains predifined XML character "<" and "="

  • Hi,

    I hard coded the XML elements and attributes and one of my XML file falied because I have value that contained predifined XML character "<" and "=" . For example below the 30.6 contain "<=" sign which is a predefined XML characters:

    <Soda sugar =(<=30.6 mg) />

    Bear in mind this XML element is hard coded with a value that is variable using a store prodcedure. Is there a way to fix this problem without revamp the Store prodcedure? Thanks.

  • Have you tried googling for XML escape characters?

    How are you importing the XML into SQL Server? Via SSIS or another method?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • yes I found my solution. Here is the website

    http://www.fao.org/docrep/008/ae908e/ae908e06.htm

    Thanks.

  • Thanks for posting your solution. That's a nice document.

    So are you going to force the actual xml file to include the those entity references instead of the &lt and = signs? Or are you going to parse it later on?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • What I am going to do is to replace the attributes values that contain <= with the value references below and then create the XML file parse it

    Character

    Entity References

    & &

    < <

    > >

    “ "

    ‘ '

  • Cool! Glad you figured it out. @=)

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply