Home » Modeling » EMF » Suppressing model object in XSD based models
| Suppressing model object in XSD based models [message #403303] |
Thu, 31 August 2006 06:16  |
Eclipse User |
|
|
|
I am trying to suppress model elements in an XSD based model and I have
encountered some difficulties trying to follow the book example for doing
this.
One source of difficulty is that I am trying to suppress the leaf data nodes
and shift the text properties to their parents.
The problem is that These nodes do not have corresponding model classes;
they are handled with FeatureMaps.
Suppressing them is easy enough,
but I do not see how to get the property descriptors for them.
thanks
Daniel
|
|
| |
| Re: Suppressing model object in XSD based models [message #403333 is a reply to message #403306] |
Fri, 01 September 2006 12:45   |
Eclipse User |
|
|
|
--nextPart1279010.L88O1DYuUT
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8Bit
Ed,
The issue occurs for pure text nodes with attributes,
specified in XSD by a construct like
<xs:element name="stuff">
<xs:complexType mixed="true">
<xs:attribute name="att1" type="xs:NCName"/>
<xs:attributeGroup ref="atts"/>
</xs:complexType>
</xs:element>
even though the content is not really mixed.
If there were no attributes and the schema read:
<xs:element name="stuff" type="string"/>
then the text body would be the Value property
of the <stuff> node in the model editor.
However, for the schema with attributes,
the model editor uses an extra text node below <stuff>
to hold the Value property
(presumably beacuse mixed imlies multiplicity,
even though ther is no multiplicity in this case)
I am attaching a schema and an instace which illustrate this.
thanks
Daniel
Ed Merks wrote:
> Daniel,
>
> Maybe you could show your schema, or a simplified example schema, so I
> can understand concretely the issue. It might just be a matter of
> fiddling with the GenFeaure properties for the features in question to
> indicate that there should be an editable property for them...
>
>
> dmahler@gmail.com wrote:
>> I am trying to suppress model elements in an XSD based model and I have
>> encountered some difficulties trying to follow the book example for doing
>> this.
>>
>> One source of difficulty is that I am trying to suppress the leaf data
>> nodes and shift the text properties to their parents.
>> The problem is that These nodes do not have corresponding model classes;
>> they are handled with FeatureMaps.
>> Suppressing them is easy enough,
>> but I do not see how to get the property descriptors for them.
>>
>> thanks
>> Daniel
>>
--nextPart1279010.L88O1DYuUT
Content-Type: text/html; name="relaxng.xsd"
Content-Transfer-Encoding: 8Bit
Content-Disposition: attachment; filename="relaxng.xsd"
<?xml version="1.0" encoding="UTF-8"?>
<!-- RELAX NG for RELAX NG -->
<!-- $Id: relaxng.rng,v 1.31 2002/05/30 06:07:43 jjc Exp $ -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://relaxng.org/ns/structure/1.0" xmlns:local="http://relaxng.org/ns/structure/1.0">
<xs:element name="pattern" abstract="true" substitutionGroup="local:open-pattern"/>
<xs:element name="element" substitutionGroup="local:pattern">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:open-patterns">
<xs:attribute name="name" type="xs:QName"/>
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="attribute" substitutionGroup="local:pattern">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="local:pattern"/>
</xs:sequence>
<xs:attributeGroup ref="local:common-atts"/>
<xs:attribute name="name" type="xs:QName"/>
</xs:complexType>
</xs:element>
<xs:element name="group" substitutionGroup="local:pattern">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:open-patterns">
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="interleave" substitutionGroup="local:pattern">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:open-patterns">
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="choice" substitutionGroup="local:pattern">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:open-patterns">
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="optional" substitutionGroup="local:pattern">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:open-patterns">
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="zeroOrMore" substitutionGroup="local:pattern">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:open-patterns">
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="oneOrMore" substitutionGroup="local:pattern">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:open-patterns">
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="list" substitutionGroup="local:pattern">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:open-patterns">
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="mixed" substitutionGroup="local:pattern">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:open-patterns">
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="ref" substitutionGroup="local:pattern">
<xs:complexType>
<xs:attribute name="name" use="required" type="xs:NCName"/>
<xs:attributeGroup ref="local:common-atts"/>
</xs:complexType>
</xs:element>
<xs:element name="parentRef" substitutionGroup="local:pattern">
<xs:complexType>
<xs:attribute name="name" use="required" type="xs:NCName"/>
<xs:attributeGroup ref="local:common-atts"/>
</xs:complexType>
</xs:element>
<xs:element name="empty" substitutionGroup="local:pattern">
<xs:complexType>
<xs:attributeGroup ref="local:common-atts"/>
</xs:complexType>
</xs:element>
<xs:element name="text" substitutionGroup="local:pattern">
<xs:complexType>
<xs:attributeGroup ref="local:common-atts"/>
</xs:complexType>
</xs:element>
<xs:element name="value" substitutionGroup="local:pattern">
<xs:complexType mixed="true">
<xs:attribute name="type" type="xs:NCName"/>
<xs:attributeGroup ref="local:common-atts"/>
</xs:complexType>
</xs:element>
<xs:element name="data" substitutionGroup="local:pattern">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="local:param"/>
<xs:element minOccurs="0" name="except">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:open-patterns">
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="type" use="required" type="xs:NCName"/>
<xs:attributeGroup ref="local:common-atts"/>
</xs:complexType>
</xs:element>
<xs:element name="param">
<xs:complexType mixed="true">
<xs:attribute name="name" use="required" type="xs:NCName"/>
<xs:attributeGroup ref="local:common-atts"/>
</xs:complexType>
</xs:element>
<xs:element name="notAllowed" substitutionGroup="local:pattern">
<xs:complexType>
<xs:attributeGroup ref="local:common-atts"/>
</xs:complexType>
</xs:element>
<xs:element name="externalRef" substitutionGroup="local:pattern">
<xs:complexType>
<xs:attribute name="href" use="required" type="xs:anyURI"/>
<xs:attributeGroup ref="local:common-atts"/>
</xs:complexType>
</xs:element>
<xs:element name="grammar" substitutionGroup="local:pattern">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:grammar-content">
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:complexType name="grammar-content">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="local:start"/>
<xs:element ref="local:define"/>
<xs:element name="div">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:grammar-content">
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element ref="local:include"/>
</xs:choice>
</xs:complexType>
<xs:element name="include">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:include-content">
<xs:attribute name="href" use="required" type="xs:anyURI"/>
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:complexType name="include-content">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="local:start"/>
<xs:element ref="local:define"/>
<xs:element name="div">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:include-content">
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:element name="start">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:open-pattern">
<xs:attributeGroup ref="local:combine-att"/>
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="define">
<xs:complexType>
<xs:complexContent>
<xs:extension base="local:open-patterns">
<xs:attribute name="name" use="required" type="xs:NCName"/>
<xs:attributeGroup ref="local:combine-att"/>
<xs:attributeGroup ref="local:common-atts"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="combine-att">
<xs:attribute name="combine">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="choice"/>
<xs:enumeration value="interleave"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
<xs:complexType name="open-patterns">
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="local:pattern"/>
</xs:sequence>
</xs:complexType>
<xs:element name="open-pattern" abstract="true"/>
<xs:complexType name="open-pattern">
<xs:sequence>
<xs:element ref="local:open-pattern"/>
</xs:sequence>
</xs:complexType>
<xs:group name="except-name-class">
<xs:sequence>
<xs:element minOccurs="0" ref="local:except"/>
</xs:sequence>
</xs:group>
<xs:element name="except" abstract="true"/>
<xs:attributeGroup name="common-atts">
<xs:attribute name="ns"/>
<xs:attribute name="datatypeLibrary" type="xs:anyURI"/>
<xs:anyAttribute namespace="##other" processContents="skip"/>
</xs:attributeGroup>
</xs:schema>
--nextPart1279010.L88O1DYuUT
Content-Type: text/plain; name="test.xml"
Content-Transfer-Encoding: 8Bit
Content-Disposition: attachment; filename="test.xml"
<?xml version="1.0" encoding="UTF-8"?>
<_1:grammar xmlns:_1="http://relaxng.org/ns/structure/1.0">
<_1:start>
<_1:value>some text</_1:value>
</_1:start>
</_1:grammar>
--nextPart1279010.L88O1DYuUT--
|
|
|
| Re: Suppressing model object in XSD based models [message #403336 is a reply to message #403333] |
Fri, 01 September 2006 14:06   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------050106020902060404050509
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Daniel,
You'd have a much nicer API if you used simpleContent that extends base
xsd:string.
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="name" type="xsd:string"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
Can you change the schema? (They accept the same XML syntax.)
dmahler@gmail.com wrote:
> Ed,
>
> The issue occurs for pure text nodes with attributes,
> specified in XSD by a construct like
>
> <xs:element name="stuff">
> <xs:complexType mixed="true">
> <xs:attribute name="att1" type="xs:NCName"/>
> <xs:attributeGroup ref="atts"/>
> </xs:complexType>
> </xs:element>
>
> even though the content is not really mixed.
> If there were no attributes and the schema read:
>
> <xs:element name="stuff" type="string"/>
>
> then the text body would be the Value property
> of the <stuff> node in the model editor.
> However, for the schema with attributes,
> the model editor uses an extra text node below <stuff>
> to hold the Value property
> (presumably beacuse mixed imlies multiplicity,
> even though ther is no multiplicity in this case)
>
> I am attaching a schema and an instace which illustrate this.
>
> thanks
> Daniel
>
>
> Ed Merks wrote:
>
>
>> Daniel,
>>
>> Maybe you could show your schema, or a simplified example schema, so I
>> can understand concretely the issue. It might just be a matter of
>> fiddling with the GenFeaure properties for the features in question to
>> indicate that there should be an editable property for them...
>>
>>
>> dmahler@gmail.com wrote:
>>
>>> I am trying to suppress model elements in an XSD based model and I have
>>> encountered some difficulties trying to follow the book example for doing
>>> this.
>>>
>>> One source of difficulty is that I am trying to suppress the leaf data
>>> nodes and shift the text properties to their parents.
>>> The problem is that These nodes do not have corresponding model classes;
>>> they are handled with FeatureMaps.
>>> Suppressing them is easy enough,
>>> but I do not see how to get the property descriptors for them.
>>>
>>> thanks
>>> Daniel
>>>
>>>
>>>
>>> ------------------------------------------------------------ ------------
>>>
>>> ------------------------------------------------------------ ------------
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <_1:grammar xmlns:_1="http://relaxng.org/ns/structure/1.0">
>>> <_1:start>
>>> <_1:value>some text</_1:value>
>>> </_1:start>
>>> </_1:grammar>
>>>
--------------050106020902060404050509
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Daniel,<br>
<br>
You'd have a much nicer API if you used simpleContent that extends
base xsd:string. <br>
<blockquote> <xsd:complexType><br>
<xsd:simpleContent><br>
<xsd:extension base="xsd:string"><br>
<xsd:attribute name="name" type="xsd:string"/><br>
</xsd:extension><br>
</xsd:simpleContent><br>
</xsd:complexType><br>
</blockquote>
Can you change the schema? (They accept the same XML syntax.)<br>
<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:dmahler@gmail.com">dmahler@gmail.com</a> wrote:
<blockquote cite="mided9nph$4dq$1@utils.eclipse.org" type="cite">
<pre wrap="">Ed,
The issue occurs for pure text nodes with attributes,
specified in XSD by a construct like
<xs:element name="stuff">
<xs:complexType mixed="true">
<xs:attribute name="att1" type="xs:NCName"/>
<xs:attributeGroup ref="atts"/>
</xs:complexType>
</xs:element>
even though the content is not really mixed.
If there were no attributes and the schema read:
<xs:element name="stuff" type="string"/>
then the text body would be the Value property
of the <stuff> node in the model editor.
However, for the schema with attributes,
the model editor uses an extra text node below <stuff>
to hold the Value property
(presumably beacuse mixed imlies multiplicity,
even though ther is no multiplicity in this case)
I am attaching a schema and an instace which illustrate this.
thanks
Daniel
Ed Merks wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Daniel,
Maybe you could show your schema, or a simplified example schema, so I
can understand concretely the issue. It might just be a matter of
fiddling with the GenFeaure properties for the features in question to
indicate that there should be an editable property for them...
<a class="moz-txt-link-abbreviated" href="mailto:dmahler@gmail.com">dmahler@gmail.com</a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I am trying to suppress model elements in an XSD based model and I have
encountered some difficulties trying to follow the book example for doing
this.
One source of difficulty is that I am trying to suppress the leaf data
nodes and shift the text properties to their parents.
The problem is that These nodes do not have corresponding model classes;
they are handled with FeatureMaps.
Suppressing them is easy enough,
but I do not see how to get the property descriptors for them.
thanks
Daniel
</pre>
<br>
<hr size="4" width="90%"><br>
<!-- RELAX NG for RELAX NG -->
<!-- $Id: relaxng.rng,v 1.31 2002/05/30 06:07:43 jjc Exp $ --><xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementformdefault="qualified"
targetnamespace="http://relaxng.org/ns/structure/1.0"
xmlns:local="http://relaxng.org/ns/structure/1.0"> <xs:element
name="pattern" abstract="true" substitutiongroup="local:open-pattern">
<xs:element name="element" substitutiongroup="local:pattern"> <xs:complexType>
<xs:complexContent> <xs:extension base="local:open-patterns"> <xs:attribute
name="name" type="xs:QName"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:attribute> </xs:extension>
</xs:complexContent> <xs:element name="attribute"
substitutiongroup="local:pattern"> <xs:complexType> <xs:sequence> <xs:element
minoccurs="0" ref="local:pattern"> </xs:element> <xs:attributeGroup
ref="local:common-atts"> <xs:attribute name="name" type="xs:QName"> </xs:attribute>
</xs:attributeGroup> <xs:element name="group"
substitutiongroup="local:pattern"> <xs:complexType> <xs:complexContent>
<xs:extension base="local:open-patterns"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:extension> </xs:complexContent>
</xs:complexType> <xs:element name="interleave"
substitutiongroup="local:pattern"> <xs:complexType> <xs:complexContent>
<xs:extension base="local:open-patterns"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:extension> </xs:complexContent>
</xs:complexType> <xs:element name="choice"
substitutiongroup="local:pattern"> <xs:complexType> <xs:complexContent>
<xs:extension base="local:open-patterns"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:extension> </xs:complexContent>
</xs:complexType> <xs:element name="optional"
substitutiongroup="local:pattern"> <xs:complexType> <xs:complexContent>
<xs:extension base="local:open-patterns"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:extension> </xs:complexContent>
</xs:complexType> <xs:element name="zeroOrMore"
substitutiongroup="local:pattern"> <xs:complexType> <xs:complexContent>
<xs:extension base="local:open-patterns"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:extension> </xs:complexContent>
</xs:complexType> <xs:element name="oneOrMore"
substitutiongroup="local:pattern"> <xs:complexType> <xs:complexContent>
<xs:extension base="local:open-patterns"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:extension> </xs:complexContent>
</xs:complexType> <xs:element name="list"
substitutiongroup="local:pattern"> <xs:complexType> <xs:complexContent>
<xs:extension base="local:open-patterns"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:extension> </xs:complexContent>
</xs:complexType> <xs:element name="mixed"
substitutiongroup="local:pattern"> <xs:complexType> <xs:complexContent>
<xs:extension base="local:open-patterns"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:extension> </xs:complexContent>
</xs:complexType> <xs:element name="ref"
substitutiongroup="local:pattern"> <xs:complexType> <xs:attribute
name="name" use="required" type="xs:NCName"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:attribute> <xs:element
name="parentRef" substitutiongroup="local:pattern"> <xs:complexType> <xs:attribute
name="name" use="required" type="xs:NCName"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:attribute> <xs:element
name="empty" substitutiongroup="local:pattern"> <xs:complexType> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:complexType> <xs:element
name="text" substitutiongroup="local:pattern"> <xs:complexType> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:complexType> <xs:element
name="value" substitutiongroup="local:pattern"> <xs:complexType
mixed="true"> <xs:attribute name="type" type="xs:NCName"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:attribute> <xs:element
name="data" substitutiongroup="local:pattern"> <xs:complexType> <xs:sequence>
<xs:element minoccurs="0" maxoccurs="unbounded" ref="local:param">
<xs:element minoccurs="0" name="except"> <xs:complexType> <xs:complexContent>
<xs:extension base="local:open-patterns"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:extension> </xs:complexContent>
</xs:complexType> </xs:element> <xs:attribute name="type"
use="required" type="xs:NCName"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:attribute> <xs:element
name="param"> <xs:complexType mixed="true"> <xs:attribute name="name"
use="required" type="xs:NCName"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:attribute> <xs:element
name="notAllowed" substitutiongroup="local:pattern"> <xs:complexType>
<xs:attributeGroup ref="local:common-atts"> </xs:attributeGroup>
</xs:complexType> <xs:element name="externalRef"
substitutiongroup="local:pattern"> <xs:complexType> <xs:attribute
name="href" use="required" type="xs:anyURI"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:attribute> <xs:element
name="grammar" substitutiongroup="local:pattern"> <xs:complexType> <xs:complexContent>
<xs:extension base="local:grammar-content"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:extension> </xs:complexContent>
</xs:complexType> <xs:complexType name="grammar-content"> <xs:choice
minoccurs="0" maxoccurs="unbounded"> <xs:element ref="local:start"> <xs:element
ref="local:define"> <xs:element name="div"> <xs:complexType> <xs:complexContent>
<xs:extension base="local:grammar-content"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:extension> </xs:complexContent>
</xs:complexType> <xs:element ref="local:include"> </xs:element>
</xs:element> <xs:element name="include"> <xs:complexType> <xs:complexContent>
<xs:extension base="local:include-content"> <xs:attribute
name="href" use="required" type="xs:anyURI"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:attribute> </xs:extension>
</xs:complexContent> <xs:complexType name="include-content"> <xs:choice
minoccurs="0" maxoccurs="unbounded"> <xs:element ref="local:start"> <xs:element
ref="local:define"> <xs:element name="div"> <xs:complexType> <xs:complexContent>
<xs:extension base="local:include-content"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:extension> </xs:complexContent>
</xs:complexType> </xs:element> </xs:element> <xs:element
name="start"> <xs:complexType> <xs:complexContent> <xs:extension
base="local:open-pattern"> <xs:attributeGroup ref="local:combine-att">
<xs:attributeGroup ref="local:common-atts"> </xs:attributeGroup>
</xs:attributeGroup> </xs:extension> </xs:complexContent> <xs:element
name="define"> <xs:complexType> <xs:complexContent> <xs:extension
base="local:open-patterns"> <xs:attribute name="name" use="required"
type="xs:NCName"> <xs:attributeGroup ref="local:combine-att"> <xs:attributeGroup
ref="local:common-atts"> </xs:attributeGroup> </xs:attributeGroup> </xs:attribute>
</xs:extension> <xs:attributeGroup name="combine-att"> <xs:attribute
name="combine"> <xs:simpleType> <xs:restriction base="xs:token"> <xs:enumeration
value="choice"> <xs:enumeration value="interleave"> </xs:enumeration>
</xs:enumeration> </xs:restriction> </xs:simpleType> <xs:complexType
name="open-patterns"> <xs:sequence> <xs:element maxoccurs="unbounded"
ref="local:pattern"> </xs:element> </xs:sequence> <xs:element
name="open-pattern" abstract="true"> <xs:complexType
name="open-pattern"> <xs:sequence> <xs:element
ref="local:open-pattern"> </xs:element> </xs:sequence> <xs:group
name="except-name-class"> <xs:sequence> <xs:element minoccurs="0"
ref="local:except"> </xs:element> </xs:sequence> <xs:element
name="except" abstract="true"> <xs:attributeGroup name="common-atts">
<xs:attribute name="ns"> <xs:attribute name="datatypeLibrary"
type="xs:anyURI"> <xs:anyAttribute namespace="##other"
processcontents="skip"> </xs:anyAttribute>
</xs:attribute></xs:attribute></xs:attributeGroup></xs:element ></xs:group></xs:complexType></xs:element></xs:complexType ></xs:attribute></xs:attributeGroup></xs:complexContent></xs:complexType ></xs:element></xs:complexType></xs:element></xs:element> </xs:choice></xs:complexType></xs:complexType></xs:element ></xs:element></xs:element></xs:choice></xs:complexType></xs:element ></xs:complexType></xs:element></xs:element></xs:complexType ></xs:element></xs:element></xs:sequence></xs:complexType ></xs:element></xs:complexType></xs:element></xs:element> </xs:element></xs:complexType></xs:element></xs:complexType ></xs:element></xs:element></xs:element></xs:element></xs:element ></xs:element></xs:element></xs:element></xs:element></xs:sequence ></xs:complexType></xs:element></xs:complexType></xs:element ></xs:element></xs:schema>
<pre wrap="">
<hr size="4" width="90%">
<?xml version="1.0" encoding="UTF-8"?>
<_1:grammar xmlns:_1=<a class="moz-txt-link-rfc2396E" href="http://relaxng.org/ns/structure/1.0">"http://relaxng.org/ns/structure/1.0"</a>>
<_1:start>
<_1:value>some text</_1:value>
</_1:start>
</_1:grammar>
</pre>
</blockquote>
</blockquote>
</blockquote>
<br>
</body>
</html>
--------------050106020902060404050509--
|
|
|
| Re: Suppressing model object in XSD based models [message #403340 is a reply to message #403336] |
Fri, 01 September 2006 14:30   |
Eclipse User |
|
|
|
Ed,
I can, but it is not optimal.
I works with schemas that are developed and maintained in RelaxNG
and converted automatically to XSD
to get an authoring environment for instance documents in Eclipse.
I would prefer not to do eny editing on the xsd side.
I could write an xslt to clean up the generated XSDs,
but I would prefer to use the XSDs as given if possible.
I would also like to get a better understanding of EMF.
thanks
Daniel
Ed Merks wrote:
> Daniel,
>
> You'd have a much nicer API if you used simpleContent that extends base
> xsd:string.
>
> <xsd:complexType>
> <xsd:simpleContent>
> <xsd:extension base="xsd:string">
> <xsd:attribute name="name" type="xsd:string"/>
> </xsd:extension>
> </xsd:simpleContent>
> </xsd:complexType>
>
> Can you change the schema? (They accept the same XML syntax.)
>
>
> dmahler@gmail.com wrote:
>> Ed,
>>
>> The issue occurs for pure text nodes with attributes,
>> specified in XSD by a construct like
>>
>> <xs:element name="stuff">
>> <xs:complexType mixed="true">
>> <xs:attribute name="att1" type="xs:NCName"/>
>> <xs:attributeGroup ref="atts"/>
>> </xs:complexType>
>> </xs:element>
>>
>> even though the content is not really mixed.
>> If there were no attributes and the schema read:
>>
>> <xs:element name="stuff" type="string"/>
>>
>> then the text body would be the Value property
>> of the <stuff> node in the model editor.
>> However, for the schema with attributes,
>> the model editor uses an extra text node below <stuff>
>> to hold the Value property
>> (presumably beacuse mixed imlies multiplicity,
>> even though ther is no multiplicity in this case)
>>
>> I am attaching a schema and an instace which illustrate this.
>>
>> thanks
>> Daniel
>>
>>
>> Ed Merks wrote:
>>
>>
>>> Daniel,
>>>
>>> Maybe you could show your schema, or a simplified example schema, so I
>>> can understand concretely the issue. It might just be a matter of
>>> fiddling with the GenFeaure properties for the features in question to
>>> indicate that there should be an editable property for them...
>>>
>>>
>>> dmahler@gmail.com wrote:
>>>
>>>> I am trying to suppress model elements in an XSD based model and I have
>>>> encountered some difficulties trying to follow the book example for doing
>>>> this.
>>>>
>>>> One source of difficulty is that I am trying to suppress the leaf data
>>>> nodes and shift the text properties to their parents.
>>>> The problem is that These nodes do not have corresponding model classes;
>>>> they are handled with FeatureMaps.
>>>> Suppressing them is easy enough,
>>>> but I do not see how to get the property descriptors for them.
>>>>
>>>> thanks
>>>> Daniel
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------ ------------
>>>>
>>>> ------------------------------------------------------------ ------------
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <_1:grammar xmlns:_1="http://relaxng.org/ns/structure/1.0">
>>>> <_1:start>
>>>> <_1:value>some text</_1:value>
>>>> </_1:start>
>>>> </_1:grammar>
>>>>
|
|
|
| Re: Suppressing model object in XSD based models [message #403341 is a reply to message #403340] |
Fri, 01 September 2006 14:34   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------040303040409060606080905
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Daniel,
The alternative would be to make the mixed feature be a property (via
the GenFeature settings for it) and the specialize the property
descriptor to collect all the mixed text and probably use a multi-line
cell editor (again, another property on the GenFeature) to edit the text.
dmahler@gmail.com wrote:
> Ed,
>
> I can, but it is not optimal.
> I works with schemas that are developed and maintained in RelaxNG
> and converted automatically to XSD
> to get an authoring environment for instance documents in Eclipse.
> I would prefer not to do eny editing on the xsd side.
> I could write an xslt to clean up the generated XSDs,
> but I would prefer to use the XSDs as given if possible.
> I would also like to get a better understanding of EMF.
>
> thanks
> Daniel
>
>
> Ed Merks wrote:
>
>
>> Daniel,
>>
>> You'd have a much nicer API if you used simpleContent that extends base
>> xsd:string.
>>
>> <xsd:complexType>
>> <xsd:simpleContent>
>> <xsd:extension base="xsd:string">
>> <xsd:attribute name="name" type="xsd:string"/>
>> </xsd:extension>
>> </xsd:simpleContent>
>> </xsd:complexType>
>>
>> Can you change the schema? (They accept the same XML syntax.)
>>
>>
>> dmahler@gmail.com wrote:
>>
>>> Ed,
>>>
>>> The issue occurs for pure text nodes with attributes,
>>> specified in XSD by a construct like
>>>
>>> <xs:element name="stuff">
>>> <xs:complexType mixed="true">
>>> <xs:attribute name="att1" type="xs:NCName"/>
>>> <xs:attributeGroup ref="atts"/>
>>> </xs:complexType>
>>> </xs:element>
>>>
>>> even though the content is not really mixed.
>>> If there were no attributes and the schema read:
>>>
>>> <xs:element name="stuff" type="string"/>
>>>
>>> then the text body would be the Value property
>>> of the <stuff> node in the model editor.
>>> However, for the schema with attributes,
>>> the model editor uses an extra text node below <stuff>
>>> to hold the Value property
>>> (presumably beacuse mixed imlies multiplicity,
>>> even though ther is no multiplicity in this case)
>>>
>>> I am attaching a schema and an instace which illustrate this.
>>>
>>> thanks
>>> Daniel
>>>
>>>
>>> Ed Merks wrote:
>>>
>>>
>>>
>>>> Daniel,
>>>>
>>>> Maybe you could show your schema, or a simplified example schema, so I
>>>> can understand concretely the issue. It might just be a matter of
>>>> fiddling with the GenFeaure properties for the features in question to
>>>> indicate that there should be an editable property for them...
>>>>
>>>>
>>>> dmahler@gmail.com wrote:
>>>>
>>>>
>>>>> I am trying to suppress model elements in an XSD based model and I have
>>>>> encountered some difficulties trying to follow the book example for doing
>>>>> this.
>>>>>
>>>>> One source of difficulty is that I am trying to suppress the leaf data
>>>>> nodes and shift the text properties to their parents.
>>>>> The problem is that These nodes do not have corresponding model classes;
>>>>> they are handled with FeatureMaps.
>>>>> Suppressing them is easy enough,
>>>>> but I do not see how to get the property descriptors for them.
>>>>>
>>>>> thanks
>>>>> Daniel
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------ ------------
>>>>>
>>>>> ------------------------------------------------------------ ------------
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> <_1:grammar xmlns:_1="http://relaxng.org/ns/structure/1.0">
>>>>> <_1:start>
>>>>> <_1:value>some text</_1:value>
>>>>> </_1:start>
>>>>> </_1:grammar>
>>>>>
>>>>>
>
>
--------------040303040409060606080905
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Daniel,<br>
<br>
The alternative would be to make the mixed feature be a property (via
the GenFeature settings for it) and the specialize the property
descriptor to collect all the mixed text and probably use a multi-line
cell editor (again, another property on the GenFeature) to edit the
text.<br>
<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:dmahler@gmail.com">dmahler@gmail.com</a> wrote:
<blockquote cite="mided9tu6$mlp$1@utils.eclipse.org" type="cite">
<pre wrap="">Ed,
I can, but it is not optimal.
I works with schemas that are developed and maintained in RelaxNG
and converted automatically to XSD
to get an authoring environment for instance documents in Eclipse.
I would prefer not to do eny editing on the xsd side.
I could write an xslt to clean up the generated XSDs,
but I would prefer to use the XSDs as given if possible.
I would also like to get a better understanding of EMF.
thanks
Daniel
Ed Merks wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Daniel,
You'd have a much nicer API if you used simpleContent that extends base
xsd:string.
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="name" type="xsd:string"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
Can you change the schema? (They accept the same XML syntax.)
<a class="moz-txt-link-abbreviated" href="mailto:dmahler@gmail.com">dmahler@gmail.com</a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Ed,
The issue occurs for pure text nodes with attributes,
specified in XSD by a construct like
<xs:element name="stuff">
<xs:complexType mixed="true">
<xs:attribute name="att1" type="xs:NCName"/>
<xs:attributeGroup ref="atts"/>
</xs:complexType>
</xs:element>
even though the content is not really mixed.
If there were no attributes and the schema read:
<xs:element name="stuff" type="string"/>
then the text body would be the Value property
of the <stuff> node in the model editor.
However, for the schema with attributes,
the model editor uses an extra text node below <stuff>
to hold the Value property
(presumably beacuse mixed imlies multiplicity,
even though ther is no multiplicity in this case)
I am attaching a schema and an instace which illustrate this.
thanks
Daniel
Ed Merks wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Daniel,
Maybe you could show your schema, or a simplified example schema, so I
can understand concretely the issue. It might just be a matter of
fiddling with the GenFeaure properties for the features in question to
indicate that there should be an editable property for them...
<a class="moz-txt-link-abbreviated" href="mailto:dmahler@gmail.com">dmahler@gmail.com</a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I am trying to suppress model elements in an XSD based model and I have
encountered some difficulties trying to follow the book example for doing
this.
One source of difficulty is that I am trying to suppress the leaf data
nodes and shift the text properties to their parents.
The problem is that These nodes do not have corresponding model classes;
they are handled with FeatureMaps.
Suppressing them is easy enough,
but I do not see how to get the property descriptors for them.
thanks
Daniel
------------------------------------------------------------ ------------
------------------------------------------------------------ ------------
<?xml version="1.0" encoding="UTF-8"?>
<_1:grammar xmlns:_1=<a class="moz-txt-link-rfc2396E" href="http://relaxng.org/ns/structure/1.0">"http://relaxng.org/ns/structure/1.0"</a>>
<_1:start>
<_1:value>some text</_1:value>
</_1:start>
</_1:grammar>
</pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>
--------------040303040409060606080905--
|
|
|
| Re: Suppressing model object in XSD based models [message #403374 is a reply to message #403341] |
Mon, 04 September 2006 23:38   |
Eclipse User |
|
|
|
Ed,
I've tried this with partial success.
When I open the editor,
I can see the property and its current value.
I can bring up the multiline editor on the property,
and I see the value there too.
However I do not seem to be able to do any actual editing.
I can type into the lefthand field,
but clicking "add" does nothing.
Clicking "remove" does move the current value
from the right hand area to the left,
but the change does not get saved on exiting the editor.
Any idea what might be going on?
thanks
D
Ed Merks wrote:
> Daniel,
>
> The alternative would be to make the mixed feature be a property (via
> the GenFeature settings for it) and the specialize the property
> descriptor to collect all the mixed text and probably use a multi-line
> cell editor (again, another property on the GenFeature) to edit the text.
>
>
> dmahler@gmail.com wrote:
>> Ed,
>>
>> I can, but it is not optimal.
>> I works with schemas that are developed and maintained in RelaxNG
>> and converted automatically to XSD
>> to get an authoring environment for instance documents in Eclipse.
>> I would prefer not to do eny editing on the xsd side.
>> I could write an xslt to clean up the generated XSDs,
>> but I would prefer to use the XSDs as given if possible.
>> I would also like to get a better understanding of EMF.
>>
>> thanks
>> Daniel
>>
>>
>> Ed Merks wrote:
>>
>>
>>> Daniel,
>>>
>>> You'd have a much nicer API if you used simpleContent that extends base
>>> xsd:string.
>>>
>>> <xsd:complexType>
>>> <xsd:simpleContent>
>>> <xsd:extension base="xsd:string">
>>> <xsd:attribute name="name" type="xsd:string"/>
>>> </xsd:extension>
>>> </xsd:simpleContent>
>>> </xsd:complexType>
>>>
>>> Can you change the schema? (They accept the same XML syntax.)
>>>
>>>
>>> dmahler@gmail.com wrote:
>>>
>>>> Ed,
>>>>
>>>> The issue occurs for pure text nodes with attributes,
>>>> specified in XSD by a construct like
>>>>
>>>> <xs:element name="stuff">
>>>> <xs:complexType mixed="true">
>>>> <xs:attribute name="att1" type="xs:NCName"/>
>>>> <xs:attributeGroup ref="atts"/>
>>>> </xs:complexType>
>>>> </xs:element>
>>>>
>>>> even though the content is not really mixed.
>>>> If there were no attributes and the schema read:
>>>>
>>>> <xs:element name="stuff" type="string"/>
>>>>
>>>> then the text body would be the Value property
>>>> of the <stuff> node in the model editor.
>>>> However, for the schema with attributes,
>>>> the model editor uses an extra text node below <stuff>
>>>> to hold the Value property
>>>> (presumably beacuse mixed imlies multiplicity,
>>>> even though ther is no multiplicity in this case)
>>>>
>>>> I am attaching a schema and an instace which illustrate this.
>>>>
>>>> thanks
>>>> Daniel
>>>>
>>>>
>>>> Ed Merks wrote:
>>>>
>>>>
>>>>
>>>>> Daniel,
>>>>>
>>>>> Maybe you could show your schema, or a simplified example schema, so I
>>>>> can understand concretely the issue. It might just be a matter of
>>>>> fiddling with the GenFeaure properties for the features in question to
>>>>> indicate that there should be an editable property for them...
>>>>>
>>>>>
>>>>> dmahler@gmail.com wrote:
>>>>>
>>>>>
>>>>>> I am trying to suppress model elements in an XSD based model and I have
>>>>>> encountered some difficulties trying to follow the book example for doing
>>>>>> this.
>>>>>>
>>>>>> One source of difficulty is that I am trying to suppress the leaf data
>>>>>> nodes and shift the text properties to their parents.
>>>>>> The problem is that These nodes do not have corresponding model classes;
>>>>>> they are handled with FeatureMaps.
>>>>>> Suppressing them is easy enough,
>>>>>> but I do not see how to get the property descriptors for them.
>>>>>>
>>>>>> thanks
>>>>>> Daniel
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------ ------------
>>>>>>
>>>>>> ------------------------------------------------------------ ------------
>>>>>>
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>> <_1:grammar xmlns:_1="http://relaxng.org/ns/structure/1.0">
>>>>>> <_1:start>
>>>>>> <_1:value>some text</_1:value>
>>>>>> </_1:start>
>>>>>> </_1:grammar>
>>>>>>
>>>>>>
>>
>>
|
|
|
| Re: Suppressing model object in XSD based models [message #403381 is a reply to message #403374] |
Tue, 05 September 2006 08:21  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------000407020001010406070305
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Daniel,
You don't want the normal behavior you get for an isMany feature so you
probably want to specialize the isMany method on your item property
descriptor to return false. You'll need to specialize the methods for
producing and accepting an editable value to produce and accept a single
string too.
dmahler@gmail.com wrote:
> Ed,
>
> I've tried this with partial success.
> When I open the editor,
> I can see the property and its current value.
> I can bring up the multiline editor on the property,
> and I see the value there too.
> However I do not seem to be able to do any actual editing.
> I can type into the lefthand field,
> but clicking "add" does nothing.
> Clicking "remove" does move the current value
> from the right hand area to the left,
> but the change does not get saved on exiting the editor.
> Any idea what might be going on?
>
> thanks
> D
>
> Ed Merks wrote:
>
>
>> Daniel,
>>
>> The alternative would be to make the mixed feature be a property (via
>> the GenFeature settings for it) and the specialize the property
>> descriptor to collect all the mixed text and probably use a multi-line
>> cell editor (again, another property on the GenFeature) to edit the text.
>>
>>
>> dmahler@gmail.com wrote:
>>
>>> Ed,
>>>
>>> I can, but it is not optimal.
>>> I works with schemas that are developed and maintained in RelaxNG
>>> and converted automatically to XSD
>>> to get an authoring environment for instance documents in Eclipse.
>>> I would prefer not to do eny editing on the xsd side.
>>> I could write an xslt to clean up the generated XSDs,
>>> but I would prefer to use the XSDs as given if possible.
>>> I would also like to get a better understanding of EMF.
>>>
>>> thanks
>>> Daniel
>>>
>>>
>>> Ed Merks wrote:
>>>
>>>
>>>
>>>> Daniel,
>>>>
>>>> You'd have a much nicer API if you used simpleContent that extends base
>>>> xsd:string.
>>>>
>>>> <xsd:complexType>
>>>> <xsd:simpleContent>
>>>> <xsd:extension base="xsd:string">
>>>> <xsd:attribute name="name" type="xsd:string"/>
>>>> </xsd:extension>
>>>> </xsd:simpleContent>
>>>> </xsd:complexType>
>>>>
>>>> Can you change the schema? (They accept the same XML syntax.)
>>>>
>>>>
>>>> dmahler@gmail.com wrote:
>>>>
>>>>
>>>>> Ed,
>>>>>
>>>>> The issue occurs for pure text nodes with attributes,
>>>>> specified in XSD by a construct like
>>>>>
>>>>> <xs:element name="stuff">
>>>>> <xs:complexType mixed="true">
>>>>> <xs:attribute name="att1" type="xs:NCName"/>
>>>>> <xs:attributeGroup ref="atts"/>
>>>>> </xs:complexType>
>>>>> </xs:element>
>>>>>
>>>>> even though the content is not really mixed.
>>>>> If there were no attributes and the schema read:
>>>>>
>>>>> <xs:element name="stuff" type="string"/>
>>>>>
>>>>> then the text body would be the Value property
>>>>> of the <stuff> node in the model editor.
>>>>> However, for the schema with attributes,
>>>>> the model editor uses an extra text node below <stuff>
>>>>> to hold the Value property
>>>>> (presumably beacuse mixed imlies multiplicity,
>>>>> even though ther is no multiplicity in this case)
>>>>>
>>>>> I am attaching a schema and an instace which illustrate this.
>>>>>
>>>>> thanks
>>>>> Daniel
>>>>>
>>>>>
>>>>> Ed Merks wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Daniel,
>>>>>>
>>>>>> Maybe you could show your schema, or a simplified example schema, so I
>>>>>> can understand concretely the issue. It might just be a matter of
>>>>>> fiddling with the GenFeaure properties for the features in question to
>>>>>> indicate that there should be an editable property for them...
>>>>>>
>>>>>>
>>>>>> dmahler@gmail.com wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> I am trying to suppress model elements in an XSD based model and I have
>>>>>>> encountered some difficulties trying to follow the book example for doing
>>>>>>> this.
>>>>>>>
>>>>>>> One source of difficulty is that I am trying to suppress the leaf data
>>>>>>> nodes and shift the text properties to their parents.
>>>>>>> The problem is that These nodes do not have corresponding model classes;
>>>>>>> they are handled with FeatureMaps.
>>>>>>> Suppressing them is easy enough,
>>>>>>> but I do not see how to get the property descriptors for them.
>>>>>>>
>>>>>>> thanks
>>>>>>> Daniel
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------ ------------
>>>>>>>
>>>>>>> ------------------------------------------------------------ ------------
>>>>>>>
>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>> <_1:grammar xmlns:_1="http://relaxng.org/ns/structure/1.0">
>>>>>>> <_1:start>
>>>>>>> <_1:value>some text</_1:value>
>>>>>>> </_1:start>
>>>>>>> </_1:grammar>
>>>>>>>
>>>>>>>
>>>>>>>
>>>
>
>
--------------000407020001010406070305
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Daniel,<br>
<br>
You don't want the normal behavior you get for an isMany feature so
you probably want to specialize the isMany method on your item property
descriptor to return false. You'll need to specialize the methods for
producing and accepting an editable value to produce and accept a
single string too.<br>
<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:dmahler@gmail.com">dmahler@gmail.com</a> wrote:
<blockquote cite="midedir5b$3s7$1@utils.eclipse.org" type="cite">
<pre wrap="">Ed,
I've tried this with partial success.
When I open the editor,
I can see the property and its current value.
I can bring up the multiline editor on the property,
and I see the value there too.
However I do not seem to be able to do any actual editing.
I can type into the lefthand field,
but clicking "add" does nothing.
Clicking "remove" does move the current value
from the right hand area to the left,
but the change does not get saved on exiting the editor.
Any idea what might be going on?
thanks
D
Ed Merks wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Daniel,
The alternative would be to make the mixed feature be a property (via
the GenFeature settings for it) and the specialize the property
descriptor to collect all the mixed text and probably use a multi-line
cell editor (again, another property on the GenFeature) to edit the text.
<a class="moz-txt-link-abbreviated" href="mailto:dmahler@gmail.com">dmahler@gmail.com</a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Ed,
I can, but it is not optimal.
I works with schemas that are developed and maintained in RelaxNG
and converted automatically to XSD
to get an authoring environment for instance documents in Eclipse.
I would prefer not to do eny editing on the xsd side.
I could write an xslt to clean up the generated XSDs,
but I would prefer to use the XSDs as given if possible.
I would also like to get a better understanding of EMF.
thanks
Daniel
Ed Merks wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Daniel,
You'd have a much nicer API if you used simpleContent that extends base
xsd:string.
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="name" type="xsd:string"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
Can you change the schema? (They accept the same XML syntax.)
<a class="moz-txt-link-abbreviated" href="mailto:dmahler@gmail.com">dmahler@gmail.com</a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Ed,
The issue occurs for pure text nodes with attributes,
specified in XSD by a construct like
<xs:element name="stuff">
<xs:complexType mixed="true">
<xs:attribute name="att1" type="xs:NCName"/>
<xs:attributeGroup ref="atts"/>
</xs:complexType>
</xs:element>
even though the content is not really mixed.
If there were no attributes and the schema read:
<xs:element name="stuff" type="string"/>
then the text body would be the Value property
of the <stuff> node in the model editor.
However, for the schema with attributes,
the model editor uses an extra text node below <stuff>
to hold the Value property
(presumably beacuse mixed imlies multiplicity,
even though ther is no multiplicity in this case)
I am attaching a schema and an instace which illustrate this.
thanks
Daniel
Ed Merks wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Daniel,
Maybe you could show your schema, or a simplified example schema, so I
can understand concretely the issue. It might just be a matter of
fiddling with the GenFeaure properties for the features in question to
indicate that there should be an editable property for them...
<a class="moz-txt-link-abbreviated" href="mailto:dmahler@gmail.com">dmahler@gmail.com</a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I am trying to suppress model elements in an XSD based model and I have
encountered some difficulties trying to follow the book example for doing
this.
One source of difficulty is that I am trying to suppress the leaf data
nodes and shift the text properties to their parents.
The problem is that These nodes do not have corresponding model classes;
they are handled with FeatureMaps.
Suppressing them is easy enough,
but I do not see how to get the property descriptors for them.
thanks
Daniel
------------------------------------------------------------ ------------
------------------------------------------------------------ ------------
<?xml version="1.0" encoding="UTF-8"?>
<_1:grammar xmlns:_1=<a class="moz-txt-link-rfc2396E" href="http://relaxng.org/ns/structure/1.0">"http://relaxng.org/ns/structure/1.0"</a>>
<_1:start>
<_1:value>some text</_1:value>
</_1:start>
</_1:grammar>
</pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>
--------------000407020001010406070305--
|
|
|
Goto Forum:
Current Time: Wed Nov 05 10:51:36 EST 2025
Powered by FUDForum. Page generated in 0.05841 seconds
|