Home » Archived » XML Schema Definition (XSD) » Creating a generic editor for an XML Schema
Creating a generic editor for an XML Schema [message #4362] |
Fri, 25 October 2002 02:10  |
Eclipse User |
|
|
|
Originally posted by: troynet+web.ugcs.net
Is anyone aware of generic patterns to approaching building an editor or
form based on an XML Schema?
Basically, given an XML schema, I'm trying to maximize the amount of
automation that is done generating an editor based on it and minimize the
amount of schema-specific code I have to write.
For example, let's say I just want to have an XML editor in the form of a
hierarchical tree. Now the user wants to add a child element to a
selected parent element, but I want to make sure that adding that element
does not invalidate the entire XML document and I want to give the user an
immediate error if it does. I could just validate the entire document
upon every action of the user, but this clearly does not scale. Thus an
incremental approach would work best.
Ideally, given a specific context within the XML document being built by
the user, my program should be able to figure out exactly what elements
would be allowed at that spot and only offer the user the chance to insert
these given validating elements. In other words, it would be best if my
program could call something like
schema.getPossibleElements( context )
The same thing goes for attributes. If I had a form that asked the user
to specify the value of attributes, my program should be able to
"incrementally parse" the schema and present the valid values of an
attribute if they are enumerated or easily translate the XML Schema
constraints into code. Something like:
schema.getPossibleAttributes( context )
schema.validate( context, attributeValue )
From what I've seen of Eclipse XSD or Castor, what we have are still
low-level libraries.
Is anyone aware of higher-level libraries or uniform approaches in
industry to generalizing the schema-to-editor problem? Don't have to be
with Eclipse XSD.
|
|
|
Re: Creating a generic editor for an XML Schema [message #4433 is a reply to message #4362] |
Fri, 25 October 2002 07:58  |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
--------------1B94371C8BC0B8E400D00828
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Troy,
I'm trying to construct the XSD components so that they can be used to build
an editor like this. For example, XSDSimpleTypeDefinition has a method
"assess" that will do Part 2 Schema validation of a literal; similarly
XSDParticle has a method getDFA that can be used to recognize valid element
content. I'm currently working hard to complete the Part 1 validation
support.
I am also working on mapping XSD to Ecore which we use to generate a complete
editor in the style you describe below. The work is quite preliminary but we
expect it to evolve quickly. The latest version of the XSDEditor contains the
code for building an Ecore model from XSD (and vice versa as well). If you
check out the EMF site (What's new, item 6)
http://www.eclipse.org/emf
you can try out what we have right now in terms of generating editors and
models from XML Schemas.
Please check it out and let me know what you think. There are many interesting
"projects" in this space, for example, generating a web-based form to do the
editing would be really cool...
Troy Bridoux wrote:
> Is anyone aware of generic patterns to approaching building an editor or
> form based on an XML Schema?
>
> Basically, given an XML schema, I'm trying to maximize the amount of
> automation that is done generating an editor based on it and minimize the
> amount of schema-specific code I have to write.
>
> For example, let's say I just want to have an XML editor in the form of a
> hierarchical tree. Now the user wants to add a child element to a
> selected parent element, but I want to make sure that adding that element
> does not invalidate the entire XML document and I want to give the user an
> immediate error if it does. I could just validate the entire document
> upon every action of the user, but this clearly does not scale. Thus an
> incremental approach would work best.
>
> Ideally, given a specific context within the XML document being built by
> the user, my program should be able to figure out exactly what elements
> would be allowed at that spot and only offer the user the chance to insert
> these given validating elements. In other words, it would be best if my
> program could call something like
> schema.getPossibleElements( context )
>
> The same thing goes for attributes. If I had a form that asked the user
> to specify the value of attributes, my program should be able to
> "incrementally parse" the schema and present the valid values of an
> attribute if they are enumerated or easily translate the XML Schema
> constraints into code. Something like:
> schema.getPossibleAttributes( context )
> schema.validate( context, attributeValue )
>
> From what I've seen of Eclipse XSD or Castor, what we have are still
> low-level libraries.
>
> Is anyone aware of higher-level libraries or uniform approaches in
> industry to generalizing the schema-to-editor problem? Don't have to be
> with Eclipse XSD.
--
Ed Merks
--------------1B94371C8BC0B8E400D00828
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Troy,
<p>I'm trying to construct the XSD components so that they can be used
to build an editor like this. For example, XSDSimpleTypeDefinition
has a method "assess" that will do Part 2 Schema validation of a literal;
similarly XSDParticle has a method getDFA that can be used to recognize
valid element content. I'm currently working hard to complete the
Part 1 validation support.
<p>I am also working on mapping XSD to Ecore which we use to generate a
complete editor in the style you describe below. The work is quite
preliminary but we expect it to evolve quickly. The latest version
of the XSDEditor contains the code for building an Ecore model from XSD
(and vice versa as well). If you check out the EMF site (What's new,
item 6)
<blockquote> <a href="http://www.eclipse.org/emf">http://www.eclipse.org/emf</a></blockquote>
you can try out what we have right now in terms of generating editors and
models from XML Schemas.
<p>Please check it out and let me know what you think. There are many interesting
"projects" in this space, for example, generating a web-based form to do
the editing would be really cool...
<br>
<p>Troy Bridoux wrote:
<blockquote TYPE=CITE>Is anyone aware of generic patterns to approaching
building an editor or
<br>form based on an XML Schema?
<p>Basically, given an XML schema, I'm trying to maximize the amount of
<br>automation that is done generating an editor based on it and minimize
the
<br>amount of schema-specific code I have to write.
<p>For example, let's say I just want to have an XML editor in the form
of a
<br>hierarchical tree. Now the user wants to add a child element
to a
<br>selected parent element, but I want to make sure that adding that element
<br>does not invalidate the entire XML document and I want to give the
user an
<br>immediate error if it does. I could just validate the entire
document
<br>upon every action of the user, but this clearly does not scale.
Thus an
<br>incremental approach would work best.
<p>Ideally, given a specific context within the XML document being built
by
<br>the user, my program should be able to figure out exactly what elements
<br>would be allowed at that spot and only offer the user the chance to
insert
<br>these given validating elements. In other words, it would be
best if my
<br>program could call something like
<br> schema.getPossibleElements( context )
<p>The same thing goes for attributes. If I had a form that asked
the user
<br>to specify the value of attributes, my program should be able to
<br>"incrementally parse" the schema and present the valid values of an
<br>attribute if they are enumerated or easily translate the XML Schema
<br>constraints into code. Something like:
<br> schema.getPossibleAttributes( context )
<br> schema.validate( context, attributeValue )
<p>From what I've seen of Eclipse XSD or Castor, what we have are still
<br>low-level libraries.
<p>Is anyone aware of higher-level libraries or uniform approaches in
<br>industry to generalizing the schema-to-editor problem? Don't
have to be
<br>with Eclipse XSD.</blockquote>
<p>--
<br>Ed Merks
<br> </html>
--------------1B94371C8BC0B8E400D00828--
|
|
|
Re: Creating a generic editor for an XML Schema [message #563476 is a reply to message #4362] |
Fri, 25 October 2002 07:58  |
Eclipse User |
|
|
|
--------------1B94371C8BC0B8E400D00828
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Troy,
I'm trying to construct the XSD components so that they can be used to build
an editor like this. For example, XSDSimpleTypeDefinition has a method
"assess" that will do Part 2 Schema validation of a literal; similarly
XSDParticle has a method getDFA that can be used to recognize valid element
content. I'm currently working hard to complete the Part 1 validation
support.
I am also working on mapping XSD to Ecore which we use to generate a complete
editor in the style you describe below. The work is quite preliminary but we
expect it to evolve quickly. The latest version of the XSDEditor contains the
code for building an Ecore model from XSD (and vice versa as well). If you
check out the EMF site (What's new, item 6)
http://www.eclipse.org/emf
you can try out what we have right now in terms of generating editors and
models from XML Schemas.
Please check it out and let me know what you think. There are many interesting
"projects" in this space, for example, generating a web-based form to do the
editing would be really cool...
Troy Bridoux wrote:
> Is anyone aware of generic patterns to approaching building an editor or
> form based on an XML Schema?
>
> Basically, given an XML schema, I'm trying to maximize the amount of
> automation that is done generating an editor based on it and minimize the
> amount of schema-specific code I have to write.
>
> For example, let's say I just want to have an XML editor in the form of a
> hierarchical tree. Now the user wants to add a child element to a
> selected parent element, but I want to make sure that adding that element
> does not invalidate the entire XML document and I want to give the user an
> immediate error if it does. I could just validate the entire document
> upon every action of the user, but this clearly does not scale. Thus an
> incremental approach would work best.
>
> Ideally, given a specific context within the XML document being built by
> the user, my program should be able to figure out exactly what elements
> would be allowed at that spot and only offer the user the chance to insert
> these given validating elements. In other words, it would be best if my
> program could call something like
> schema.getPossibleElements( context )
>
> The same thing goes for attributes. If I had a form that asked the user
> to specify the value of attributes, my program should be able to
> "incrementally parse" the schema and present the valid values of an
> attribute if they are enumerated or easily translate the XML Schema
> constraints into code. Something like:
> schema.getPossibleAttributes( context )
> schema.validate( context, attributeValue )
>
> From what I've seen of Eclipse XSD or Castor, what we have are still
> low-level libraries.
>
> Is anyone aware of higher-level libraries or uniform approaches in
> industry to generalizing the schema-to-editor problem? Don't have to be
> with Eclipse XSD.
--
Ed Merks
--------------1B94371C8BC0B8E400D00828
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Troy,
<p>I'm trying to construct the XSD components so that they can be used
to build an editor like this. For example, XSDSimpleTypeDefinition
has a method "assess" that will do Part 2 Schema validation of a literal;
similarly XSDParticle has a method getDFA that can be used to recognize
valid element content. I'm currently working hard to complete the
Part 1 validation support.
<p>I am also working on mapping XSD to Ecore which we use to generate a
complete editor in the style you describe below. The work is quite
preliminary but we expect it to evolve quickly. The latest version
of the XSDEditor contains the code for building an Ecore model from XSD
(and vice versa as well). If you check out the EMF site (What's new,
item 6)
<blockquote> <a href="http://www.eclipse.org/emf">http://www.eclipse.org/emf</a></blockquote>
you can try out what we have right now in terms of generating editors and
models from XML Schemas.
<p>Please check it out and let me know what you think. There are many interesting
"projects" in this space, for example, generating a web-based form to do
the editing would be really cool...
<br>
<p>Troy Bridoux wrote:
<blockquote TYPE=CITE>Is anyone aware of generic patterns to approaching
building an editor or
<br>form based on an XML Schema?
<p>Basically, given an XML schema, I'm trying to maximize the amount of
<br>automation that is done generating an editor based on it and minimize
the
<br>amount of schema-specific code I have to write.
<p>For example, let's say I just want to have an XML editor in the form
of a
<br>hierarchical tree. Now the user wants to add a child element
to a
<br>selected parent element, but I want to make sure that adding that element
<br>does not invalidate the entire XML document and I want to give the
user an
<br>immediate error if it does. I could just validate the entire
document
<br>upon every action of the user, but this clearly does not scale.
Thus an
<br>incremental approach would work best.
<p>Ideally, given a specific context within the XML document being built
by
<br>the user, my program should be able to figure out exactly what elements
<br>would be allowed at that spot and only offer the user the chance to
insert
<br>these given validating elements. In other words, it would be
best if my
<br>program could call something like
<br> schema.getPossibleElements( context )
<p>The same thing goes for attributes. If I had a form that asked
the user
<br>to specify the value of attributes, my program should be able to
<br>"incrementally parse" the schema and present the valid values of an
<br>attribute if they are enumerated or easily translate the XML Schema
<br>constraints into code. Something like:
<br> schema.getPossibleAttributes( context )
<br> schema.validate( context, attributeValue )
<p>From what I've seen of Eclipse XSD or Castor, what we have are still
<br>low-level libraries.
<p>Is anyone aware of higher-level libraries or uniform approaches in
<br>industry to generalizing the schema-to-editor problem? Don't
have to be
<br>with Eclipse XSD.</blockquote>
<p>--
<br>Ed Merks
<br> </html>
--------------1B94371C8BC0B8E400D00828--
|
|
|
Goto Forum:
Current Time: Thu May 08 01:07:58 EDT 2025
Powered by FUDForum. Page generated in 0.03476 seconds
|