Page 1 of 1

Attribute completion does not show xsi:type

Posted: Fri Sep 05, 2008 1:07 am
by csalsa
I write the XML element and then use cntrl-space to bring up the attribute list, it does not show Schema-Instance attributes that were defined in the XML document element with xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance".

I would like this as a feature. There would be many ways of implementing it.

1. Have an option in the Preferences to add in the 'extra' attributes. (Not everyone will want to see them).

2. Press 'cntrl-space' a second time to bring up the extended list of attributes. Pressing 'Esc' cancels the attribute list (as normal).

3. At least on typing a namespace + colon, eg 'xsi:', allow the completion of the attributes in this namespace.

Re: Attribute completion does not show xsi:type

Posted: Sat Sep 06, 2008 6:17 am
by csalsa
The first part of the XML document that I am editing is:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<Message xmlns="http://www.ibm.com/industries/ifw" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/industries/ifw ifw.xsd" version="1.1">
...

Re: Attribute completion does not show xsi:type

Posted: Tue Sep 09, 2008 2:21 pm
by sorin_ristache
Hello,

Thank you for your request. We will consider adding an option in the Preferences for listing xsi:type as a possible attribute in a document validated against an XML Schema. The content completion window with the possible attribute values displayed after inserting this attribute in the XML document will have to list all the types defined in the XML Schema of the document.


Regards,
Sorin

Re: Attribute completion does not show xsi:type

Posted: Sat May 03, 2014 1:02 am
by avanlooveren
Has there been any progress on this? Ultimately, I would like a user in Author mode to be prompted with the allowable sub-types to select from when adding an element. Any advice is very welcome.

Re: Attribute completion does not show xsi:type

Posted: Wed May 07, 2014 10:19 am
by Radu
Hi,

This thread was mostly about showing xsi:type as an attribute in the Text editing mode.
For the Author editing mode you could probably use our Java-based API to add an AuthorDocumentFilter:

http://www.oxygenxml.com/InstData/Edito ... ilter.html

You would use the filter to detect cases in which the user has inserted an element and ask the user for the value of the xsi:type.

Have you already created Java-based customizations for your custom XML vocabulary?
You would need to create an ExtensionsBundle:

http://www.oxygenxml.com/doc/ug-oxygen/ ... undle.html

which has a method called:

http://www.oxygenxml.com/InstData/Edito ... ener%28%29

Such an extension state listener receives events when the XML is opened in the Author editing mode and can add the filter to the current document controller.

We can give you more details if you decide to follow this route.

Regards,
Radu