jEdit Community - Resources for users of the jEdit Text Editor
How to get value dropdown in XML Edit Tag Dialog
Submitted by dhschulten on Thursday, 14 February, 2008 - 07:11
Hi, I am using XML Schema for validation and there are situations where there are only a limited number of allowed attribute values. I have seen that jEdit sometimes creates dropdown lists with allowed attribute values (e.g. when editing a schema), but I could not find out how this is done. At least, xsd:enumeration in the following schema expression does not lead to such a value dropdown: A similar situation are key references. It seems desirable to propose a list of existing keys for key reference attributes. But I can understand that it is not trivial to get this list and in very large documents it might not be so desirable after all. Anyhow, is there a way to get a dropdown for attribute enumerations as shown above? Cheers, Dietrich
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
XML snippet
by dhschulten on Thu, 14/02/2008 - 07:16
<xsd:attribute name="name" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="5200" />
<xsd:enumeration value="W880i" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
 
The issue is Schema vs DTD
by jester on Mon, 28/04/2008 - 23:52
Hi,

This drove me nuts to figure out, but here's what's happening.

First, dropdown boxes work for DTD's, but not for schemas. As stated here "Buffers which have an associated DTD are validated for errors, and completion popups are shown for elements, attributes, and entities." while "Buffers which have an associated schema are validated for errors, and completion popups are shown for elements and entities."

What makes the situation really confusing, though, is that dropdowns work for the xsd schema, which makes it seem that there is a way to get them to work for schemas. But, what's actually happening is that "for XML docs that have a XML schema tied to them - completions
are hard coded into the XML plugin. XSD completion was hard
coded (by me), so if you are building a XML Schema completion is there." (from this 2002 email).

If you download the plugin source code you can find the hard coded completion files at 'XML\xml\completion'. I haven't figured out the details yet, but I'm sure one could add their own completion data here.

Good luck.

-J
 
You might try the XML plugin.
by elberry on Thu, 14/02/2008 - 17:55
You might try the XML plugin. I'm not quite sure which drop down you're getting, it could be jEdit's completion popup or another plugin's completion popup (like TextAutoComplete).

But, if it's XML related, your best bet would be to check out the XML plugin.

Learn from the past. Live in the present. Plan for the future.
11101000
 
I forgot to mention: I *am* u
by dhschulten on Mon, 18/02/2008 - 08:42
I forgot to mention: I *am* using the XML plugin, and I was referring to its edit tag dialog. In that dialog jEdit sometimes presents a list of possible attribute values, and I want to know how to achieve this with my own schema.
User login
Browse archives
« September 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   97301
Context Free Art (*.cfdg)   0.31   46062
BBEdit scheme   1.0   18601
JBuilder scheme   .001   18502
ColdFusion scheme   1.0   18031
R Edit Mode - extensive version   0.1   17480
Advanced HTML edit mode   1.0   16212
Matlab Edit Mode   1.0   16075
jEdit XP icons   1.0   15236
XP icons for jEdit   1.1   14299