Posted By: RickS Best way to deal with XML - 02/06/23 01:50 PM
I have a column in the database that is an XMLType. When I select from the table the XML doesn't appear, instead it just shows the column type, "<XMLTYPE>".

I clicked the "..." hoping it would show me the XML, but instead it says:

Quote
This file does not have an app associated with it for performing this action. Please install an app or, of one is already installed, create an association in the Default Apps Settings page.

What is the best way to use PL/SQL Developer with XML in the database? Is there an app to install? What is it called? How would I install it? Where is the "Default Apps Settings" page? Is there a way to get it to open Notepad++ to show me the XML, or is there something better?
Posted By: jhughes Re: Best way to deal with XML - 02/06/23 05:31 PM
Assumption: You are using Windows.

If sounds like you have nothing defined to view a .xml file so Windows doesn't know what to do.

If you have a .xml file on your machine (desktop or any directory) and you double click it, what happens? Does it open in some software program or do you get the "How do you want to open this file" pop-up from Windows? I'm guessing you get the pop-up, simply pick Notepad++ to open the file with and that should automatically set it as the default for all .xml files.

If you don't have a .xml file handy and don't want to create an empty one by renaming a .txt file, another way is to type into the search bar (in the bottom left on a normal desktop) the phrase "Choose default apps" and pick "Choose default apps by file type". Scroll way down to .xml and if you see Choose a default for the program associated to it, go ahead and pick Notepad++.

After that, PL/SQL Developer should work correctly for you when clicking the "..."

A XML file is basically a specially formatted text file. If all you are doing is viewing a XML file, then Notepad++ is sufficient. If you are editing the .XML file, then getting a program designed to edit XML files would be highly recommended.
Posted By: RickS Re: Best way to deal with XML - 02/06/23 08:22 PM
Thanks for the response!

I do already have Notepad++ set up in Windows as the default way to open XML files. When I click an XML file in File Explorer, it does bring up Notepad++.

Your comment helped me because I didn't realize it was talking about the WINDOWS "Default Apps Settings page". If so, this may be some sort of permissions issue.
Posted By: RickS Re: Best way to deal with XML - 02/08/23 01:50 PM
I wonder if when I click on the "..." on an XMLType column if PL/SQL Developer tries to open a file called "something.xml" or "something.some-other-extension". I wonder if I need to associate that other file extension with Notepad++ in Windows.
Posted By: jhughes Re: Best way to deal with XML - 02/08/23 03:28 PM
Here's how PL/SQL Developer (PSD) interacts with a column that shows <XMLTYPE> in it for me.

When I click the three dots, I get a pop-up asking ** View column data externally as "Extensible Markup Language"? ** with the Yes/No buttons and the Don't show this message again checkbox. If I click No, the Large Data Editor window within PSD pops up and shows me the data. If I click Yes, then the program associated with .xml files per Windows starts up. In my case it is Altova's XMLSpy. XMLSpy doesn't appear as a separate program on the taskbar. It instead appears like it is a second copy of PSD in terms of stacking.

If you ever click the "Don't show this message again" checkbox, you can find those under Preferences -> Options -> DSA Dialogs. Removing the line for View.xml restores the pop-up.

I don't recall making any changes within PSD to make it work with the program associated to .xml files. I have had to re-apply the windows level settings a few times over the years due to updates/installs of other things breaking/stealing permissions but that was all outside PSD.
Posted By: RickS Re: Best way to deal with XML - 02/08/23 04:04 PM
Thanks! I removed "View.xml=6" and now I get the "View column data externally as Extensible Markup Language?" popup. If I click "no" I get the desired results.

Is there any way to get it to always take the "no" path without prompting me?
Posted By: jhughes Re: Best way to deal with XML - 02/08/23 05:03 PM
Check the "Don't show this message again" checkbox before clicking the No button.

I still find it odd that Notepad++ won't start up via PSD if you have it associated at the OS level.

Reference: Your action will put View.xml=7 into the DSA file.
Posted By: DonTime Re: Best way to deal with XML - 11/01/23 06:47 PM
I am using Windows 64bit and PLSQL Developer 32 bit Version 13. When I select a column that contains an xml data type and the dialog displays "View column data externally as "XML FILE"?" When I click 'YES' another dialog opens "This file does not have an app associated with it for performing this action. Please install an app or, of one is already installed, create an association in the Default Apps Settings page." When I hold the Control key and press the ellispse the Large Data Editor opens. On the External tab I select XML Document (.XML) and it populates ""C:\Program Files\Microsoft Office\Root\VFS\ProgramFilesCommonX64\Microsoft Shared\Office16\MSOXMLED.EXE" /verb open "%1" in the Execute with box. When I click the Execute button an error message displays "This file does not have an app associated with it for performing this action. Please install an app or, if one is already installed, create an associated in the Default Apps Settings page. Is there anyway to have the data in the column open as xml?
Posted By: RickS Re: Best way to deal with XML - 01/25/24 02:22 PM
I know this is an old thread, but I'm still trying to get part of this working.

When I click on the "..." next to an XMLType field in PL/SQL Developer, it says "View column data externally as Extensible Markup Language?". If I click "no" it works fine. It brings up a read-only screen showing the XML.

