How to split element def -> element + typeref + ComplexType?
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 17
- Joined: Wed May 21, 2008 9:13 pm
How to split element def -> element + typeref + ComplexType?
Assume I have a XSD with something like this inside:
<xsd:complexType name="foobar">
<xsd:sequence>
<xsd:element ... />
<xsd:element ... />
</xsd:sequence>
</xsd:complexType>
Now I want to split this type declaration and make two hierarchy levels out of it:
<xsd:complexType name="foobar" type="foobarType" />
<xsd:complexType name="foobarType">
<xsd:sequence>
<xsd:element ... />
<xsd:element ... />
</xsd:sequence>
</xsd:complexType>
How can I do this in Oxygen without editing the XSD schema file text manually in editor?
Is there e.g. a way to mark a certain <xsd:sequence>...</xsd:sequence> text and select a context menu entry similar to "extract to target XMLschema file...."
What about the other way: Merging an originally external, separate ComplexTypeby replacing an exiting type="foobarType" declaration by its target definition?
Peter
<xsd:complexType name="foobar">
<xsd:sequence>
<xsd:element ... />
<xsd:element ... />
</xsd:sequence>
</xsd:complexType>
Now I want to split this type declaration and make two hierarchy levels out of it:
<xsd:complexType name="foobar" type="foobarType" />
<xsd:complexType name="foobarType">
<xsd:sequence>
<xsd:element ... />
<xsd:element ... />
</xsd:sequence>
</xsd:complexType>
How can I do this in Oxygen without editing the XSD schema file text manually in editor?
Is there e.g. a way to mark a certain <xsd:sequence>...</xsd:sequence> text and select a context menu entry similar to "extract to target XMLschema file...."
What about the other way: Merging an originally external, separate ComplexTypeby replacing an exiting type="foobarType" declaration by its target definition?
Peter
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: How to split element def -> element + typeref + ComplexType?
Hi,
I am not sure what exactly you try to accomplish as your desired result
<xsd:complexType name="foobar" type="foobarType" />
is an invalid XML Schema fragment.
If you start with a schema like below
on the foobar element you can use the contextual action Extract global type to create a new type and set that to the foobar element automatically, resulting:
Then you can drag and drop foobar_type next to the y type to make y type derived from foobar_type, resulting:
Further you can drag and drop the y type next to x element to set x element type to y, resulting
Best Regards,
George
I am not sure what exactly you try to accomplish as your desired result
<xsd:complexType name="foobar" type="foobarType" />
is an invalid XML Schema fragment.
If you start with a schema like below
Code: Select all
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="foobar">
<xs:complexType>
<xs:sequence>
<xs:element name="a"/>
<xs:element name="b"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="x"/>
<xs:complexType name="y"/>
</xs:schema>
Code: Select all
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="foobar" type="foobar_type"> </xs:element>
<xs:element name="x"/>
<xs:complexType name="y"/>
<xs:complexType name="foobar_type">
<xs:sequence>
<xs:element name="a"/>
<xs:element name="b"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
Code: Select all
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="foobar" type="foobar_type"> </xs:element>
<xs:element name="x"/>
<xs:complexType name="y">
<xs:complexContent>
<xs:extension base="foobar_type"/>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="foobar_type">
<xs:sequence>
<xs:element name="a"/>
<xs:element name="b"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
Code: Select all
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="foobar" type="foobar_type"> </xs:element>
<xs:element name="x" type="y"/>
<xs:complexType name="y">
<xs:complexContent>
<xs:extension base="foobar_type"/>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="foobar_type">
<xs:sequence>
<xs:element name="a"/>
<xs:element name="b"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
George
George Cristian Bina
-
- Posts: 17
- Joined: Wed May 21, 2008 9:13 pm
Re: How to split element def -> element + typeref + ComplexType?
Hi George,george wrote: on the foobar element you can use the contextual action Extract global type to create a new type and set that to the foobar element automatically
I am not sure about what you are talking.
I did not found a "contextual action" (you mean context menu entry ???)
for the element. See the following snapshot.
http://img170.imageshack.us/img170/3715 ... 224300.png
Where exactly is this "contextual action"?
Thank you
Peter
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: How to split element def -> element + typeref + ComplexType?
Hi Peter,
It seems you are using an old version of oXygen - I was talking about version 10. That has a Schema tab on the schema editor where it shows a a schema diagram and those actions are available from the contextual menu (right click on Windows, CTRL+Click on Mac).
See also the following demo
http://www.oxygenxml.com/demo/XMLSchema ... iting.html
Best Regards,
George
It seems you are using an old version of oXygen - I was talking about version 10. That has a Schema tab on the schema editor where it shows a a schema diagram and those actions are available from the contextual menu (right click on Windows, CTRL+Click on Mac).
See also the following demo
http://www.oxygenxml.com/demo/XMLSchema ... iting.html
Best Regards,
George
George Cristian Bina
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service