Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » XSD » Custom Attributes of ComplexType(How to get and set custom Attributes )
Custom Attributes of ComplexType [message #1793381] Tue, 07 August 2018 06:09
Harald  Lübeck is currently offline Harald LübeckFriend
Messages: 2
Registered: October 2012
Junior Member
Regard following XSD Schema:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified" targetNamespace="http://sample.com" xmlns="http://sample.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:isp="http://sample.com/attributes" xsi:schemaLocation="http://sample.com/attributes ./AttributeModel.xsd">

<xs:complexType name="type1" isp:tableName="type1" isp:tablePrefix="prefix">
<xs:sequence>
<xs:element name="fnt_id" isp:foreignKey="true" type="type2"/>
</xs:sequence>
<xs:attribute name="id" type="xs:int" use="required" isp:primaryKey="true" />
</xs:complexType>

<xs:complexType name="type2">
<xs:attribute name="id" type="xs:int" use="required" isp:primaryKey="true" />
</xs:complexType>

</xs:schema>

and AttributeModel.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://sample.com/attributes">
<xs:attribute name="primaryKey" type="xs:boolean" default="false"/>
<xs:attribute name="tableName" type="xs:string"/>
<xs:attribute name="tablePrefix" type="xs:string"/>
<xs:attribute name="columnName" type="xs:string"/>
<xs:attribute name="columnLength" type="xs:int"/>
<xs:attribute name="foreignKey" type="xs:string"/>
</xs:schema>


The Goal is to create and read this XSD Schema with MDT-XSD API.

(1) How can i set custom Attributes in this XSD in the Schema Element and in the ComplexType

(2) If i read this Schema with the MDT-XSD Api (XSDSchema) how can i access those custom Attributes ?

Thanks

[Updated on: Tue, 07 August 2018 07:59]

Report message to a moderator

Previous Topic:an exact schema for children of a sequence
Goto Forum:
  


Current Time: Mon Sep 24 12:26:17 GMT 2018

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

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

Back to the top