Now I'm trying to get it working when I click "yes". It would be very handy if I had the ability to edit the XML here.

I do have Notepad++ defined as my default app in Windows to open .xml files. But when I click "yes" it pops up that box with the message "This file does not have an app associated with it for performing this action. Please install an app or, if one is already installed, create an association in the Default Apps Settings page".
Posted By: RickS Re: Best way to deal with XML - 01/29/24 08:48 PM
Anybody here?
Posted By: Marco Kalter Re: Best way to deal with XML - 02/05/24 10:05 AM
It should work. Can you let me know how exactly you defined Notepad++ as your default app for XML? Can you also let me know your exact PL/SQL Developer version?
Posted By: RickS Re: Best way to deal with XML - 02/05/24 01:56 PM
The PL/SQL Developer version is 15.0.2.2054. In Windows settings, under Apps > Default Apps, I set the default app for .xml files to Notepad++.
Posted By: jhughes Re: Best way to deal with XML - 02/05/24 02:02 PM
Never did ask this last time, but if you have a .xml file saved on disk and double click it, does it open in Notepad++?
Posted By: RickS Re: Best way to deal with XML - 02/05/24 02:03 PM
Yes.
Posted By: Marco Kalter Re: Best way to deal with XML - 02/06/24 11:20 AM
Can you try the following?

Save the following text as xml_auto_file.reg:
Code
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\xml_auto_file]

[HKEY_CURRENT_USER\Software\Classes\xml_auto_file\shell]

[HKEY_CURRENT_USER\Software\Classes\xml_auto_file\shell\open]

[HKEY_CURRENT_USER\Software\Classes\xml_auto_file\shell\open\command]
@="\"C:\\Program Files (x86)\\Notepad++\\notepad++.exe\" \"%1\""

[HKEY_CURRENT_USER\Software\Classes\.xml]

[HKEY_CURRENT_USER\Software\Classes\.xml\OpenWithProgids]
"xml_auto_file"=""

If your Notepad++ installation directory differs from C:\Program Files (x86)\Notepad++ you will need to modify this accordingly.

Import this registry with regedit.exe and try again.
Posted By: RickS Re: Best way to deal with XML - 02/06/24 01:56 PM
It does open the XML in Notepad++ now, which is great. Thank you.

The problem now is that it isn't saving my edits. It brings up a file in Notepad++ called plstemp.xml. When I change a value in the XML and save the file, it doesn't save the XML to the database. When I query the XML the old values are still there.
Posted By: Marco Kalter Re: Best way to deal with XML - 02/07/24 09:41 AM
If the result set in edit mode (padlock unlocked) and you open an XML column value in Notepad++, make some changes, and save the file in Notepad++, you should get an "Import data from modified file?" question. After clicking "Yes" you can post the changed record to the database. I tested this scenario and it seems to work fine.

If the result set is in read-only mode, changes made in Notepad++ will be ignored.
Posted By: RickS Re: Best way to deal with XML - 02/07/24 11:06 PM
I do have the padlock unlocked, but when I save the file in Notepad++ I don't get an "Import data from modified file?" question.
Posted By: Marco Kalter Re: Best way to deal with XML - 02/08/24 10:59 AM
Can you go to Preferences > User Interface > Options, press the "DSA Dialogs" button, and check if there is a line like this?

ColumnEditorImportModifiedFile=7

If this line exists, remove it and try again.
Posted By: Marco Kalter Re: Best way to deal with XML - 02/08/24 11:04 AM
Can you also check that the plstemp.xml file is closed in Notepad++ before you edit the XML column in PL/SQL Developer?
Posted By: Marco Kalter Re: Best way to deal with XML - 02/08/24 11:11 AM
If the issue is caused by opening the file in an existing Notepad++ instance, you can use the -multiInst parameter so that the XML value is always loaded in a new Notepad++ instance. Import the following registry to try this:

Code
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\xml_auto_file]

[HKEY_CURRENT_USER\Software\Classes\xml_auto_file\shell]

[HKEY_CURRENT_USER\Software\Classes\xml_auto_file\shell\open]

[HKEY_CURRENT_USER\Software\Classes\xml_auto_file\shell\open\command]
@="\"C:\\Program Files (x86)\\Notepad++\\notepad++.exe\" -multiInst \"%1\""

[HKEY_CURRENT_USER\Software\Classes\.xml]

[HKEY_CURRENT_USER\Software\Classes\.xml\OpenWithProgids]
"xml_auto_file"=""
Posted By: RickS Re: Best way to deal with XML - 02/08/24 04:36 PM
I have noticed something new. When the "Edit column data externally as XML File?" prompt comes up, if I click "No" and I have the padlock unlocked, I am able to edit XML in PL/SQL Developer's Large Data Editor. I didn't realize that. I thought that the native editor was read-only and I needed to install another tool - like Notepad++ in order to edit XML.

My goal is just to be able to edit data. I don't care what editor I use. If I can do that within PL/SQL Developer's Large Data Editor then I don't need to configure Notepad++ at all.

When I query my data, it does make me select the rowid from the table in order to edit and save XML, which is kind of a pain, but I can live with that.
© Allround Automations forums