Page 1 of 1

Oxygen editor is changing xml code

Posted: Wed Aug 30, 2006 1:19 am
by Douha
Hi All,

I would like to disable a feature of the editor and can't seem to figure out how to do it. When I edit a file that contains a CDATA section with empty brackets, like this <BANK_ACCT_CD Attribute="Y"><![CDATA[]]></BANK_ACCT_CD>, the editor will display this <BANK_ACCT_CD Attribute="Y"/>. I need to be able to see what the file really looks like. Is there a way to stop having the editor do this for me?

Thanks,

Doug

Posted: Wed Aug 30, 2006 5:41 pm
by dnedrow
Have you tried a single space between the square brackets?

Posted: Wed Aug 30, 2006 5:57 pm
by Douha
I can't do that. The reason is that I am reviewing xml files that are created by other departments for input to our accounting system. Our system won't handle empty brackets in the cdata section. I need to be able to create screen prints of what is wrong with their files so that they can fix the problems.

I have only been looking at the files with oXygen. I have been telling the departments for a long time now that they can't combine the begin and end tags cause the accounting system would puke when it tried to parse them. Imagine my surprise when I was told that they weren't actually doing that.

I really really really need oXygen to show me exactly what is in the xml files I am editing.

Thanks,

Doug

Posted: Wed Aug 30, 2006 6:15 pm
by dnedrow
Is this happening when the file is opened, or are you doing a format and indent?

Also, have you double checked that you have the appropriate options selected in the XML->FOrmat prefs?

Eg. 'Preserve text as it is'

-David

Posted: Wed Aug 30, 2006 11:01 pm
by Douha
Thanks for your response David.

I did check and found out that when I first open the file, it is showing the empty brackets. It isn't until I do the Format and Indent, that the tags get changed. I had changed the preferences/Editor/Format/XML Preserve text as it is box to true a couple of days ago. It didn't make any difference. As I was poking around, I found another checkbox in the wame window for Expand empty elements. This did what I wanted to happen with one little bitty exception. It removed the CDATA section. I want the cdata section to remain unchanged.

I guess that we are getting closer.

Thanks,

Doug

Posted: Thu Aug 31, 2006 5:20 pm
by sorin_ristache
Hello,

The DOM parser used to pretty print the document strips empty CDATA nodes. We patched it so that all CDATA sections remain as they are even if they are empty. To install the patch please replace [oXygen7.2-install-folder]/lib/oxygen.jar with this patched version and restart <oXygen/>.

Regards,
Sorin

Posted: Thu Aug 31, 2006 6:09 pm
by Douha
Sorin,

Thank you very much. I have never seen a vendor that is as responsive as you are. This makes two times that you have created a patch for a problem that I was having.

I do appreciate your help. I also do tell everyone who I know who works with xml about oXygen.

Thanks,

Doug Harding
State of Utah / Division of Finance