Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » Element ordering in XML based on DTD
Element ordering in XML based on DTD [message #664500] Sun, 10 April 2011 05:31 Go to next message
Greg Amerson is currently offline Greg AmersonFriend
Messages: 119
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 05: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 16:44 Go to previous messageGo to next message
Greg Amerson is currently offline Greg AmersonFriend
Messages: 119
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 21:38 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
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: Tue Mar 19 05:57:32 GMT 2024

Powered by FUDForum. Page generated in 0.02184 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top