Xml stylus studio

20
XML Schema and Stylus Studio

Transcript of Xml stylus studio

Page 1: Xml stylus studio

XML Schema and Stylus Studio

Page 2: Xml stylus studio

Introduction to XML Schema

XML Schema defines building blocks of a XML document

XML Schemas are alternative to DTD Why XML Schema?

– Supports data types– Written in XML– Supports namespaces– Extensible to future additions

Page 3: Xml stylus studio

XML Schema

Tables in XML schemas are represented by complex elements.

Columns are represented as sub elements of complex elements.

Unique keys are represented by xsd:unique Primary keys are represented by xsd:key Foreign keys are represented by xsd:keyref

Page 4: Xml stylus studio

Example

Page 5: Xml stylus studio

Stylus Studio – Getting Started

Page 6: Xml stylus studio

Stylus Studio

Page 7: Xml stylus studio

Stylus Studio

Click on this to create New Element Definition Click on this to create New

Complex Type Element

Page 8: Xml stylus studio

Stylus Studio – Creating Table Using Complex Type Element

Page 9: Xml stylus studio

Stylus Studio

Right Click on this to add sequence type to Complex Type Element

Page 10: Xml stylus studio

Stylus Studio – Adding sub-elements to Complex Type Element

Right Click on this to add Element Definition to Complex Type Element

Page 11: Xml stylus studio

Stylus Studio – Adding data type for Element Definition

Click on this to get drop down menu to select the data type.

Page 12: Xml stylus studio

Stylus Studio

Click here to get Tree View of the Schema.

Page 13: Xml stylus studio

Stylus Studio – Tree View of XML schema

Page 14: Xml stylus studio

Stylus Studio – Adding xsd:keys, xsd:keyref to Element Definition

Click on the ID button to add new Identity constraint

After adding an Identity constraint, You can select the constraint type like Unique, key or keyref from drop-down menu

Page 15: Xml stylus studio

Stylus Studio - Adding xsd:keys, xsd:keyref to Element Definition

Assign a name for the new key identity

Page 16: Xml stylus studio

Stylus Studio – Adding selector element

Click on the ID button to add new selector

After adding new selector, You can select the Selector/field from drop-down menu

Page 17: Xml stylus studio

Adding xsd:keys, xsd:keyref to Element Definition

Assign a name for the new keyref

Provide the name of primary key to which it refers

Page 18: Xml stylus studio

Stylus Studio – Adding XPath Expression

Adding Xpath expression in this place

Click on this to view actual code for XML Schema

Page 19: Xml stylus studio

Stylus Studio

Click on this to Indent XML tags

Click on this to validate the XML Schema

Page 20: Xml stylus studio

Thank You

Any Questions?