3 Replies Latest reply on Oct 26, 2012 8:31 PM by mdrake-Oracle

    XML attribute value with apostrophe

      Hi. I am new in using the XML functions in oracle. I was able to create the xml code however, when I open the code in xml editor it shows an error "sting literal was not closed. Error processing resource". It is because the values of one of the element attribute has apostrophe. How to resolve this issue?


      This is how the code looks like:

      <TEST TestId="5585" Name="One&apos;S NURSERY" Action="I">
        • 1. Re: XML attribute value with apostrophe
          Well, assuming there is an associated end tag (aka </TEST>) somewhere in your XML, then the XML fragment you show is well-formed XML.

          If by "XML functions", you mean something like XMLElement/XMLForest/XMLAgg, then you can be safe to know that it generates well-formed XML.

          What is this "xml editor" that you mention but don't name. It sounds as if the issue lies with that tool, based off what little you have provided.

          The more details you provide, the better answer you get.
          • 2. Re: XML attribute value with apostrophe
            I thought that the xml editor was not able to display it properly. I was wrong. When I generated the XML code, I saved it in oracle 10g db. If I spool the code in 10g DB it is ok. But when I spool it using shell script which has oracle 9i DB, the output was cut off. The rest of the XML element starting from the code above were not spool to the file. And then when I open it in microsoft xml editor, the error comes out.

            Edited by: caylee on Oct 26, 2012 12:20 PM
            • 3. Re: XML attribute value with apostrophe
              This sounds like a bug in 9i. You should probably consider upgrading to 11g