Oxygen editor is changing xml code

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Douha
Posts: 17
Joined: Fri Aug 19, 2005 6:02 pm

Oxygen editor is changing xml code

Post by Douha » Wed Aug 30, 2006 1:19 am

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

dnedrow
Posts: 60
Joined: Wed Jan 28, 2004 10:51 pm

Post by dnedrow » Wed Aug 30, 2006 5:41 pm

Have you tried a single space between the square brackets?

Douha
Posts: 17
Joined: Fri Aug 19, 2005 6:02 pm

Post by Douha » Wed Aug 30, 2006 5:57 pm

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

dnedrow
Posts: 60
Joined: Wed Jan 28, 2004 10:51 pm

Post by dnedrow » Wed Aug 30, 2006 6:15 pm

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

Douha
Posts: 17
Joined: Fri Aug 19, 2005 6:02 pm

Post by Douha » Wed Aug 30, 2006 11:01 pm

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

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache » Thu Aug 31, 2006 5:20 pm

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

Douha
Posts: 17
Joined: Fri Aug 19, 2005 6:02 pm

Post by Douha » Thu Aug 31, 2006 6:09 pm

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

Post Reply