Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Element ordering in XML based on DTD
Element ordering in XML based on DTD [message #664500] Sun, 10 April 2011 01:31 Go to next message
Greg Amerson is currently offline Greg Amerson
Messages: 116
Registered: March 2010
Senior Member
Hello,

First off, bravo on sapphire. I've been using it for a day or two and I've already got a working editor for my XML file. But I've run into an issue and wanted to see if anyone knows how I could address it.

My particular XML file is just backed by a DTD. A dtd that requires a particular order for child elements. So with my sapphire editor there are element nodes that have multiple child-element types that can be specified

<parent>
<child1/>
<child1/>
<child2/>
<child2/>
...etc...
</parent>

In this particular DTD child1 elements must come before child2 elements, so in the DTD its specified

<!ELEMENT parent (child1+, child2+)>

The problem I'm having is that in sapphire based editor when I remove all of the child1 elements in the list, and then add them again, they are appened to the <parent> node instead of being inserted before <child2/>

Is there a way that I can hook into the DOM insertion method of sapphire's model to enforce the DTD's ordering?

[Updated on: Sun, 10 April 2011 01:33]

Report message to a moderator

Re: Element ordering in XML based on DTD [message #664514 is a reply to message #664500] Sun, 10 April 2011 12:44 Go to previous messageGo to next message
Greg Amerson is currently offline Greg Amerson
Messages: 116
Registered: March 2010
Senior Member
I've created a bugzilla entry for this problem here:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=342371

Also I've attempted to fix this locally. It seems to be working at least for my use-case with a DTD. I've attached the patch for feedback to the bug.
Re: Element ordering in XML based on DTD [message #664526 is a reply to message #664514] Sun, 10 April 2011 17:38 Go to previous message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 935
Registered: July 2009
Senior Member
Hi Greg,

I am glad to see that you are finding Sapphire useful. We do have support for automatically detecting correct insertion order. I have responded in the bug.

Thanks,

Konstantin
Previous Topic:Graphiti Integration
Next Topic:Hooking up the property view
Goto Forum:
  


Current Time: Wed Jul 23 10:13:03 EDT 2014

Powered by FUDForum. Page generated in 0.01887 seconds