Home

View this document as PDF

image

Contents

1. 14 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams An XML diagram provides a graphical view of the elements that comprise an XML schema definition in a tree format Note To create an XML diagram in an existing XSM right click the model in the Browser and select New gt XML Model Diagram To create a new model select File gt New Model choose XML Model as the model type and XML Model Diagram as the first diagram and then click OK The following example shows the diagram of an XSM which models an XML schema for Resume documents Shee lddess issn lob Retrence isn Ejo Right click a symbol in an XML diagram and select one of these features e Expand to expand the first level of the hierarchy below the symbol e Expand All to expand the whole hierarchy below the symbol e Collapse to hide the hierarchy below the symbol e Arrange Symbols to reorganize the hierarchy below the symbol XML Modeling 15 CHAPTER 2 XML Diagrams Note The Symbol gt Group Symbols command only acts on free symbols in an XML diagram Ifan XML model is too large or too complex you can create several diagrams to have partial views of the model and focus on certain objects For example the original Resume diagram could be split into five diagrams corresponding to the five main objects of the model Main Contact Achievement Description and Address The following illustration shows the Achievement sub diagram Work
2. schemaLocation ORDER xsd gt lt xsischema gt Includes An include allows you to include a specified schema file in the target namespace of the current schema allowing you to use components from any schema with the same target namespace as the current schema or with no specified target namespace In a schema an include is declared with the lt include gt tag For example lt xml version 1 0 encoding UTF 8 gt lt xsischema xmins xs http www w3 org 2001 xMLSchema gt lt xsiinclude id INCL schemaLocation PROFORMA xsd gt lt xs ischema gt Redefines A redefine allows you to redefine simple and complex types groups and attribute groups from an external schema file in the current schema allowing you to use components from any schema with the same target namespace as the current schema or with no specified target namespace XML Modeling 61 CHAPTER 2 XML Diagrams In a schema a redefine is declared with the lt redefine gt tag For example lt xml version 1 0 encoding UTF 8 7 gt lt xsischema xmins xs http www w3 org 2001 xMLschema gt lt xsiredefine id REDEFL schemaLocation CUSTOMERS xsd gt lt xsigroup name PRIVILEGED_CUSTOMERS gt lt xstall gt lt xs element name CUSTOMER_1 gt lt xs element name CUSTOMER_2 gt lt xs element name CUSTOMER_3 gt lt xstall gt lt xs igroup gt lt xsicomplexType name PRIVILEGE gt lt xsicomplexType gt lt
3. xem for reuse with other models To access extension defined in a xem file simply attach the file to your model You can do this when creating a new model by clicking the Select Extensions button at the bottom of the New Model dialog or at any time by selecting Model gt Extensions to open the List of Extensions and clicking the Attach an Extension tool In each case you arrive at the Select Extensions dialog which lists the extensions available sorted on sub tabs appropriate to the type of model you are working with XML Modeling 13 CHAPTER 1 Getting Started with XML Modeling W Select Extensions xi yo te of C gt Excel Import To get started extending objects see Core Features Guide gt Modeling with PowerDesigner gt Objects gt Extending Objects For detailed information about working with extensions see Customizing and Extending PowerDesigner gt Extension Files Linking Objects with Traceability Links You can create traceability links to show any kind of relationship between two model objects including between objects in different models via the Traceability Links tab of the object s property sheet These links are used for documentation purposes only and are not interpreted or checked by PowerDesigner For more information about traceability links see Core Features Guide gt Linking and Synchronizing Models gt Getting Started with Linking and Syncing gt Creating Traceability Links
4. Ctrl Shift M 2 On the General tab select a radio button to generate a new or update an existing model and complete the appropriate options 3 optional Click the Detail tab and set any appropriate options We recommend that you select the Check model checkbox to check the model for errors and warnings before generation 4 optional Click the Target Models tab and specify the target models for any generated shortcuts 5 optional Click the Selection tab and select or deselect objects to generate 6 Click OK to begin generation Note For detailed information model generation see Core Features Guide gt Linking and Synchronizing Models gt Generating Models and Model Objects The following table details how XSM objects are generated to PDM objects XSM Elements Tables or columns Root elements are generated as tables Non root elements with complex types are generated as tables or col umns depending on the option chosen in the Persistent groupbox on the Detail tab of the element property sheet Non root elements with primitive or simple types are generated as table columns Note Root elements with a primitive or simple type are not generated except where they are referenced by other elements or complex types If you have a single root element and want to generate its immediate children as tables select the Skip single root element option on the PDM Generation Options window Detail tab XML Modelin
5. Checking an XSM Description and Correction Name Code uniqueness Undefined refer ence Existence of group particle Invalid cardinali ty Object names must be unique in the namespace e Manual correction Modify the duplicate name or code e Automatic correction Appends a number to the duplicate name or code A group without a name or a code must have a reference e Manual correction In the group property sheet define a reference with the Reference list or the Browse tool e Automatic correction None A group must contain elements groups group particles and or Any e Manual correction Add items to group or delete group e Automatic correction None only available for model targeted with XDR You should define a minimum 0 or 1 and a maximum cardinality 1 or unbounded for a group particle occurrence e Manual correction Double click the group particle symbol and type a value for Minimum 0 or 1 and Maximum 1 or unbounded properties e Automatic correction None Attribute Checks PowerDesigner provides default model checks to verify the validity of attributes Name Code con tains terms not in glossary Name Code con tains synonyms of glossary terms Name Code uniqueness Description and Correction if glossary enabled Names and codes must contain only approved terms drawn from the glossary e Manual correction Modify the name or code to contain only glossary terms e Automatic
6. e Automatic correction None An element without a reference a data type or a substitution group should have at least one attribute e Manual correction Define an attribute for the element e Automatic correction None An element with an embedded complex type must contain child elements groups group particles and or Any e Manual correction Add items to complex element or delete complex element e Automatic correction None only available for model targeted with XDR You should define a minimum 0 or 1 and a maximum cardinality 1 or unbounded for a group particle occurrence e Manual correction Double click the group particle symbol and type a value for Minimum 0 or 1 and Maximum 1 or unbounded properties e Automatic correction None PowerDesigner provides default model checks to verify the validity of groups Name Code con tains terms not in glossary Name Code con tains synonyms of glossary terms Description and Correction if glossary enabled Names and codes must contain only approved terms drawn from the glossary e Manual correction Modify the name or code to contain only glossary terms e Automatic correction None if glossary enabled Names and codes must not contain synonyms of glossary terms e Manual correction Modify the name or code to contain only glossary terms e Automatic correction Replaces synonyms with their associated glossary terms XML Modeling 77 CHAPTER 4
7. group in the current model from the list or use the Browse tool to select a group from any model opened in the workspace Disables the name and code properties Specifies the ID of the object which must be unique within the model 42 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Keywords Provide a way of loosely grouping objects through tagging To enter multiple key words separate them with commas Attributes Tab This tab lists the attributes and attribute groups associated with the attribute group For information about the tools available on this tab see Creating an Attribute on page 25 Any Elements XSM Any elements allow you to attach any type of object to a choice or a sequence group particle The following illustration shows an Any in a diagram Resources Resources e Inan XSD file Any is declared with the lt any gt tag lt xml version 1 0 encoding UTF 8 gt lt xs schema xmins xs http www w3 org 2001 xMLSchema gt lt xs element name RESOURCES gt lt xs complexType gt lt xs choice gt lt xs element name INTERNAL gt lt xsiany namespace local processContents Jax gt lt xs ichoice gt lt xsicomplexType gt lt xs element gt lt xsischema gt e InaDTD file Any is declared within an lt ELEMENTS gt tag with the keyword ANY lt xml version 1 0 encoding UTF 8 gt lt ELEMENT Resources ANY gt lt ELEMENT Internal EMPTY gt e In
8. property sheet and select a base type with the Base type list or the Browse tool e Automatic correction None Restriction Checks PowerDesigner provides default model checks to verify the validity of restrictions Check Description and Correction Undefined base type You must define a base type when you derive a simple or a complex type by restriction e Manual correction In the simple or complex type property sheet click the Properties tool beside the Derivation box to display the Extension property sheet and select a base type with the Base type list or the Browse tool Automatic correction None 84 SAP Sybase PowerDesigner CHAPTER 4 Checking an XSM Description and Correction Existence of facet A simple type restriction must have at least one facet defined Facets are defined in the Detail Enumerations and Patterns tabs of a simple type restriction property sheet e Manual correction Define one or more facets in the simple type restriction property sheet e Automatic correction None Simple Type List Checks PowerDesigner provides default model checks to verify the validity of simple types Description and Correction Undefined base type You must define a base type when you derive a simple type by list e Manual correction In the simple type property sheet click the Properties tool beside the Derivation box to display the simple type list property sheet and select a data type with the Type lis
9. unbounded binary data get mapped to BLOB by default If false unbounded strings are mapped to VAR CHAR2 4000 and unbounded binary components are mapped to RAW 2000 store Varray AsTable If true the VARRAY is stored as a table OCT If false the VARRAY is stored in a LOB 5 Select Language gt Generate schema File to open the Generation dialog box 6 Specify the directory in which to generate the file and select the XML in Database target on the Targets tab Generation ioj x Directory C TEMP MV Check model Targets vV XML in Database Oracle XML DB 9 2 annotated XSD Cancel Apply Help 7 Click OK to begin the generation The Result dialog box is displayed with the path of the annotated schema file selected 8 Click Edit to open the generated annotated schema in your associated editor 94 SAP Sybase PowerDesigner CHAPTER 5 Working with XML and Databases lt xml version 1 0 encoding UTF 8 gt lt xsischema xmins xs http www w3 org 200L xmMLschema xmins sql http xmins oracle com xdb gt lt xs element name Branch sq1 SQLName branch gt lt xs complexType gt lt xs sequence gt lt xs element name Department type DepType sq1 SQLName office gt lt xs i sequence gt lt xs complexType gt lt xsrelement gt lt xs complexType name DepType sq1 soLType officeType gt lt xsicomplexType gt lt xs ischema gt Note the Oracle namespace wit
10. All the schema space elements with this prefix in their start tag will be associated with the namespace For example http www mycompany com myproduct XMLmodel Language Specifies the language used in the model For example en en GB en US de fr ID Specifies the ID of the model Its value must be of type ID and unique within the file containing the model For example XMOD1 Specifies defaults for the Form and Block and Final model object properties e Items lists the model s global objects which have no parent symbol in the diagram and are directly linked to the lt schema gt tag The list reflects the order in which global objects are declared in the schema You can change the order of declaration by selecting an item in the list and using the arrowed buttons at the bottom left corner of the tab to move it in the list The following tools are available on this tab Tool Description a Add Element Add Group Add Attribute 6 SAP Sybase PowerDesigner CHAPTER 1 Getting Started with XML Modeling Tool Description Add Attribute Group Ea Add Simple Type XSD only Add Complex Type XSD only Ea Add Notation D Add Annotation XSD only External Schemas XSD only Allows you to link to and reuse in your model global objects from other schemas The following tools are available on this tab Tool Description Add Include Add Import Add Redefine Add Annotation e Namespaces XSD and XDR only List
11. Automatic correction None Existence of com A redefine must contain at least one of the following items simple type complex ponent type group or attribute group e Manual correction Add items to the redefine e Automatic correction None Key Checks PowerDesigner provides default model checks to verify the validity of keys Check Description and Correction Name Code con if glossary enabled Names and codes must contain only approved terms drawn tains terms not in from the glossary glossary i e Manual correction Modify the name or code to contain only glossary terms e Automatic correction None Name Code con if glossary enabled Names and codes must not contain synonyms of glossary tains synonyms of terms glossary terms e Manual correction Modify the name or code to contain only glossary terms e Automatic correction Replaces synonyms with their associated glossary terms Name Code Object names must be unique in the namespace uniqueness e Manual correction Modify the duplicate name or code e Automatic correction Appends a number to the duplicate name or code XML Modeling 81 CHAPTER 4 Checking an XSM Description and Correction Existence of A key must contain at least one field fields e Manual correction Add at least one field to the key or delete the key For example numEmployee e Automatic correction Deletes unassigned key For more informatio
12. Complex and the Content property to Simple or Complex in the case of an embedded complex type 50 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Deriving by Extension You can derive an element or complex type by extension to extend the values of its base type For example USaddress is a derivation by extension of the address complex type The generated schema is the following lt xml version 1 0 encoding UTF 8 gt lt xsischema xmins xs http www w3 org 2001 xMLSchema gt lt xs complexType name ADDRESS gt lt xs Sequence gt lt xs element name STREET type xs istring gt lt xs element name CITY type xs string gt lt xs element name COUNTRY type xs istring gt lt xs sequence s xs icomplexType gt lt xs comp lexType name USADDRESS gt lt xs complexcontent gt lt xsiextension base ADDRESS gt lt xs sequence gt lt xs element name STATE type xs token gt lt xs sequence gt lt xs rextension gt lt xs icomplexcontent gt lt xs complexType gt lt xsischema gt 1 Open the property sheet of an element or complex type and select Extension in the Derivation list The Content field and in the case of an element the Embedded type field is set to Complex 2 Click the Properties tool to the right of the Derivation box to open the property sheet of the extension and complete the following properties XML Modeling 51 CHAPTER 2 XML Diagrams
13. Creates symbols for the reversed objects in the diagram You can specify to bols expand all the nodes and to display elements groups and complex and simple types Convert Transforms global objects that are referenced only once in the model into child unique refer objects You can perform this conversion at any time by selecting Tools gt Con ences to ele vert Unique References in the XML model ments 3 XSD only Ifthe schema contains Import or Include elements the schema files referenced are listed in a tree format in the dialog Files not found display a red overlay For each file in the tree including those which are found you can click on it to e In the File or URL field change the value to an appropriate local path or valid URL path Inthe File or URL field browse to and select an XSM open in the workspace to stand in for the referenced file XML Modeling 67 CHAPTER 3 Generating and Reverse Engineering XML Schemas and Other Models Ee Sos Options File or URL http java sun com Aal ns j2ee web app_2_4xsd jal F Show symbols 7 Expand nodes Display filter 7 Show elements 7 Show complex types E Show groups E Show simple types E Convert unique references to elements Import Include files 389 http java sun com ml ns j2ee j2ee_1_4xsd ae ahttp www w3 org 2001 Ani xsd http www ibm com webservices xsd j2ee_web_services_client_1_1xsd El EJ http jav
14. STATUS type xs token gt lt xstattribute gt lt xsicomplexType gt lt xs element gt lt xSiattribute name NUMBER type xs positivelnteger gt lt xstattribute gt lt xs schema gt Creating an Attribute You can create attributes on the Attributes tab of an element complex type or attribute group property sheet The Attributes tab contains the following tools Tool Description Add Attribute Creates a local attribute Add Undefined Reference to Attribute Group Adds a reference to an attribute group defined in the current model Select a name from the Reference list or enter a name for a new attribute group to be defined later Add Reference to Attribute Adds references to global attributes defined in the current model that you choose from a Selection dialog Add Reference to Attribute Group Adds references to attribute groups defined in the current model that you choose from a Selection dialog XML Modeling 25 CHAPTER 2 XML Diagrams Any Attribute Adds any attribute of a specified namespace see Any Attributes on page 28 For general information about creating objects see Core Features Guide gt Modeling with PowerDesigner gt Objects Attribute Properties To view or edit an attribute s properties double click its diagram symbol or Browser or list entry The property sheet tabs and fields listed here are those available by default before any customization of the interfac
15. amp Code Complex Types B AddressType B sequence E City E Country E State E StreetAddress E ZipCode B Elements E E Resume ES sequence H E Contact H E Education H E Experience H E Interests H E Objective E jobReference Firs ikame testa ame tesna Personndares e ADDREESTYPE A PowerDesigner XSM allows you to generate and reverse engineer XSD DTD and XDR files and also generate an XML model from a Physical Data Model PDM Object Oriented Model OOM or another XSM XML Modeling CHAPTER 1 Getting Started with XML Modeling EI G XML Model XDR file R E Reverse Engineering GS Generation DTD XSD or XDR The structure of an XSM is described by a DTD an XSD or an XDR file A DTD file is a basic way to describe the structure of an XML document It is a raw list of all the legal elements making up an XML document An extract of a DTD file follows lt xml version 1 0 encoding UTF 8 gt lt Project Management gt lt ELEMENT Database DIVISION EMPLOYEE CUSTOMER PROJECT TEAM MATERIAL PARTICIPATE MEMBER USED COMPOSE gt lt ELEMENT DIVISION EMPTY gt lt ATTLIST DIVISION DIVNUM CDATA DIVNAME CDATA DIVADDR CDATA gt lt ELEMENT EMPLOYEE EMPTY gt lt ATTLIST EMPLOYEE EMPNUM CDATA EMP_EMPNUM CDATA DIVNUM CDATA EMPF NAM CDATA EMPLNAM CDATA EMPFUNC CDATA EMPSAL CDATA gt An XSD file or schema is an elaborate
16. an element are expanded in the diagram beneath their containing element In this example HighDefinition is a global complex type reused as data type for the deluxeTV element e Inthe model with target XSD e The model target is changed to DTD or XDR dolbyStereo deluxeTV deluxe TV fatSoreen Note You may be required to change the XML language if you open a model and the associated definition file is unavailable 1 Select Language gt Change Current Language 12 SAP Sybase PowerDesigner CHAPTER 1 Getting Started with XML Modeling x New XML language XML Schema Definition 1 0 z allal Current XML language XML Data Reduced 1 0 al Cancel Help 2 Select a XML language from the list By default PowerDesigner creates a link in the model to the specified file To copy the contents of the resource and save it in your model file click the Embed Resource in Model button to the right of this field Embedding a file in this way enables you to make changes specific to your model without affecting any other models that reference the shared resource 3 Click OK A message box opens to tell you that the XML language has been changed 4 Click OK to return to the model Extending your Modeling Environment You can customize and extend PowerDesigner metaclasses parameters and file generation with extensions which can be stored as part of your model or in separate extension files
17. and XDR files in Groups XSM on page 37 Creating a Group You can create a group from the Toolbox Browser or Model menu Groups are created at the model root to be referenced by other elements e Use the Group tool in the Toolbox e Select Model gt Groups to access the List of Groups and click the Add a Row tool e Right click the model or package in the Browser and select New gt Group For information about creating children under the group see Constructing Schemas inan XSL on page 17 For general information about creating objects see Core Features Guide gt Modeling with PowerDesigner gt Objects Creating a Reference to a Group A reference to a group is created as a child of an element group or complex type and makes the referenced group available to its parent You can create a referencing group in any of the following ways e Select the Group tool in the Toolbox and click on an element group or complex type symbol e On the Items tab of the property sheet of a group particle click the Add Reference to Group tool see Group Particle Properties on page 30 For general information about creating objects see Core Features Guide gt Modeling with PowerDesigner gt Objects XML Modeling 39 CHAPTER 2 XML Diagrams Group Properties To view or edit a group s properties double click its diagram symbol or Browser or list entry The property sheet tabs and fields listed here are those available by defau
18. embedded type 55 entity 59 check model 74 create 60 properties 60 extension 13 check 84 derivation 51 extension file 13 G generate DTD file from XML model 65 XDR file from XML model 65 XSD file from XML model 65 generate pdm 69 generate xsm 69 group 37 check model 77 create 39 properties 37 40 reference 37 stereotype 37 group particle All 29 check model 71 Choice 29 create 30 properties 30 Sequence 29 IBM DB2 95 identity constraint key 45 keyRef 45 unique 45 import 61 check model 80 create 62 properties 62 include 61 check model 74 create 62 properties 62 K key field 45 properties 45 selector 45 F key check model 81 keyRef 45 facet 52 check model 82 field 45 field 45 100 SAP Sybase PowerDesigner properties 45 selector 45 L link 17 child object to parent object 17 member types 56 model check model 72 copy XSM 4 create 4 model options 10 preview code 8 properties 5 share XSM 4 XML 1 XML language 4 model options 10 modeling environment customize 10 N namespace 28 43 notation 58 check model 79 create 58 properties 59 O Oracle 9i2 92 P parent element 29 preview code 8 process contents 28 43 R RDB 87 redefine 61 check model 81 Index create 62 properties 62 reference 37 41 45 restriction check model 84 detail properties 52 reverse engineering options 67 target models 67 XSD DTD or XDR file to existing XML model 67 XSD DTD or XDR file t
19. for the model spaces e Manual correction Type a URI and a prefix in the Namespaces tab of the model property sheet e Automatic correction Adds the target namespace URI and a prefix ns followed by a number e g ns1 72 SAP Sybase PowerDesigner CHAPTER 4 Checking an XSM Data Source Checks PowerDesigner provides default model checks to verify the validity of data sources Name Code con tains terms not in glossary Name Code con tains synonyms of glossary terms Name Code uniqueness Existence of mod el Data source con taining models with different Ob ject Language or DBMS types Description and Correction if glossary enabled Names and codes must contain only approved terms drawn from the glossary e Manual correction Modify the name or code to contain only glossary terms e Automatic correction None if glossary enabled Names and codes must not contain synonyms of glossary terms e Manual correction Modify the name or code to contain only glossary terms e Automatic correction Replaces synonyms with their associated glossary terms Object names must be unique in the namespace e Manual correction Modify the duplicate name or code e Automatic correction Appends a number to the duplicate name or code A data source must have at least one model in its definition e Manual correction Add a model from the Models tab of the data source property sheet e Automatic corre
20. gt DAD file defined with Xcolumn as StorageType lt xml version 1 0 gt lt DOCTYPE DAD SYSTEM E dad dtd gt lt DAD gt lt validation gt yves lt validation gt lt xcol umn gt lt table name DEPARTMENT key DEPNUM orderBy DEPNUM DEPNAME gt lt column name DEPNUM type INTEGER path DEPARTMENT DEPNUM multi_occurrence No gt lt column name DEPNAME type VARCHAR 254 path DEPARTMENT DEPNAME multi_occurrence No gt lt table gt lt table name EMPLOYEE key EMPID orderBy EMPID DEPNUM FIRSTNAME LASTNAME gt lt column name DEPNUM type INTEGER path DEPARTMENT EMPLOYEE DEPNUM multi_occurrence No gt lt column name EMPID type INTEGER path DEPARTMENT EMPLOYEE GEMPID multi_occurrence No gt lt column name FIRSTNAME type CHARCL path DEPARTMENT EMPLOYEE FIRSTNAME multi_occurrence No gt lt column name LASTNAME type CHARCL path DEPARTMENT EMPLOYEE LASTNAME multi_occurrence No gt lt table gt lt xcolumn gt lt DAD gt 98 SAP Sybase PowerDesigner Index A All group particle 29 annotated schema Microsoft SQL Server 2000 88 Oracle 912 92 annotation 56 application information 56 check model 86 documentation 56 global 56 local 56 properties 56 any 43 create 44 namespace 43 process contents 43 properties 44 any attribute 28 namespace 28 process contents 28 application information 56 attribute 24 ch
21. in the child element property sheet Available for Element use cdata Allows specifying CDATA sections to be used for certain elements in the XML document Available for Element Creates valid XML ID IDREF and IDREFS Prepends the values of ID IDREF and IDREFS with a string Available for Attribute 4 optional Click the Preview tab of the model property sheet to preview the annotated schema 5 Select Language gt Generate schemaFile to open the Generation dialog box 6 Specify the directory in which to generate the file and select the XML in Database target on the Targets tab 90 SAP Sybase PowerDesigner CHAPTER 5 Working with XML and Databases Generation Iof x Directory l V Check model Targets l XML in Database Microsoft SQL Server annotated XSD Cancel Apply Help 7 Click OK to begin the generation The Result dialog box is displayed with the path of the annotated schema file selected 8 Click Edit to open the generated annotated schema in your associated editor lt xml version 1 0 encoding UTF 8 gt lt xsischema xmlns xs http Awww w3 org 2001 xMLSchema xmIns sql urn schemas microsoft com mapping schema gt lt xsielement_name Root sql is constant L gt lt xs complexType gt lt xs Sequence gt lt xs element name DEPARTMENT sq relation DEPARTMENT gt lt xs complexType gt lt xs sequence gt lt xs element name EMPLOYEE sql relatio
22. is only available in a model targeted with DTD or XDR You can set a list of predefined values for an attribute Note In a model targeted with the XML Data Reduced language there is also a Values tab in the element property sheet XDR Attribute Properties In an XML Data Reduced language model attributes tags are defined as follows XDR Attribute Description Attribute Specifies the name of the attribute General tab Name default Specifies a default value for the attribute Detail tab Default dt type Specifies a type for the attribute General tab Type XML Modeling 27 CHAPTER 2 XML Diagrams XDR Attribute Description Aitribute dt values To specify a list of available values for a global attribute Values tab Specifies the name of a global attribute as a reference for a local attribute General tab Reference Any Attributes The Any Attribute check box in the bottom left corner of the Attributes tab allows you to specify that any attribute of the specified namespaces can be inserted into an element a complex type or an attribute group declaration It is only available in a model targeted with XSD For example lt xml version 1 0 encoding UTF 8 gt lt xsischema xmins xs http www w3 org 2001 xmMLSchema gt lt xs element name PRODUCT gt sxs comp lexType lt xSiattribute name EXPIRYDATE type xs date gt lt xstattribute gt sxs aig ee ee namespace local processcont
23. key words separate them with commas Constraints Keys Uniques and KeyRefs XSM Constraints indicate that element values must be unique within their specified scope In a schema a constraint is declared with the lt unique gt lt key gt or lt keyRe f gt tag Constraints are only available in a model targeted with XSD There are three kinds of identity constraints each with a selector and field e A Uniqueconstraint specifies that an element or an attribute value or set of values must be unique or null within a specified scope For example PROJECT Generated schema lt xml version 1 0 encoding UTF 8 gt lt xs schema xmins xs http www w3 org 2001 xMLSchema gt lt xs element name PROJECT gt lt xs complexType gt lt xs sequence lt xs element name EMPLOYEE gt lt xs rcomplexType gt lt xsiattribute name NUMEMPLOYEE type xs istring gt lt xstattribute gt lt xs complexType gt lt xsr element gt lt xs element name PRODUCT gt lt xs sequence lt xs complexType gt lt xsiunique name UNIQUENUM gt lt xsiselector xpath employee gt lt xs field xpath Gnumemployee gt lt xs tunique gt lt xsrelement gt lt xsischema gt The UNIQUENUM unique constraint defined on the project element specifies that the numEmployee attribute must be unique or null within the employee element e A Keyconstraint specifies that an element or an attr
24. map to any table The element is displayed in the query output Available for Element Allows specification of columns that uniquely identify the rows in a table Available for Element Allows limiting the values that are returned on the basis of a limiting value Available for Element Attribute Allows limiting the values that are returned on the basis of a limiting value Available for Element Attribute Allows schema items to be excluded from the result Available for Element Attribute Allows you to specify depth in recursive relationships that are specified in the schema Available for Element Identifies the database column that contains the overflow data Available for Element Maps an XML item to a database table Available for Element Specifies an element as the child table in a reference To define only in the child element property sheet Available for Element XML Modeling 89 CHAPTER 5 Working with XML and Databases Annota Description tion relationship Specifies an attribute as the foreign key of a child table in a reference To define child key only in the child element property sheet Available for Element relationship Specifies an element as the parent tablein a reference To define only in the child parent element property sheet Available for Element relationship Specifies an attribute as the primary key of a parent table in a reference To define parent key only
25. page 17 For general information about creating objects see Core Features Guide gt Modeling with PowerDesigner gt Objects Group Particle Properties To view or edit a group particle s properties double click its diagram symbol or Browser or list entry The property sheet tabs and fields listed here are those available by default before any customization of the interface by you or an administrator The General tab contains the following properties Property Type Minimum Maximum D Keywords Items Tab Specifies the type of the group particle Specifies the minimum number of times the object can occur Enter zero to specify that it is optional Specifies the maximum number of times the object can occur Select unbounded to specify unlimited instances Specifies the ID of the object which must be unique within the model Provide a way of loosely grouping objects through tagging To enter multiple key words separate them with commas This tab list the child objects associated with the group particle You can add additional children directly on this tab using the following tools 30 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Tool Description Ea Add Element Adds an element to the list Ea Add Any choice or sequence Adds an any element Add Group Particle Adds a group particle Add Reference to Element Adds a reference to a global element Add Reference to Group Adds a referen
26. which is used for generating code or scripts may be abbreviated and should not normally include spaces You can optionally add a comment to provide more detailed information about the model By default the code is auto generated from the name by applying the naming conventions specified in the model options To decouple name code synchronization click to release the button to the right of the Code field Filename Specifies the location of the model file This box is empty if the model has never been saved XML Modeling 5 CHAPTER 1 Getting Started with XML Modeling Author Specifies the author of the model If you enter nothing the Author field in diagram title boxes displays the user name from the model property sheet Version Info tab If you enter a space the Author field displays nothing Version Specifies the version of the model You can use this box to display the repository version or a user defined version of the model This parameter is defined in the display preferences of the Title node XML language Specifies the model target Default diagram Specifies the diagram displayed by default when you open the model Keywords Provide a way of loosely grouping objects through tagging To enter mul tiple keywords separate them with commas The following tabs are also available e Detail XSD only Contains the following properties Target Name Specifies a URI as the namespace for all the model objects
27. xsi simpleType gt 5 optional simple type restrictions only Click the Patterns tab and enter one or more sequences of acceptable values Select the F ixed check box to prevent the modification of a value 54 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams For example the zipCode simple type based on the xs string data type is restricted to the following pattern two uppercase letters from A to Z followed by a five digit number each digit ranging from 0 to 9 Restriction Properties olx Annotation Dependencies Version Info General Detail Enumerations Patterns gool hex AYI LF pal C Ci D pmj C mj C mji C mji C mji mi Generated schema lt xs simpleType name ZIPCODE F lt xsirestriction base xsist lt xsipattern value a z Ta 3 To 9 5 gt lt xstrestriction gt lt xsisimpleType gt 6 Click OK to close the restriction property sheet and return to the element simple type or complex type Deriving by List You can derive an element or simple type by list to define it as a list of values of a specified data type 1 Open the property sheet of an element or simple type and select List in the Derivation list For elements the Embedded type field is set to Simple 2 Click the Properties tool to the right of the Derivation box to open the list property sheet and complete the following properties XML Modeling 55 CHAPTER 2 XML Diagrams ID of the simple ty
28. 45 Creating a Constraint cccccceeeesesececeeeeeeeeeeeeeeneeees 47 Constraint Properties giclee te cree teed voce eased eccinde res ede 48 Derivations Extensions Restrictions Lists and Unions KSI E S E A E 50 Deriving by Extension ccceeeeeeeeeeeeceeeeeeeeeeeeeeeeees 51 Deriving by Restriction c cccceeeeeeeeeeeeeeeeeeeeeeeeeees 52 Deriving DY EIST te cents cates neire a 55 Deriving by Union Meamrenneene eee er tn reer teen nnn r et cert ry 56 Annotations XSM icici ss cecececcecbemceluecsaaienedbcetindendetedencs beckons 56 Notations XSM ccccccccccccceeceeeeeeeeeeeseeseeeeeeeseeeeeseneseesessesenes 58 Creating a Notation ce cce tye scagceteeenetereexiseu coeevatanesazceesote 58 Notation Properties 322 s 5 43 4 4 see a ies 59 E tities SIM ists scekcct ces Satta ciuecteiceed nadano ose adopsi eiiie d idiin 59 Creating an Entity xs suet pa tien Natteda i eine 60 Entity Propertie S na 60 Instructions Import Include and Redefine XSM 61 Creating an Import Include or Redefine Instruction 62 Import Include and Redefine Properties 62 Business Rules XSM cccccccccccccceeeeeeseeeeeseseeeeeeeeeeeeeeees 63 SAP Sybase PowerDesigner Contents CHAPTER 3 Generating and Reverse Engineering XML Schemas and Other Models 0 e 65 Generating XML Schema Files ccccsseeeeeeeeeeeeeeeeeneeeeeeees 65 Reverse Engineerin
29. Editors wo Save Ctrl S Saves the content of the field to the specified file Print Ctrl P Prints the content of the field ma Find Ctrl F Opens a dialog to search for text Cut Ctrl X Copy Ctrl C and Paste Ctrl V Perform the standard clipboard actions Undo Ctrl Z and Redo Ctrl Y Move backward or forward through edits Refresh F5 Refreshes the Preview tab You can debug the GTL templates that generate the code shown in the Preview tab To do so open the target or extension resource file select the Enable Trace Mode option and click OK to return to your model You may need to click the Refresh tool to display the templates XML Modeling 9 CHAPTER 1 Getting Started with XML Modeling Select Generation Targets Ctrl F6 Lets you select additional generation targets defined in extensions and adds a sub tab for each selected target For information about generation targets see Customizing and Extending PowerDesigner gt Extension Files gt Generated Files Profile gt Generating Your Files in a Standard or Extended Generation Customizing your Modeling Environment The PowerDesigner XML model provides various means for customizing and controlling your modeling environment Setting Model Options You can set XSM model options by selecting Tools gt Model Options or right clicking the diagram background and selecting Model Options You can set the following options on th
30. ID ID of the extension Its value must be of type ID and unique within the model containing the extension Base Type Data type on which the extension is based 3 Specify an ID select a base type and then click OK to return to the element or complex type Deriving by Restriction You can derive an element simple type or complex type by restriction to restrict the values of their base type 1 Open the property sheet of an element simple type or complex type and select Restriction in the Derivation list Simple Type Properties barCode BARCODE Iof x Extended Dependencies Version Info Preview General Annotation Notes Rules Dependencies Name barCode Code BARCODE E Comment Stereotype v Derivation Final For elements and complex types the Content field and in the case of an element the Embedded type field is set to Complex 2 Click the Properties tool to the right of the Derivation field to open the restriction property sheet and complete the following fields on the General tab 52 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Property Description ID of the simple type restriction Its value must be of type ID and unique within the model containing the simple type restriction Base type Data type on which the restriction is based Select a data type in the Base type list or with the Browse tool Embedded type If selected the base type disappears and a sim
31. L data to relational data An annotated schema is an XML file that allows you to store or retrieve data in an XML format from relational databases supporting XML An XML model allows you to generate an annotated schema XSD or XDR for SQL Server 2000 1 2 Map an XSM toa PDM You can do this manually or by generating an XSM from a PDM or a PDM from an XSM To enable the Microsoft SQL Server extensions in your model select Model gt Extensions click the Attach an Extension tool select the Microsoft SQL Server file on the XML in Database tab and click OK to attach it optional Reinforce the mappings of elements and attributes to tables and columns with extended attributes Note If the element and attribute names match the table and column names you do not need to define extended attributes for XML objects 88 SAP Sybase PowerDesigner limit field overflow field relationship child CHAPTER 5 Working with XML and Databases Annota Description tion encode key fields When an XML element or attribute is mapped to a SQL Server BLOB column allows requesting a reference URI to be returned and used later to return BLOB data Available for Element Attribute Maps an XML item to a database column Available for Element Attribute Hides the element or attribute specified in the schema in the resulting XML document Available for Element Attribute Creates an XML element that does not
32. M You can choose between e Generate table the element will be generated as a table with a reference to its parent if appropriate Migrate columns the attributes and child elements of the element will be migrated to its parent element Minimum Specifies the minimum number of times the object can occur Enter zero to specify that it is optional Maximum Specifies the maximum number of times the object can occur Select unbounded to specify unlimited instances Substitution Species a global element for which the current element can be substituted The group substitute must have the the same type or derived type Specifies a default value for the object Mutually exclusive with Fixed Specifies a fixed value for the object Mutually exclusive with Default Block Specifies that another object with the same type of derivation cannot be used in place of the current one global elements Prevents derivation of the object Form Specifies whether or not the object name must be qualified by the target name space of the schema Specifies the ID of the object which must be unique within the model Specifies that the object cannot be used in the instance document Nillable Specifies that the element may be null Note In the case of a model targeted with XDR the Detail tab is only available for local elements The following tabs are also available e Attributes lists the attributes and attribute groups associated with the eleme
33. ML Modeling 95 CHAPTER 5 Working with XML and Databases value The separator character is SideTableID Identifier of the side table optional SideTableName Name of the side table StorageName If StorageType is Xcolumn then it is the name of the sidetable column StorageType Type of storage Xcollection or Xcolumn 4 optional Click the Preview tab of the Root element property sheet and select the DB2XMLExtender DAD File tab to preview the DAD file If the DAD File tab is not available click the Select Generation Targets tool to select IBM DB2 DAD in the Targets list and click OK 5 Select Language gt Generate schemaFile to open the Generation dialog box 6 Specify the directory in which to generate the file and select the XML in Database target on the Targets tab 96 SAP Sybase PowerDesigner CHAPTER 5 Working with XML and Databases Generation Ioj x ol Directory IV Check model Targets Options v XML in Database IBM DB2 DAD Document Access Definition Cancel Apply Help 7 optional Click the Options tab and set any appropriate generation options Option Description S Character ending an in Character ending instructions in the SQL file for stored procedures struction Generates procedures de Generation of a SQL script for stored procedures enabling XML data ployment storage and facilitating XML data retrieval Path of DAD dtd Path of the DTD file installed
34. ML model targeted with XSD Creating an Annotation To create an annotation e On the schema element Open the Items or External Schemas tab in the property sheet of the model and click the Add Annotation tool or right click the model or package in the 56 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Browser and select New gt Annotation You can add documentation and application information as necessary on the Items tab e On any other object Open the Annotations tab and click one of the following tools P Add Documentation to contain an URI reference or any well formed XML con tent that gives extra information about XML objects or documents P Add Application Information to contain an URI reference or any well formed XML content that is used by applications for processing instructions Annotation Properties The General tab contains the following properties mD annotation annotation Specifies the ID of the object which must be unique within the model the ID annotation Specifies the ID of the object which must be unique within the model the object which must be unique within the model Source ee and application information Specifies the source of the content as a Language documentation Specifies the language used in the documentation For example en en GB en US de fr The Content tab allows you to enter any well formed XML content and the Preview tab of the annotation or parent o
35. R 2 XML Diagrams lt xml version 1 0 encoding UTF 8 7 gt lt xsischema xmins xs http www w3 oarg 2001 xMLSchema xmins k keyRef namespace gt lt xs element name PRODUCT gt lt xs complexType gt lt xs sequence gt lt xs element name COMPONENT_1 gt lt xs comp lexType lt xsiattribute name GOLD type xs boolean gt lt xs tattribute gt lt xsicomplexType gt lt xs element gt lt xs element name COMPONENT_2 gt lt xsrcomplexType gt lt xs 1sequence gt lt xs element name COMPONENT_3 gt lt xs element name COMPONENT_4 gt lt xs rsequence gt lt xsiattribute name GOLD type xs boolean gt lt xstattribute gt lt xsicomplexType gt lt xs element gt lt xs sequence lt xs i complexType gt lt xsi unique name UNIGOLD gt lt xsiselector xpath k COMPONENT_1 gt lt xs field xpath G GOLD gt lt xs tunique gt lt xsikeyref name KEYREF_UNIGOLD refer k UNIGOLD gt lt xsiselector xpath k COMPONENT_2 gt lt xsifield xpath GOLD gt lt xsikeyref gt lt xs element gt lt xsischema gt The KEYREF_UNIGOLD keyRef defined on the product element by reference to the UNIGOLD unique constraint specifies that the gold attribute must be unique or null within the component_ 2 element and unique or null within the component_1 element Creating a Constraint You create a constraint on the Constraints tab of an element property sheet The Cons
36. TI in the Value box or a URI in the Public or System boxes e Manual correction Type a value in the Value box or a URI in the Public or System boxes e Automatic correction None Include Checks PowerDesigner provides default model checks to verify the validity of includes Description and Correction Undefined sche You must define a schema location for an include ma location e Manual correction Define a URI or select a schema file for the schema location For example proforma xsd e Automatic correction None 74 SAP Sybase PowerDesigner CHAPTER 4 Checking an XSM Simple Type Checks PowerDesigner provides default model checks to verify the validity of simple types Check o Description and Correction Name Code contains terms if glossary enabled Names and codes must contain only approved not in glossary terms drawn from the glossary e Manual correction Modify the name or code to contain only glossary terms e Automatic correction None Name Code contains syno if glossary enabled Names and codes must not contain synonyms of nyms of glossary terms glossary terms e Manual correction Modify the name or code to contain only glossary terms Automatic correction Replaces synonyms with their associated glossary terms Name Code uniqueness Object names must be unique in the namespace e Manual correction Modify the duplicate name or code e Automatic correction Appends a number to
37. a sun com nl ns j2ee jsp_2_Oxsd 89 hitp java sun com ml ns j2ee 2ee_1_4xsd Namespace http www w3 org XML 1998 namespace File or URL http Awww w3 org 2001 Acnl xsd al Model v fey ok _ Cancel _ Hep 4 When you have resolved all references and are satisfied click OK to begin reverse engineering If you are reverse engineering to an existing XSM then the Merge Models dialog box opens to allow you to control the merging of the new objects into your XSM see Core Features Guide gt Modeling with PowerDesigner gt Comparing and Merging Models When the process is complete a confirmation message is given in the Output window The principal XML file is created and a separate XSM is created for each file that is included or imported Each import and include is created as an object in the appropriate model see Instructions Import Include and Redefine XSM on page 61 and shortcuts are created to reference the elements types or other objects defined in the imported or included schemas 68 SAP Sybase PowerDesigner CHAPTER 3 Generating and Reverse Engineering XML Schemas and Other Models Generating Other Models from an XSM You can generate physical data models PDMs and other XSMs from an XSM 1 Select Tools and then one of the following commands to open the appropriate Model Generation Options window e Generate Physical Data Model Ctrl Shift P e Generate XML Model
38. aints You can check the validity of your XSM at any time A valid XSM conforms to the following kinds of rules e Each complex type should have at least one attribute e Each group must contain elements groups group particles and or Any Note We recommend that you check your XML model before generating an XML document or another model from it If the check encounters errors generation will be stopped The Check model option is enabled by default in the Generation dialog box You can check your model in any of the following ways e Press F4 or e Select Tools gt Check Model or e Right click the diagram background and select Check Model from the contextual menu The Check Model Parameters dialog opens allowing you to specify the kinds of checks to perform and the objects to apply them to The following sections document the XSM specific checks available by default For information about checks made on generic objects available in all model types and for detailed information about using the Check Model Parameters dialog see Core Features Guide gt Modeling with PowerDesigner gt Objects gt Checking Models Group Particle Checks PowerDesigner provides default model checks to verify the validity of group articles Description and Correction Existence of par A group particle must contain elements groups group particles and or Any ticle e Manual correction Add items to the group particle or delete it e Automatic cor
39. an XDR file Any is declared through of an lt ElementType gt tag resources in the example with its mode attribute set to open Although it is displayed in a diagram Any is not considered as an object in an XDR file lt xml version 1 0 encoding UTF 8 gt lt Schema name XDR_Any xm ns urn schemas micrasoft com xm1 data xmlns dt urn schemas microsoft com datatypes gt lt ElementType name internal content empty gt lt ElementType name resources model open content eltonly order one gt lt element type internal gt lt f ElementType gt lt schema gt XML Modeling 43 CHAPTER 2 XML Diagrams Creating an Any Element You can create an Any element from the Toolbox or from a group particle property sheet e Use the Any tool in the Toolbox e Open the Items tab in the property sheet of a group particle and click the Add Any tool For general information about creating objects see Core Features Guide gt Modeling with PowerDesigner gt Objects Any Element Properties To view or edit an any element s properties double click its diagram symbol or Browser or list entry The property sheet tabs and fields listed here are those available by default before any customization of the interface by you or an administrator The General tab contains the following properties Property Description Stereotype Extends the semantics of the object You can enter a stereotype directly in this field or a
40. ay XML Modeling SAP Sybase PowerDesigner 16 5 SP03 Windows DOCUMENT ID DC20014 01 1653 01 LAST REVISED November 2013 Copyright 2013 by SAP AG or an SAP affiliate company All rights reserved No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG The information contained herein may be changed without prior notice Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors National product specifications may vary These materials are provided by SAP AG and its affiliated companies SAP Group for informational purposes only without representation or warranty of any kind and SAP Group shall not be liable for errors or omissions with respect to the materials The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services if any Nothing herein should be construed as constituting an additional warranty SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries Please see Attp www sap com corporate en legal copyrigh index epx trademark for additional trademark information and notices Contents CHAPTER 1 Getting Started with XML Modeling 1 Creating an XSM oi
41. bject allows you to review the content within the appropriate tags The following schema annotation contains a documentation element with well formed XML content an extract of a DTD file and an appinfo element with a source URI XML Modeling 57 CHAPTER 2 XML Diagrams lt xml version 1 0 encoding UTF 8 gt lt xsischema xmins xs http www w3 org 2001 xmMLSchema gt lt xsiannotation id ANNOTL gt lt xsidocumentation source attributes dtd xml ang en us gt lt xml version 1 0 encoding UTF 8 gt lt ELEMENT COMPANY CEMPLOYEES PRODUCTS CLIENTS gt lt gt lt ATTLIST COMPANY FOUNDATION CDATA STATUS CDATA gt lt ELEMENT EMPLOYEES EMPTY gt lt gt lt ATTLIST EMPLOYEES NUMBER CDATA gt lt ELEMENT PRODUCTS EMPTY gt lt gt lt ATTLIST PRODUCTS REFERENCES CDATA QUANTITIES CDATA gt lt ELEMENT CLIENTS EMPTY gt lt gt lt ATTLIST CLIENTS FIDELITY CDATA SOLVENCY CDATA gt lt xs documentation gt lt xsiappinfo source http www parsersandco com gt lt xs appinfo gt lt xs tannotation gt lt xs ischema gt Notations XSM Notations allow you to define and process non XML objects within an XML model The following example shows the generated schema for a notation lt xml version 1 0 encoding UTF 8 gt xs schema xml ns xs http iw w3 org 2001 xMLSchema gt el Integrating GIF files in your XML model gt xst
42. ble element or complex type e Attributes each column is generated as an attribute of its table element or complex type For information about controlling the naming conventions of your models see Core Features Guide gt Modeling with PowerDesigner gt Objects gt Naming Conventions Setting XSM Display Preferences PowerDesigner display preferences allow you to customize the format of object symbols and the information that is displayed on them To set XML model display preferences select Tools gt Display Preferences or right click the diagram background and select Display Preferences from the contextual menu For detailed information about customizing and controlling the attributes and collections displayed on object symbols see Core Features Guide gt Modeling with PowerDesigner gt Diagrams Matrices and Symbols gt Display Preferences Viewing and Editing the XML Language Definition File Each XSM is linked to a definition file that extends the standard PowerDesigner metamodel to provide objects properties data types and generation parameters and templates specific to the language being modeled Definition files and other resource files are XML files located in the Resource Files directory inside your installation directory and can be opened and edited in the PowerDesigner Resource Editor Warning The resource files provided with PowerDesigner inside the Program Files folder cannot be modified directly To create a co
43. ce to a group Simple Types XSM A simple type is a data type definition defined by derivation of an existing simple type built in data type or derived simple type It can be used by elements or attributes with text only content it cannot contain elements or attributes You can only create simple types in a model targeting XSD There are three kinds of derivation for a simple type e List contains a white space separated list of values of an inherited simple type see Deriving by List on page 55 e Restriction has a range of values restricted to a subset of those of an inherited simple type see Deriving by Restriction on page 52 e Union contains a union of values of two or more inherited simple types Deriving by Union on page 56 Once defined in a model a simple type can be reused in the definition of an attribute an element or a complex type Example of a simple type in a schema k xml version 1 0 encoding UTF 8 gt lt xsischema xmins xs http www w3 org 2001 xMLschema gt lt xsisimpleType name BARCODE gt lt xsirestriction base xs nonNegativelnteger id STRL gt lt xsi length value 13 gt lt xsirestriction gt lt f xsisimpletType gt lt xs element name PRODUCTA type BARCODE gt lt xs element name PRODUCTB type BARCODE gt lt xsischema gt XML Modeling 31 CHAPTER 2 XML Diagrams Creating a Simple Type You can create a simple type from the Browser or Model me
44. correction None if glossary enabled Names and codes must not contain synonyms of glossary terms e Manual correction Modify the name or code to contain only glossary terms e Automatic correction Replaces synonyms with their associated glossary terms Object names must be unique in the namespace e Manual correction Modify the duplicate name or code e Automatic correction Appends a number to the duplicate name or code 78 SAP Sybase PowerDesigner CHAPTER 4 Checking an XSM Description and Correction Undefined refer An attribute without a name or a code must have a reference ence e Manual correction In the attribute property sheet define a reference with the Reference list or the Browse tool e Automatic correction None Undefined type You must define a data type for an attribute e Manual correction In the attribute property sheet define a data type with the Type list or the Browse tool e Automatic correction None Notation Checks PowerDesigner provides default model checks to verify the validity of notations Description and Correction Name Code con if glossary enabled Names and codes must contain only approved terms drawn tains terms not in from the glossary glossary y e Manual correction Modify the name or code to contain only glossary terms e Automatic correction None Name Code con if glossary enabled Names and codes must not contain synonyms of g
45. created from annotated schemas XSDs Annotated schemas are XML coded files targeted with an XML language and tagged with specific DBMS annotations that allow you to store or retrieve data in an XML format from relational databases supporting XML An XML model allows you to generate an annotated schema XSD for Oracle 912 Oracle 9i2 uses by default the name of the XML elements present in the annotated schema to generate SQL objects You can override the creation of SQL objects by defining extended attributes for elements complex types and the XML model 1 To enable the Oracle extensions in your model select Model gt Extensions click the Attach an Extension tool select the Oracle XML DB onthe XML in Database tab and click OK to attach it 2 optional Specify the following properties on the Extended Attributes tab of the property sheets of elements Annotation beanClassname columnProps defaultTable javaClassname Can be used within element declarations If the element is based on a global complexType this name must be identical to the beanClassname value within the complexType declaration If a name is specified by the user the bean generation will generate a bean class with this name instead of generating a name from the element name Specifies the column storage clause that is inserted into the default CRE ATE TABLE statement It is useful mainly for elements that are mapped to tables namely top level element d
46. ction Deletes data source without a model The models in a data source represent a single set of information This is why the models in the data source should share the same DBMS or object language e Manual correction Delete models with different DBMS or object language or modify the DBMS or object language of models in the data source e Automatic correction None XML Modeling 73 CHAPTER 4 Checking an XSM Entity Checks PowerDesigner provides default model checks to verify the validity of entities Check Description and Correction Name Code con if glossary enabled Names and codes must contain only approved terms drawn tains terms not in from the glossary glossary e Manual correction Modify the name or code to contain only glossary terms e Automatic correction None Name Code con if glossary enabled Names and codes must not contain synonyms of glossary tains synonyms of terms glossary terms e Manual correction Modify the name or code to contain only glossary terms e Automatic correction Replaces synonyms with their associated glossary terms Name Code Object names must be unique in the namespace uniqueness e Manual correction Modify the duplicate name or code e Automatic correction Appends a number to the duplicate name or code Undefined entity You must define an entity In the entity property sheet you must either type a value string of characters or UR
47. d information about the object By default the code is generated from the name by applying the naming conventions specified in the model options To decouple name code synchronization click to release the button to the right of the Code field Stereotype Extends the semantics of the object You can enter a stereotype directly in this field or add stereotypes to the list by specifying them in an extension file 20 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Reference Specifies a global element to reuse Select an element in the current model from the list or click the Browse tool to select an element from any model open in the workspace Disables all other properties To locate the referenced element in the diagram right click the referencing element and select Find Referenced Element Group type Specifies that the object has child elements and how they are used see Group Particles XSM on page 29 You can choose between all Each child element can occur 0 or 1 times choice Only one child must be present group Reference to a predefined group see Groups XSM on page 37 sequence All children must be present in order Type IDREF Specifies the data type Select a built in data type from the list or click the Browse tool to select a simple type defined in any model open in the workspace If you select IDREF or IDREFS the IDREF type property is displayed allowing you to select the element to refer
48. d This attribute will be forced to false in certain situations like cyclic references where SQL will not support inlining SQLName Specifies the name of the attribute within the SQL object that maps to this XML element SQLSchema Name of the database user owning the type specified by SQLType SQLType Specifies the name of the SQL type corresponding to this XML element declaration tableProps Specifies the TABLE storage clause that is appended to the default CRE ATE TABLE statement This is meaningful mainly for global and out of line elements 3 optional Specify the following properties on the Extended Attributes tab of the property sheets of complex types beanClassname Can be used within element declarations If the element is based on a global complexType this name must be identical to the beanClassname value within the complexType declaration If a name is specified by the user the bean generation will generate a bean class with this name instead of generating a name from the element name SQLSchema Name of the database user owning the type specified by SQLType SQLType Specifies the name of the SQL type corresponding to this XML element declaration 4 optional Specify the following properties on the Extended Attributes tab of the property sheets of the model XML Modeling 93 CHAPTER 5 Working with XML and Databases mapUnboundedStringToLob If true unbounded strings are mapped to CLOB by default Similarly
49. d nodes of the text context node Field and Selector Properties The General tab of a selector or field property sheet contains the following properties For a selector An XPath expression relative to the parent element being declared It identifies the child elements to which the identity applies For a field An XPath expression relative to each element selected by the selector of the constraint It identifies a single element with a simple type whose content or value is used for the constraint Stereotype Extends the semantics of the object You can enter a stereotype directly in this field or add stereotypes to the list by specifying them in an extension file ID Specifies the ID of the object which must be unique within the model Specifies the ID of the object which must be unique within the model ID of the object which must be unique within the model Derivations Extensions Restrictions Lists and Unions XSM You can use derivations to extend or restrict the values of elements and of simple and complex types An XML model allows you to derive e Elements by extension restriction list or union e Simple types by restriction list or union e Complex types by extension or restriction Note When you define a derivation in an element property sheet a simple or a complex type is automatically created within the element declaration See Preview tab The Embedded type property is automatically set to Simple or
50. d way to describe the structure of an XML document It can support namespaces derivations keys simple and complex user defined data types and a robust collection of predefined data types An extract of an XSD file follows SAP Sybase PowerDesigner CHAPTER 1 Getting Started with XML Modeling lt xml version 1 0 encoding UTF 8 gt lt Project Management gt lt xsischema xmIns xs http www w3 org 2001 xMLSchema gt lt xs element name Database gt lt xs rcomplexType gt lt xs 1Sequence gt lt xs element name DIVISION gt lt xs i complexType gt lt xstattribute name DIVNUM gt lt xsisimpleType gt lt xsirestriction base ID gt lt xsiminiInclusive value L gt lt xsipattern value 00000 gt lt xstrestriction gt lt xsisimpleType gt lt xstattribute gt lt xSiattribute name DIVNAME type NAME gt lt xstattribute gt lt xSiattribute name DIVADDR type SHORT_TEXT gt lt xstattribute gt lt xs complexType gt lt xsrelement gt An XSD file always starts with the lt schema gt tag root element All objects created in the model will appear in the XSD file between the schema start tag and end tag e An XDR file is a simplified XSD file or schema It does not support simple and complex user defined data types An extract of an XDR file follows lt xml version 1 0 encoding UTF 8 gt lt Schema name PROJECT xmIns urn schemas microsoft com xm l data xmins
51. dd stereotypes to the list by specifying them in an extension file Minimum Specifies the minimum number of times the object can occur Enter zero to specify that it is optional Maximum Specifies the maximum number of times the object can occur Select unbounded to specify unlimited instances Specifies the ID of the object which must be unique within the model Namespace Specifies the namespaces containing the elements that can be used You can enter a white space delimited list with URI references or choose from any elements from any namespace can be used other elements from any namespace other than the target namespace of the schema can be used local elements that are not qualified with a namespace can be used targetNamespace elements from the target namespace of the sche ma can be used Process con Specifies how an XML processor should handle validation of XML documents tents containing the elements specified by the Any element You can choose from Lax the processor will try to obtain the schema and validate any element of the specified namespaces If the schema cannot be found no error will occur Skip the processor will not try to validate the elements Strict the processor must obtain the schema and validate any element of the specified namespaces 44 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Keywords Provide a way of loosely grouping objects through tagging To enter multiple
52. dt urn schemas microsoft com datatypes gt lt description gt Project Management lt description gt lt ElementType name DIVISION content empty gt lt attributeType name DIVNUM gt lt attribute type DIVNUM gt lt AttributeType name DIVNAME dt type string gt lt attribute type DIVNAME gt lt AttributeType name DIVADDR dt type string gt lt attribute type DIVADDR gt lt fElementType gt An XDR file always starts with the lt schema gt tag root element All objects created in the model will appear in the XDR file between the schema start tag and end tag Suggested Bibliography e W3C XML Recommendation http www w3 org TR REC xml e W3C DTD Recommendation http www w3 org TR REC xml dt doctype e W3C XML Schema Recommendation Attp www w3 org XML Schema dev e W3C XML Data Note Attp www w3 org TR 1998 NOTE X ML data 0105 XML Modeling 3 CHAPTER 1 Getting Started with XML Modeling Creating an XSM You create anew XML model by selecting File gt New Model Note In addition to creating an XSM from scratch with the following procedure you can also reverse engineer a model from an existing XSD a DTD or an XDR file see Reverse Engineering an XML Schema into an XSM on page 67 The New Model dialog is highly configurable and your administrator may hide options that are not relevant for your work or provide templates or predefined models to guide you through model creat
53. e fined once and reused through references See Groups XSM on page 37 Attribute N A N A A group of attributes defined once and reused in the Group model through references See Attribute Groups XSM on page 41 Any E Any type of object Can only be attached to a sequence or a choice group particle See Any Elements XSM on page 43 Constraint N A N A XSD only Specifies uniqueness of element values See Constraints Keys Uniques and KeyRets XSM on page 45 Derivation N A N A Extends or restricts the values of elements and simple and complex types See Derivations Extensions Re strictions Lists and Unions XSM on page 50 Instruction N A N A An import include or redefine instruction See Jnstruc tions Import Include and Redefine XSM on page 61 Annotation N A N A Provides documentation or application information See Annotations XSM on page 56 Entity N A N A DTD only Specifies a predefined value or external XML or non XML file See Entities XSM on page 59 Notation N A N A Defines and processes non XML objects within an XML model See Notations XSM on page 58 Constructing Schemas in an XSL You construct a schema in an XSL by building a tree structure of elements and group particles To link a child object to a parent object click the child object tool in the Toolbox and then click the symbol of the parent object in the diagram You can reuse structures of elements in your schema by creating a gr
54. e Model Settings page Option Description S Name Code case Specifies that the names and codes for all objects are case sensitive allowing you sensitive to have two objects with identical names or codes but different cases in the same model If you change case sensitivity during the design process we recommend that you check your model to verify that your model does not contain any duplicate objects Enable links to Displays a Requirements tab in the property sheet of every object in the model requirements which allows you to attach requirements to objects see Requirements Model ing Generate tables Specifies how PDM tables are generated to the XSM during model to model as generation or when creating objects through drag and drop in the Mapping Editor You can choose between e Elements default each table is generated as an untyped element directly linked to its columns generated as attributes or sub elements Elements with complex types each table is generated as an element typed by a complex type generated in parallel to contain the columns 10 SAP Sybase PowerDesigner CHAPTER 1 Getting Started with XML Modeling Option Description S Generate col Specifies how PDM columns are generated to the XSM during model to model umns as generation or when creating objects through drag and drop in the Mapping Editor You can choose between e Elements default each column is generated as an sub element of its ta
55. e by you or an administrator The General tab contains the following properties Name Code Identify the object The name should clearly convey the object s purpose to non Comment technical users while the code which is used for generating code or scripts may be abbreviated and should not normally include spaces Neither the name nor code should contain colons You can optionally add a comment to provide more detailed information about the object By default the code is generated from the name by applying the naming conventions specified in the model options To decouple name code synchronization click to release the button to the right of the Code field Stereotype Extends the semantics of the object You can enter a stereotype directly in this field or add stereotypes to the list by specifying them in an extension file Reference Specifies a global attribute to reuse Select a global attribute in the current model from the list or click the Browse tool to select an attribute from any model open in the workspace Disables the Name Code Type Default and Fixed properties Type IDREF Specifies the data type Select a built in data type from the list or click the Browse tool to select a simple type defined in any model open in the workspace If you select IDREF or IDREFS the IDREF type property is displayed allowing you to select the element to reference for documentation purposes Embedded XSD only Createsa lt simple type gt
56. e ccccicssssccecttcencceniersanaavanctansuncsveniennanawascnwas 4 ASM Properties seononeooeeeneneeeneneeeerrrreeerreerrrrnnnrnnnrreeent 5 Previewing XML Code ccccccceeeeeeseeeeseeeeeeeeeeeeeeeeeeeeeeees 8 Customizing your Modeling Environment 0000 10 Setting Model Options caries cocce nevesensewetei ceacuededecdelptevetes 10 Setting XSM Display Preferences ceeeeeeeeees 11 Viewing and Editing the XML Language Definition File T opn E a E a ama 11 Changing the XML Language ccccceeeeeeeeeees 12 Extending your Modeling Environment 00 13 Linking Objects with Traceability Links 0 14 CHAPTER 2 XML Diagrams cceeeeeeeeeeeee eee 15 XML Diagram Objects wveieccciiccnctcnccwseiastracesarceiaedevecedcanecces 16 Constructing Schemas in an XSL eceeeeeeeeeeeeeeees 17 Elements XSM sissesscavcivsssescstecedetecetesies tevennstnivinsspesietosaicins 19 Creating an Element ss eve eset ul ais A eee ahevei es Seales ce 19 Element Properties ccceeeeeeeeeseeeeeeeeeeeeeeeeeeeeeees 20 Attributes XSM ccciceieccce seca icccdcccdicccnstavenensnsdbaeetcsesdertagsausnsas 24 Creating an Attribute eee eeeeeeeeseceeeeeeeeeeeeeeeeeeees 25 Attribute Properties esaccc ccc osus55ceectarevsticssceesdeasemeeaepeocn 26 Any AUIDUCS otic carts eres esat EEE E EERE 28 Group Particles XSM sssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
57. e in the namespace uniqueness y e Manual correction Modify the duplicate name or code e Automatic correction Appends a number to the duplicate name or code Undefined refer An attribute group without a name or a code must have a reference ence e Manual correction In the attribute group property sheet define a reference with the Reference list or the Browse tool e Automatic correction None Existence of at An attribute group must contain at least one attribute tributes e Manual correction Add attributes to attribute group or delete attribute group e Automatic correction Deletes unassigned attribute group Import Checks PowerDesigner provides default model checks to verify the validity of imports Description and Correction Undefined sche An import must have at least a schema location or a namespace defined ma location and namespace e Manual correction In the import property sheet define a URI for the schema location and or the namespace e Automatic correction None 80 SAP Sybase PowerDesigner CHAPTER 4 Checking an XSM Redefine Checks PowerDesigner provides default model checks to verify the validity of redefines Check Description and Correction Undefined sche You must define a schema location for a redefine ma location e Manual correction In the redefine property sheet define a URI or select a schema file for the schema location For example customers xsd e
58. eck model 78 create 25 properties 26 attribute group check model 80 create 42 properties 41 42 reference 41 stereotype 41 AttributeType XDR 26 base type 51 business rule XSM define 63 C check model 71 annotation 86 attribute 78 Index attribute group 80 complex type 75 data source 73 element 76 entity 74 extension 84 group 77 group particle 71 import 80 include 74 key 81 keyRef 82 model 72 namespaces 72 notation 79 redefine 81 restriction 84 shortcut 72 simple type 75 simple type list 85 simple type union 85 target namespace 72 unique 83 child element 29 Choice group particle 29 code preview 8 complex type applying to element 36 check model 75 create 34 global 33 local 33 mappings 36 properties 34 symbol 36 constraint 45 create 47 properties 48 D DAD file 95 data source 73 data type attribute check 78 XML Modeling 99 Index complex type 33 element check 76 extension 51 simple type 31 simple type list 55 simple type list check 85 simple type union 56 simple type union check 85 database DAD file 95 IBM DB2 95 Microsoft SQL Server 2000 88 Oracle 912 92 SQL XML queries 87 XML in database 87 derivation 50 extension 51 simple type list 55 simple type union 56 diagram 15 display preferences 11 documentation annotation 56 DTD 1 E element 19 applying complex type 36 check model 76 child element 29 create 19 general properties 20 group 37 parent element 29
59. ecks to verify the validity of elements Check Description and Correction Name Code con if glossary enabled Names and codes must contain only approved terms drawn tains terms not in from the glossary glossary i e Manual correction Modify the name or code to contain only glossary terms e Automatic correction None Name Code con if glossary enabled Names and codes must not contain synonyms of glossary tains synonyms of terms glossary terms i e Manual correction Modify the name or code to contain only glossary terms e Automatic correction Replaces synonyms with their associated glossary terms Name Code Object names must be unique in the namespace uniqueness e Manual correction Modify the duplicate name or code e Automatic correction Appends a number to the duplicate name or code Undefined type An element without a reference should have a defined data type e Manual correction In the element property sheet define a data type with the Type list or the Browse tool e Automatic correction None 76 SAP Sybase PowerDesigner CHAPTER 4 Checking an XSM Description and Correction Undefined refer ence Existence of at tribute Existence of par ticle Invalid cardinali ty Group Checks An element without a defined data type must have a reference e Manual correction In the element property sheet define a reference with the Reference list or the Browse tool
60. eclarations and out of line element declarations Specifies the name of the table into which XML instances of this schema should be stored This is most useful in cases when the XML is being inserted from APIs where table name is not specified for example FTP and HTTP Used to specify the name of a Java class that is derived from the corre sponding bean class to ensure that an object of this class is instantiated during bean access If a JavaClassname is not specified Oracle XML DB will instantiate an object of the bean class directly 92 SAP Sybase PowerDesigner CHAPTER 5 Working with XML and Databases maintainDOM If true instances of this element are stored so that they retain DOM fidelity on output This implies that all comments processing instruc tions namespace declarations and so on are retained in addition to the ordering of elements If false the output need not be guaranteed to have the same DOM behavior as the input maintainOrder If true the collection is mapped to a VARRAY If false the collection is mapped to a NESTED TABLE SQLCollSchema Name of the database user owning the type specified by SQLCollType SQLCollType Specifies the name of the SQL collection type corresponding to this XML element that has maxOccurs gt 1 SQLInline If true this element is stored inline as an embedded attribute or a collec tion if maxOccurs gt 1 If false a REF or collection of REFs if maxOc curs gt 1 is store
61. eir parent element through a group particle Child_element_1 Parent_element PARENT_ELEMENT Child_element_2 Child_element_3 There are three kinds of group particles s Sequence Child elements must appear at least once in the order of their declaration Choice Only one child element can be linked to the parent element All Child elements can appear in any order and each of them once or not at These particles translate to the following tags in each of the supported languages XDR order attribute DTD separator ticle XML Modeling 29 CHAPTER 2 XML Diagrams Creating a Group Particle You can create a group particle from the Toolbox or from the property sheet of an element group or complex type e Select the Sequence Choice or All tool in the Toolbox and click an element complex type group or group particle Note A sequence particle is automatically created if you click on an element symbol with the Element or Any tool see Creating an Element on page 19 e Open the property sheet of an element group or complex type select a Group type on the General tab and click OK The element symbol displays a plus sign on its right side that you can click to reveal the group particle e Open the property sheet of a group particle click the Items tab and use the Add Group Particle tool For information about creating children under the group particle see Constructing Schemas in an XSL on
62. ement General tab Reference local elements only To specify the minimum number of occurrences for a local element Usually set to Oor Detail tab Minimum XML Modeling 23 CHAPTER 2 XML Diagrams XDR Element Description Attribute maxOccurs local elements only To specify the maximum number of occurrences for a local element Usually set to or unbounded Detail tab Maximum Attributes XSM Attributes can be created under elements or complex types or directly at the root or in an attribute group for reuse There are global and local attributes e Global attributes are defined with the Model menu In a schema they are directly linked to the lt schema gt tag root element They can be reused for any element in the model through references See NUMBER attribute in the generated schema e Local attributes only apply to the elements in which they are created They can be defined by reference to a global attribute See Reference property Note In a model targeted with the XML Data Reduced language local attributes are first declared separately like global attributes with the lt AttributeType gt tag and a name attribute then within their parent element with the lt attribute gt tag and a type attribute Extract of an XDR file lt AttributeType name globalAttribute gt lt ElementType name parentElement content empty gt lt AttributeType name lJocalattribute default 0 lt a
63. ence for documentation purposes For an XSD element selecting a data type will delete any group particle or attribute previously defined Do not select a data type if you want to define attributes or child elements within the current element Embedded XSD only Specifies a locally defined data type which applies to the current type element only Automatically set to Complex if you define a derivation for the ele ment data type Content XSD only Specifies the type of content of the object You can select e Complex elements or elements and character data Click the Properties tool to specify an ID unique within the model for the complex content and select the Mixed check box if character data can appear between child elements Simple character data or a simple type but no elements Click the Properties tool to specify an ID for the simple content Derivation XSD only Specifies a derivation method for the data type to extend or restrict its values Resets the Type property to lt None gt Click the Properties tool to further define the derivation see Derivations Extensions Restrictions Lists and Unions XSM on page 50 Keywords Provide a way of loosely grouping objects through tagging To enter multiple key words separate them with commas XML Modeling 21 CHAPTER 2 XML Diagrams Detail Tab The Detail tab contains the following properties Persistent Specifies how the element will be generated to a PD
64. ence to a key or a unique constraint with the Reference list e Automatic correction None 82 SAP Sybase PowerDesigner CHAPTER 4 Checking an XSM Description and Correction Existence of A keyRef must contain at least one field fields e Manual correction Add at least one field to the keyRef or delete the keyRef For example numEmployee e Automatic correction Deletes unassigned keyRef For more information on fields see Constraint Properties on page 48 Undefined selec You must define an XPath expression for a keyRef selector attribute tor e Manual correction In the keyRef property sheet define an XPath expression for the selector attribute For example s company s employee e Automatic correction None For more information on XPath expressions see Constraint Properties on page 48 Unique Checks PowerDesigner provides default model checks to verify the validity of uniques Check Description and Correction Name Code con if glossary enabled Names and codes must contain only approved terms drawn tains terms not in from the glossary glossary f e Manual correction Modify the name or code to contain only glossary terms e Automatic correction None Name Code con if glossary enabled Names and codes must not contain synonyms of glossary tains synonyms of terms glossary terms r i l e Manual correction Modify the name or code to contain only glossary terms e Auto
65. ents skip gt lt xsicomplexType gt lt xsrelement gt lt xsischema gt Click the Properties tool to display the Any Attribute property sheet The General tab contains the following properties Property Description Specifies the ID of the object which must be unique within the model Namespace Specifies the namespaces containing the attributes that can be used You can enter a white space delimited list with URI references or choose from any attributes from any namespace can be used other attributes from any namespace other than the target namespace of the schema can be used local attributes that are not qualified with a namespace can be used targetNamespace attributes from the target namespace of the sche ma can be used 28 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Process con Specifies how an XML processor should handle validation of XML documents tents containing the attributes specified by the Any Attribute You can choose from Lax the processor will try to obtain the schema and validate any attribute of the specified namespaces If the schema cannot be found no error will occur Skip the processor will not try to validate the attributes Strict the processor must obtain the schema and validate any attribute of the specified namespaces Group Particles XSM An element composed of other elements is a parent element with child elements Child elements are linked to th
66. everal columns The name and value of a column become the name and value of an element Warning The following procedure assumes you have an XML model open in the workspace and mapped to a PDM Generated SQL XML queries cannot be parameterized 1 To enable the SQL XML extensions in your model select Model gt Extensions click the Attach an Extension tool select the SQL XML file on the General Purpose tab and click OK to attach it 2 Select Tools gt Generate SQL XML Queries to open the Generation dialog box Specify the directory in which to generate the file Click the Selection tab and specify which of the global elements you want to generate queries from A separate file will be generated for each global element selected Click OK to begin the generation The Result dialog box is displayed with the path of the query file selected Click Edit to open the generated query file in your associated editor select lt xml version 1 0 encoding UTF 8 gt XMLELEMENTC NAME Root select XMLAGG C XMLELEMENTC NAME DEPARTMENT XMLATTRIBUTES CDEPARTMENT DEPNUM select XMLAGG C XMLELEMENTC NAME EMPLOYEE XMLATTRIBUTES CEMPLOYEE DEPNUM AS from EMPLOYEE where DEPARTMENT DEPNUM EMPLOYEE DEPNUM J from DEPARTMENT Generating an Annotated Schema for Microsoft SQL Server Microsoft SQL Server is an XML enabled database server which supports annotations that can be used on XSD or XDR files to map XM
67. g 69 CHAPTER 3 Generating and Reverse Engineering XML Schemas and Other Models sw o pw SOS Simple types Complex types Attributes Domains The datatype of the domain depends on the derivation of the simple type e simple types with a list derivation varchar e simple types with a restriction derivation the datatype of the base type e simple types with a union derivation the most permissive of the unioned types Merged with their parent element If the complex type is the restriction or extension of a simple type it will be generated as a column called Va 1 ue linked to the domain generated from the simple type Columns with datatypes determined by resolving any derivation Attributes and attribute groups defined at the model level are not generated except where they are referenced Note References substitutions imports and includes are always resolved and attributes and attribute groups defined at the model level are generated only where they are used Notations redefines anys and for DTDs entities are not generated to PDMs To view the mappings between your XML objects and the objects generated from them open the Mapping Editor from the generated model see Core Features Guide gt Linking and Synchronizing Models gt Object Mappings 70 SAP Sybase PowerDesigner CHAPTER 4 Checking an XSM The XML model is a very flexible tool which allows you quickly to develop your model without constr
68. g an XML Schema into an XSM 67 Generating Other Models from an XSM cccccceeeeeeeeeeeeees 69 CHAPTER 4 Checking an XSM cseeeeeeeeeeeeeeeeeeees 71 Group Particle Checks visissec cies ase seuetitnnd caine nenniteseetiienenewends 71 Model Checks scciciccicniscneastcctcccsisetesscaedeaniensiteniwereseidaedeardensdce 72 Data Source CHECKS ssssnnnnnnennennnnnnnnnnnnnnnnnnnnnnnnnnnnn nnne n nna 73 Entity CHECKS 6 csdsiuicccis canisentecucudsdcancedscuandedssuasadectsanat saddnesias 74 Include CHECKS iscceicesictiiecvsnAasscdennhe eetiedisbicce tiaavannaniewes 74 Simple Type CHECKS eis sicrsases cn stewed ennderilenedsnedeucdanetatninastanabse 75 Complex Type Checks ccccccccssssseeeeeeeeeeseeeseeeeeeeeeeseeeeseneees 75 Element CHECKS ssvsssiccicassscsntasasccitevversterrsersteusveunseerienrseereenss 76 Group CHECKS sities inssenssrcepicutadantinentnansantcwaudesundaaventcoutesta tents 77 Attrib te Checks scccscccs cise cicccaenceiica seein dacwueisdacwcenseewiencssscbeaas 78 Notation Checks sssciciciscisicsasescteccienctecsssssnssssaseedessteenssaniiesstec 79 Attribute Group Checks 2 eeceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeees 80 IMPOPT CHECKS si seusiicdstiiesdeceesendaviensddacdatsacnvaetedediiveciieemanccesed 80 Redefine Checks cccccccccccccccccccceeeeeeeeeeeeesesseeeeeeeeeeeeeeeeees 81 KY CHECKS T 81 KeyRef Checks siciiiccissssssccecsescsseseseccnwedscisnnseeawennvsiniannccedensene 82 Unique C
69. h the sql prefix and annotations for tables sql SQLName and ADTs sql SQLType Generating a DAD File for IBM DB2 IBM DB2 v8 1 or higher is a database server with an add in for XML storage and retrieval called IBM DB2 Extender XML data elements attributes are mapped to relational data tables columns through Document Access Definition files DAD There are three types of DAD files Xcolumn Column mapping the Root element is mapped to a table and its attributes or child elements are mapped to columns identified by an XPath Xcollection SQL mapping the DAD file starts with a SQL statement for the table mapped to the Root element and each child element or attribute is mapped to a column or a table name Xcollection RDB mapping a Relational Database node with a table and a column name is associated with each attribute or child element of the Root element An XML model targeted with DTD allows you to generate DAD files for IBM DB2 1 Map an XSM toa PDM You can do this manually or by generating an XSM from a PDM or a PDM from an XSM 2 To enable the IBM DB2 DAD extensions in your model select Model gt Extensions click the Attach an Extension tool select the IBM DB2 DAD file on the XML in Database tab and click OK to attach it 3 optional Set extended attributes on global elements to reinforce their mapping to tables and columns The following properties are listed on the Extended Attributes tab X
70. hecks inca sttepetwnticstestiewaecaiinatentonedecunctibvadtusebeateaind 83 Extension Checks wsscvsccccasisicticacscetencenietiscesiecsianetieniaastaeniannes 84 Restriction CHECKS iisi eitinn srainrao nasain aaens ananena 84 Simple Type List Checks eeeeeeeeeeeeseeeeeeeeeeeeeeeeeeees 85 Simple Type Union Checks cccccccesseeseeeeeeeeeeeeeeeeesseneees 85 Annotation Checks cccssssssssesssessssssssesesesesseeseeeeeeeees 86 CHAPTER 5 Working with XML and Databases 87 Generating an SQL XML Query File seccssssseeenenes 87 XML Modeling v Contents Generating an Annotated Schema for Microsoft SQL OPV GM E E E E A 88 Generating an Annotated Schema for Oracle 00 92 Generating a DAD File for IBM DB2 c ccecseeeeeeeeeeeeeees 95 Mde a a E e a a aaae ae aeae PER 99 vi SAP Sybase PowerDesigner CHAPTER 1 Getting Started with XML Modeling An XML model XSM helps you analyze an XML Schema Definition XSD Document Type Definition DTD or XML Data Reduced XDR file You can model reverse engineer and generate each of these file formats Since XML structures can be very complex it can be easier to visualize them through diagrams With its Browser tree view and diagram an SAP Sybase PowerDesigner XSM gives you a global and schematic view of all the elements composing your XSD DTD or XDR Workspace B Resume E Diagram_1 Simple Types
71. heir parent scope They reference and thus be defined by a global element by selecting the global element in the Reference property on the General tab of their property sheet Note In a model targeted with the XML Data Reduced language local elements are first declared separately like global elements with the lt ElementType gt tag and a name attribute then within their parent element with the lt element gt tag and a type attribute For example lt ElementType name JTocalelement lt ElementType name globalelement lt element type Jocalelement gt lt fElementType gt Parent elements are linked to their child elements through group particles sequence choice or all which contain a group of child elements see the Group type property in Element Properties on page 20 You can derive an XSD element data type to extend or restrict its values see the Derivation property in Element Properties on page 20 Creating an Element You can create an element from the Toolbox Browser or Model menu Elements can be created as root elements anywhere in the diagram and via group particles as children of elements complex types and groups e Use the Element tool in the Toolbox Click any part of a top level element symbol to create a sequence group particle see Group Particles XSM on page 29 and a child element XML Modeling 19 CHAPTER 2 XML Diagrams Click the lower part of a child element symbo
72. hema gt 66 SAP Sybase PowerDesigner CHAPTER 3 Generating and Reverse Engineering XML Schemas and Other Models Reverse Engineering an XML Schema into an XSM Reverse engineering is the process of extracting an XML structure from an XML schema file into an XSM You can reverse engineer XML schema files to create a new XSM or to add objects to an existing XSM Note PowerDesigner uses parser software developed by the Apache Software Foundation Attp www apache org for XML reverse engineering 1 To reverse engineer a schema and create a new XSM select File gt Reverse Engineer gt XML Definition to open the New XML Model dialog box Specify a model name choose an XML language from the list and then click OK Note If your reverse engineering will create multiple connected XSM models due to import and include statements you may first want to create an empty project File gt New Project and reverse engineer your files into the project which will act as a container for the files and allow you to check them into and out of the repository as a single unit or To reverse engineer a schema into an existing XSM open the model and select Language gt Reverse Engineer schema File 2 When the Reverse Engineering dialog opens select the file or enter the URL you want to reverse engineer which can be of any type accessible via a browser except for ftp and select any appropriate options Option Description S Show sym
73. ibute value or set of values must be a key within a specified scope the data must be unique not null and always present within a specified scope For example project PROJECT code xs positivelnteger XML Modeling 45 CHAPTER 2 XML Diagrams Generated schema lt xml version 1 0 encoding UTF 8 gt lt xs schema xmins xs http www w3 org 2001 xMLSchema gt lt xs element name PROJECT gt lt xs complexType gt lt xs 1sequence gt lt xs element name EMPLOYEE gt lt xs element name PRODUCT gt lt xs i complexType gt lt xsiattribute name CODE type xs positivelnteger gt lt xstattribute gt lt xsi complexType gt lt xs element gt lt xs 1sequence gt lt xs complexType gt lt xsikey name KEYCODE gt lt xsiselector xpath product gt lt xsifield xpath G code gt lt xsikey gt lt xs element gt lt xsischema gt The KEYCODE key constraint defined on the project element specifies that the code attribute must be unique not null and always present within the product element e A KeyRefconstraint specifies that an element or attribute value or set of values corresponds to the value of a specified key or unique constraint A keyRef is a reference to a key or a unique constraint For example product PRODUCT gold xs boolean amp gold xs boolean Generated schema 46 SAP Sybase PowerDesigner CHAPTE
74. ile lt xml version 1 0 encoding UTF 8 7 gt lt xsischema xmins xs http www w3 org 2001 xmMLSchema gt lt xsiattributeGroup name quality gt lt xstattribute name guarantee gt lt xstattribute gt lt xstattribute name qualitystandards gt lt xstattribute gt lt xs rattributecroup gt lt xs element name producta gt sxs s eomp lata BA sai lt xstattributecroup ref quality gt lt xstattributecroup gt lt xs icomplexType gt lt xs element gt lt xsischema gt In a schema a group of attributes is declared with the lt at tributeGroup gt tag and can contain the lt attribute gt lt attributeGroup gt and lt anyAttribute gt tags e Generated DTD file lt xml version 1 0 encoding UTF 8 7 gt lt ELEMENT producta EMPTY gt lt ATTLIST producta guarantee CDATA qualitystandards CDATA gt XML Modeling 41 CHAPTER 2 XML Diagrams Creating an Attribute Group You can create an attribute group from the Browser or Model menu Attribute groups are created at the model root to be referenced by other elements You can create an attribute group in any of the following ways e Select Model gt Attribute Groups to access the List of Attribute Groups and click the Add a Row tool e Right click the model or package in the Browser and select New gt Attribute Group To reference an attribute group open the property sheet of an element complex type or attribute group click the At
75. ing XML Schemas and Other Models Directory C TEMPXSD_files IV Check model Cancel Apply Help 2 Enter a directory in which to generate the files and specify whether you want to perform a model check For more information about checking your model see Chapter 4 Checking an XSM on page 71 Note When generating an XDR file the Generation dialog contains an Options tab where you can specify whether or not to generate comments within a lt description gt tag This option is enabled by default 3 Click OK to begin generation A Progress box is displayed The Result list displays the files that you can edit The resultis also displayed in the Generation tab of the Output window located in the bottom part of the main window 4 Click Edit to edit the XSD DTD or XDR file in your associated editor i XMLMODEL_2 xsd Notepad OF x File Edit Format Help lt xml version 1 0 encoding UTF 8 gt lt xsischema xmins xs http www w3 arg 2001 xmMLSchema gt lt xSigroup name DESCRIPTIONLINES gt lt xsiall gt lt xs element name LINEL gt lt xs element name LINE2 gt lt xs element name LINE3 gt lt xstall gt lt xs igroup gt lt xs element name PRODUCT gt lt xs i complexType gt lt xs 1sequence gt lt xs element name NAME gt lt xsigroup ref DESCRIPTIONLINES gt lt xs igroup gt lt xs tsequence gt lt xs comp lexType gt lt xs relement gt lt xs sc
76. ion When you open the dialog one or more of the following buttons will be available on the left hand side e Categories which provides a set of predefined models and diagrams sorted in a configurable category structure e Model types which provides the classic list of PowerDesigner model types and diagrams Template files which provides a set of model templates sorted by model type TE New Model E x Category Category items X B Business m Information 5 Categories Application Conceptual Data Data Flow Diagram Data Movement Logical Data 2 Technology Model Ga B Requirements and Planning o Ll Model types p Physical Data UML Class Diagram XML MultiDimensional Data Templates physical data model PDM helps you to analyze the tables views and other objects in a database including multidimensional objects necessary for data warehousing 4 PDM is more concrete than a conceptual CDM or logical LOM data model You can model reverse engineer and generate for all the most popular DBMS s zi Model name Development PDM DBMS Sybase AS Enterprise 15 5 7 al Extensions m Cancel Help 4 SAP Sybase PowerDesigner CHAPTER 1 Getting Started with XML Modeling 1 Select File gt New Model to open the New Model dialog 2 Click a button and then select a category or model type XML Model in the left hand pane 3 Select an ite
77. ities and click the Add a Row tool e Right click the model or package in the Browser and select New gt Entity For general information about creating objects see Core Features Guide gt Modeling with PowerDesigner gt Objects Entity Properties To view or edit an entity s properties double click its diagram symbol or Browser or list entry The property sheet tabs and fields listed here are those available by default before any customization of the interface by you or an administrator The General tab contains the following properties Name Code Identify the object The name should clearly convey the object s purpose to non Comment technical users while the code which is used for generating code or scripts may be abbreviated and should not normally include spaces Neither the name nor code should contain colons You can optionally add a comment to provide more detailed information about the object By default the code is generated from the name by applying the naming conventions specified in the model options To decouple name code synchronization click to release the button to the right of the Code field Stereotype Extends the semantics of the object You can enter a stereotype directly in this field or add stereotypes to the list by specifying them in an extension file logo gif URI reference identifying the non XML object For example pictures gif System URI reference identifying the application that will proce
78. k to release the button to the right of the Code field Stereotype Extends the semantics of the object You can enter a stereotype directly in this field or add stereotypes to the list by specifying them in an extension file Specifies the ID of the object which must be unique within the model Specifies the ID of the object which must be unique within the model ID of the object which must be unique within the model Reference pe __ se Specifies the key or unique constraint being referenced Select a constraint defined in the current model or another model with a specified namespace Selector Enter an XPath expression that selects a set of elements across which the values XPath specified in the Fields tab must be unique There can only be one selector Keywords Provide a way of loosely grouping objects through tagging To enter multiple key words separate them with commas Fields Tab The Fields tab lists XPath expressions used to define the constraint If more than one field is listed the combination of fields must be unique The XPath expressions permitted to define constraint selectors and fields are limited to a of the full XPath language defined in the W3C Recommendation XML Path Language Root node of the XML document It is the root element with its ramifications 48 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams eo Selects the context node It is the current element on which an identity con
79. l digits Exact number of decimal digits allowed It must be greater than zero _ decimal digits allowed It must be greater than zero Fraction digits Maximum number of decimal digits in the fractional part You can optionally click the Properties tool to the right of each field to open the property sheet of the facet and enter the following properties XML Modeling 53 CHAPTER 2 XML Diagrams ID ID of the facet Its value must be of type ID and unique within the model con taining the facet Value s of the facet To prevent a modification of the facet value s select the Fixed property 4 optional simple type restrictions only Click the Enumerations tab and enter a set of acceptable values Select the F ixed check box to prevent the modification of a value For example the meetings simple type based on the xs gMonthDay data type is restricted to the following dates 01 20 03 20 05 20 and 07 20 Restriction Properties Df x Annotation Dependencies Version Info General Detail Enumerations Patterns S onol Sex A X WF lt lt Less z Cancel Apply Help Generated schema lt xsisimpleType name MEETINGS gt lt xsirestriction base xs gMonthDay gt lt xsrenumeration value 01 20 gt lt xsrenumeration value 03 20 gt lt xs enumeration value 05 20 gt lt xs enumeration value 07 20 gt lt xs enumeration gt lt xstrestriction gt lt
80. l to create a sibling element below it bo Click the middle part of a child element symbol to create a sequence group particle and child element to the child element e Select Model gt Elements to access the List of Elements and click the Add a Row tool e Right click the model or package in the Browser and select New gt Element e Open the property sheet of a group particle see Group Particles XSM on page 29 click the Items tab and use the Add Element tool For information about creating children under the element see Constructing Schemas in an XSL on page 17 For general information about creating objects see Core Features Guide gt Modeling with PowerDesigner gt Objects Element Properties To view or edit an element s properties double click its diagram symbol or Browser or list entry The property sheet tabs and fields listed here are those available by default before any customization of the interface by you or an administrator The General tab of an XSD or DTD element property sheet displays the following properties for XDR element properties see the subsequent table Name Code Identify the object The name should clearly convey the object s purpose to non Comment technical users while the code which is used for generating code or scripts may be abbreviated and should not normally include spaces Neither the name nor code should contain colons You can optionally add a comment to provide more detaile
81. lement can occur 0 or 1 times e choice Only one child must be present e sequence All children must be present in order Minimum Specifies the minimum number of times the object can occur Enter zero to specify that it is optional Maximum Specifies the maximum number of times the object can occur Select unbounded to specify unlimited instances Specifies the ID of the object which must be unique within the model Keywords i Provide a way of loosely grouping objects through tagging To enter multiple key words separate them with commas 40 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Attribute Groups XSM An attribute group is a set of attributes which is referenced in the model by various elements It is created independently without a parent element and can be reused multiple times by elements complex types or other global attribute groups through references In a schema it is directly linked to the lt schema gt tag root element Attribute groups are not supported by XDR For example E xSD_attributeGroup Ea Diagram_1 gj Attribute Groups 3 A Attributes guarantee qualityStandards gj Elements E E product Attributes quality The quality attribute group is composed of the guarantee and qualityStandards attributes The productA element reuses the quality attribute group via the Attributes tab of its property sheet e Generated XSD f
82. lossary tains synonyms of terms glossary terms r e Manual correction Modify the name or code to contain only glossary terms e Automatic correction Replaces synonyms with their associated glossary terms Name Code Object names must be unique in the namespace uniqueness 7 i e Manual correction Modify the duplicate name or code e Automatic correction Appends a number to the duplicate name or code Undefined nota A notation must have at least one URI defined for Public or System properties tion e Manual correction In the notation property sheet define a URI in the Public or System boxes e Automatic correction None XML Modeling 79 CHAPTER 4 Checking an XSM Attribute Group Checks PowerDesigner provides default model checks to verify the validity of attribute groups Check Description and Correction Name Code con if glossary enabled Names and codes must contain only approved terms drawn tains terms not in from the glossary glossary f e Manual correction Modify the name or code to contain only glossary terms e Automatic correction None Name Code con if glossary enabled Names and codes must not contain synonyms of glossary tains synonyms of terms glossary terms e Manual correction Modify the name or code to contain only glossary terms e Automatic correction Replaces synonyms with their associated glossary terms Name Code Object names must be uniqu
83. lt before any customization of the interface by you or an administrator The General tab contains the following properties Name Code Identify the object The name should clearly convey the object s purpose to non Comment technical users while the code which is used for generating code or scripts may be abbreviated and should not normally include spaces Neither the name nor code should contain colons You can optionally add a comment to provide more detailed information about the object By default the code is generated from the name by applying the naming conventions specified in the model options To decouple name code synchronization click to release the button to the right of the Code field Name and Code are read only for references to groups Stereotype Extends the semantics of the object You can enter a stereotype directly in this field or add stereotypes to the list by specifying them in an extension file Reference for references to groups Specifies the group being referenced Select a group in the current model from the list or use the Browse tool to select a group from any model opened in the workspace Disables all other properties To locate the referenced group in the diagram right click the referencing element and select Find Referenced Group Group type Specifies that the object has child elements and how they are used see Group Particles XSM on page 29 You can choose between e all Each child e
84. m in the right hand pane Depending on how your New Model dialog is configured these items may be first diagrams or templates on which to base the creation of your model Use the Views tool on the upper right hand side of the dialog to control the display of the items 4 Enter a model name The code of the model which is used for script or code generation is derived from this name using the model naming conventions 5 Select a target XML language which customizes PowerDesigner s default modifying environment with target specific properties objects and generation templates By default PowerDesigner creates a link in the model to the specified file To copy the contents of the resource and save it in your model file click the Embed Resource in Model button to the right of this field Embedding a file in this way enables you to make changes specific to your model without affecting any other models that reference the shared resource 6 optional Click the Select Extensions button and attach one or more extensions to your model 7 Click OK to create and open the XML model Note Sample XSMs are available in the Example Directory XSM Properties You open the model property sheet by right clicking the model in the Browser and selecting Properties Each XML model has the following model properties Name Code Comment Identify the model The name should clearly convey the model s purpose to non technical users while the code
85. matic correction Replaces synonyms with their associated glossary terms Name Code Object names must be unique in the namespace uniqueness e Manual correction Modify the duplicate name or code e Automatic correction Appends a number to the duplicate name or code Existence of A unique constraint must contain at least one field fields e Manual correction Add at least one field to the unique constraint or delete the unique constraint For example numEmployee e Automatic correction Deletes unassigned unique constraint For more information on fields see Constraint Properties on page 48 XML Modeling 83 CHAPTER 4 Checking an XSM Description and Correction Undefined Selec You must define an XPath expression for a unique constraint selector attribute tor e Manual correction In the unique constraint property sheet define an XPath expression for the unique constraint selector attribute For example s com pany s employee e Automatic correction None For more information on XPath expressions see Constraint Properties on page 48 Extension Checks PowerDesigner provides default model checks to verify the validity of extensions Check o Description and Correction Undefined base type You must define a base type when you derive a complex type by ex tension e Manual correction In the complex type property sheet click the Properties tool beside the Derivation box to display the Extension
86. mation about creating children under the complex type see Constructing Schemas in an XSL on page 17 For general information about creating objects see Core Features Guide gt Modeling with PowerDesigner gt Objects Complex Type Properties To view or edit a complex type s properties double click its diagram symbol or Browser or list entry The property sheet tabs and fields listed here are those available by default before any customization of the interface by you or an administrator The General tab contains the following properties Name Code Identify the object The name should clearly convey the object s purpose to non Comment technical users while the code which is used for generating code or scripts may be abbreviated and should not normally include spaces Neither the name nor code should contain colons You can optionally add a comment to provide more detailed information about the object By default the code is generated from the name by applying the naming conventions specified in the model options To decouple name code synchronization click to release the button to the right of the Code field Names and codes must be unique among all simple and complex types Stereotype Extends the semantics of the object You can enter a stereotype directly in this field or add stereotypes to the list by specifying them in an extension file 34 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Group type Specifie
87. ment gt lt fxsischema gt e Inthe generated DTD file the group is expanded directly within its parent element lt xml version 1 0 encoding UTF 8 gt lt ELEMENT linel EMPTY gt lt ELEMENT line EMPTY gt lt ELEMENT 1ine3 EMPTY gt lt ELEMENT product Cname linel line2 1ine3 gt lt ELEMENT name EMPTY gt e Inthe generated XDR file the group is declared through a lt group gt tag within an lt ElementType gt tag with its order attribute set to seq 38 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams lt xml version 1 0 encoding UTF 8 gt lt Schema name xDR_qroup xml ns urn schemas microsoft com xml data xmIns dt urn schemas micrasoft com datatypes gt lt ElementType name Jinel content empty gt lt ElementType name Jine2 content empty gt lt ElementType name Jine3 content empty gt lt ElementType name name content empty gt lt ElementType name product model closed content eltonly order seq gt lt element type name gt lt group gt lt element type Tinel gt lt element type line2 gt lt element type Tine3 gt lt group gt lt fElementType gt lt schema gt Note In a model targeted with DTD or XDR language there are no global or referencing groups although they appear on the diagram Groups are expanded within their parent element and their child elements are declared individually as global elements See generated DTD
88. n EMPLOYEE gt lt xs annotation gt lt xs appinfo gt lt sql relationship parent DEPARTMENT parent key DEPNUM child key DEPNUM child EMPLOYEE gt lt xs appinfo gt lt xs annotation gt lt xs complexType gt lt xs attribute name DEPNUM type xs int sql field DEPNUM gt lt xs attribute gt lt xs attribute name EMPID type xs int sql field EMPID gt lt xs attribute gt lt xs attribute name FIRSTNAME type xs string sql field FIRSTNAME gt lt xs attribute gt lt xs attribute name LASTNAME type xs string sql field LASTNAME gt lt xs attribute gt lt xs complexType gt lt xs element gt lt xs sequence gt lt xsiattribute name DEPNUM type xs int sql field DEPNUM gt lt xstattribute gt lt xsiattribute name DEPNAME type xs string sql field DEPNAME gt lt xsrattribute gt lt xs complexType gt lt xsrelement gt lt xs sequence gt lt xs complexType gt lt xsrelement gt lt xsischema gt Note the SQL namespace with the sql prefix and the SQL annotations for tables sql relation columns sql field and reference sql relationship XML Modeling 91 CHAPTER 5 Working with XML and Databases Generating an Annotated Schema for Oracle Oracle 9i2 is a database server with a native XML storage and retrieval technology called Oracle XML DB There is no mapping between XML data and relational data Tables columns and abstract data types ADT are
89. n on fields see Constraint Properties on page 48 Undefined selec You must define an XPath expression for a key selector attribute tor e Manual correction In the key property sheet define an XPath expression for the selector attribute For example s company s employee e Automatic correction None For more information on XPath expressions see Constraint Properties on page 48 KeyRef Checks PowerDesigner provides default model checks to verify the validity of KeyRefs Check Description and Correction Name Code con if glossary enabled Names and codes must contain only approved terms drawn tains terms not in from the glossary glossary f e Manual correction Modify the name or code to contain only glossary terms e Automatic correction None Name Code con if glossary enabled Names and codes must not contain synonyms of glossary tains synonyms of terms glossary terms r i l e Manual correction Modify the name or code to contain only glossary terms e Automatic correction Replaces synonyms with their associated glossary terms Name Code Object names must be unique in the namespace uniqueness s i e Manual correction Modify the duplicate name or code e Automatic correction Appends a number to the duplicate name or code Undefined refer A keyRef must contain a reference to a key or a unique constraint ence e Manual correction In the keyRef property sheet define a refer
90. ndependently without a parent element and can be reused multiple times by elements complex types or other global groups through references In a schema it is directly linked to the lt schema gt tag root element See Creating a Group on page 39 A reference to a group is created within an element complex type or global group and makes the referenced group available to its parent See Creating a Reference to a Group on page 39 For example XML Modeling 37 CHAPTER 2 XML Diagrams descriptionLines G The descriptionLines group is reused in the definition of the product element by clicking the sequence group particle S with the Toolbox Group tool The Reference property of the referencing group property sheet is then set to descriptionLines In the generated XSD file the group is first declared with the lt group gt tag and then reused through a reference ref set to descriptionLines lt xml version 1 0 encoding UTF 8 7 gt lt xsischema xmins xs http www w3 org 2001 xmMLschema gt lt x rar gup name descriptionLines gt lt xsiall gt lt xs element name Vinel gt lt xs element name 1ine2 gt lt xs element name 1ine3 gt lt xstall gt lt xs igroup gt lt xs element name product gt lt xs complexType gt lt xs sequence gt lt xs element name name gt lt xsigroup ref descriptionLines gt lt xs group gt lt xs sequence lt xs complexType gt lt xs ele
91. ner supports the generation and reverse engineering of XML Schema Definition files XSD Document Type Definition files DTD and XML Data Reduced files XDR You can also generate a physical data model PDM from an XSM or generate an XSM froma PDM Generating XML Schema Files PowerDesigner provides a standard interface for generating all the supported XML schemas Target Schema Generated file Document Type Definition 1 0 Note Parameter entities are references to predefined values within a DTD file See Parameter property in entity property sheet During DTD generation some object properties con taining inadvertently parameter values will be generated with parameter references If you are not satisfied with this default use of parameter entities you should clear the Parameter property before generation XML Data Reduced 1 0 You can preview the file to be generated by selecting the Preview tab of your XML model property sheet see Previewing XML Code on page 8 Note The PowerDesigner generation system is extremely customizable through the use of extensions see Extending your Modeling Environmenton page 13 For detailed information about customizing generation including adding generation targets options and tasks see Customizing and Extending PowerDesigner gt Extension Files 1 Select Language gt Generateschema File to open the Generation dialog XML Modeling 65 CHAPTER 3 Generating and Reverse Engineer
92. nnnnnnnnnnnnn 29 Creating a Group Particle ccceeeeeeeeeeeeeeeeeeteeeeeeees 30 Group Particle Properties siccciccich ccasseissivapayetececeicitaeies 30 Simple Types XSM ccsvcicicccisssesesisssencacweacsdvavasaarciedsanantaneaes 31 Creating a Simple Type cccessssececeeeeeeseeeeeeeeeees 32 Simple Type Properties cceeeseeseeeeeeeeeeeeeeeeeeees 32 XML Modeling ili Contents Complex Types XSM cccssssssseeeeeeeeeeeceeeeeeeeeeeeeenseeeeeeeeeoees 33 Creating a Complex Type 0 2 0 ceeecceeecceeeceeeeeeeeeeeeeeeeees 34 Complex Type Properties ccccceeeeeeeeeeeeeeteeeeeeneeeees 34 Applying a Complex Type to an Element 36 Groups ASM sis cae cc ceieeie ieee tecce ean 37 Greating a CANO ie ea aa aianei naaa naaa EERE En ENNA 39 Creating a Reference to a Group sssssseessssssssrrrrreesse 39 Group Properties s c22 cette ain iceat eae aise sera ttee hice nda 40 Attribute Groups XSM seeeeeeeeeeeeeeeeeeeeeeeeeeeeees 41 Creating an Attribute Group ceeeeeeeeeeeeeeeeeeeneees 42 Attribute Group Properties ccceeeeeeeeeeeeeeeeeees 42 Any Elements XSM cccccccceeeeseeesesesesseeeeseeeeeeeeeeeeeeeeeeeneees 43 Creating an Any Element eeeeeeeeeeeeeeeeeeeeeeeeees 44 Any Element Properties eeececeeeceeeeeeeeeeeeeeeeeeees 44 Constraints Keys Uniques and KeyRefs XSM
93. notation name PICTURES public pictures gif system user local picturevVi ewer gt lt xs schema Notations are not available on models targeted with XDR Creating a Notation You can create a notation from the Browser or Model menu e Select Model gt Notations to access the List of Notations and click the Add a Row tool e Right click the model or package in the Browser and select New gt Notation For general information about creating objects see Core Features Guide gt Modeling with PowerDesigner gt Objects 58 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Notation Properties To view or edit a notation s properties double click its Browser or list entry The property sheet tabs and fields listed here are those available by default before any customization of the interface by you or an administrator The General tab contains the following properties Name Code Identify the object The name should clearly convey the object s purpose to non Comment technical users while the code which is used for generating code or scripts may be abbreviated and should not normally include spaces Neither the name nor code should contain colons You can optionally add a comment to provide more detailed information about the object By default the code is generated from the name by applying the naming conventions specified in the model options To decouple name code synchronization click to release the button
94. nt see Attributes XSM on page 24 e Constraints lists the constraints associated with the element see Constraints Keys Uniques and KeyRefs XSM on page 45 22 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams e Mappings lists the mappings to objects in other models associated with the element see Core Features Guide gt Linking and Synchronizing Models gt Object Mappings XDR Element Properties In a model targeted with the XML Data Reduced language elements are defined as follows XDR Element Description Attribute Specifies if an element can contain new local elements Possible values are e closed default e open if an Any element is attached to the element See Any Elements XSM on page 43 Specifies the content type Possible values are mixed a group particle and a data type are defined eltOnly a group particle is defined without a data type textOnly a data type is defined without a group particle empty neither group particle nor data type are defined General tab Group type Type Specifies how child elements are organized within a parent element Possible values are seq sequence group particle e one choice group particle e many all group particle General tab Group type Specifies a data type General tab Type Specifies a list of possible element values Values tab local elements only Specifies the name of a global element as reference for the local el
95. nu Simple types can only be created at the root of the model e Select Model gt Simple Types to access the List of Simple Types and click the Add a Row tool e Right click the model or package in the Browser and select New gt Simple Type Warning If the simple type symbol does not appear in the diagram select Symbol gt Show Symbols click the Simple Type tab select the simple types that you want to display and click OK For general information about creating objects see Core Features Guide gt Modeling with PowerDesigner gt Objects Simple Type Properties To view or edit a simple type s properties double click its diagram symbol or Browser or list entry The property sheet tabs and fields listed here are those available by default before any customization of the interface by you or an administrator The General tab contains the following properties Name Code Identify the object The name should clearly convey the object s purpose to non Comment technical users while the code which is used for generating code or scripts may be abbreviated and should not normally include spaces Neither the name nor code should contain colons You can optionally add a comment to provide more detailed information about the object By default the code is generated from the name by applying the naming conventions specified in the model options To decouple name code synchronization click to release the button to the right of the C
96. o new XML model 67 S schema 1 selector 45 Sequence group particle 29 shortcut check model 72 simple type check model 75 create 32 derive by list 55 derive by union 56 derived by list 31 derived by restriction 31 derived by union 31 list check 85 properties 32 union check 85 SQL XML query in XML model 87 stereotype attribute group 41 group 37 T traceability link 14 U union member types 56 properties 56 unique check model 83 field 45 XML Modeling 101 Index properties 45 element 19 selector 45 entity 59 import 61 X include 61 XDR 1 notation 58 any 43 redefine 61 AttributeType 26 XSD 1 xem 13 XSM 1 XML changing 12 diagram 15 check model 71 model 1 create 4 objects 16 edit definition file 11 XML diagram functional overview 1 attribute 24 102 SAP Sybase PowerDesigner
97. ode field Names and codes must be unique among all simple and complex types Stereotype Extends the semantics of the object You can enter a stereotype directly in this field or add stereotypes to the list by specifying them in an extension file Derivation required XSD only Specifies a derivation method for the data type to extend or restrict its values Resets the Type property to lt None gt Click the Properties tool to further define the derivation see Derivations Extensions Restrictions Lists and Unions XSM on page 50 Prevents derivation of the object Specifies the ID of the object which must be unique within the model Keywords Provide a way of loosely grouping objects through tagging To enter multiple key words separate them with commas 32 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Complex Types XSM A complex type is an element that contains other elements or attributes and which is used to define a data type to be reused and derived by extension or restriction You can only create complex types in a model targeted with XSD Complex types are generally created directly under the lt schema gt tag to be reused or derived by extension or restriction in other parts of the schema Such global complex types are listed in the Browser and can have symbols in the diagram Complex types can also be created within an element by selecting Comp1ex in the Embedded Type field of the element prope
98. ot be used in the instance document Specifies the ID of the object which must be unique within the model Keywords Provide a way of loosely grouping objects through tagging To enter multiple key words separate them with commas The following tabs are also available e Attributes lists the attributes and attribute groups associated with the complex type see Attributes XSM on page 24 XML Modeling 35 CHAPTER 2 XML Diagrams Mappings lists the mappings to objects in other models associated with the element see Core Features Guide gt Linking and Synchronizing Models gt Object Mappings Applying a Complex Type to an Element You apply a complex type to an element by selecting it in the Type list on the General tab of the element property sheet 1 2 4 Open the property sheet of the element to which you want to apply the type If the type is present in the model even if only in shortcut form you can select it directly in the Type list If the type is defined in another model open in the workspace click the Select Object tool to the right of this field to select it and create a shortcut in the model Click OK to apply the type and return to the diagram The complex type symbol appears to the right of the element In the following example the Name is a complex type defined in the model and applied to the Emp loyee Name element while Address is a shortcut to a complex type defined in another model and ap
99. oup or complex type and referencing them The following tables list the allowed links XML Modeling 17 CHAPTER 2 XML Diagrams Tool Element symbol Group symbol Complex type symbol creates a refer ence to a group Note If the tool cannot be used in the current point in the diagram the cusror displays a forbidden sign If an object can be created as a sibling or a child to the object under the cursor it displays an arrow indicating the corresponding direction The following table lists the children that you can create under sequence choice and all group particles No link No link No link No link No link Warning A group particle sequence choice all cannot be created from scratch in a diagram It must be the child element of an element a group or a complex type SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Elements XSM Elements are the basic building blocks of an XML model which organizes them into a tree structure Elements can contain other elements via group particles and attributes and can reference groups attribute groups and simple and complex types Elements can be either global or local e Global elements have no parent element and are directly linked to the lt schema gt root element They can be reused in the model through referencing elements e Local elements have a parent element in a diagram and are unique within t
100. owerDesigner CHAPTER 2 XML Diagrams Property Description Descriptive label of the instruction Stereotype Extends the semantics of the object You can enter a stereotype directly in this field or add stereotypes to the list by specifying them in an extension file Items Tab The Items tab which is available for redefines only lists the items to be redefined The following tools are available Tool Description Add Group Adds a group of elements to be redefined Add Attribute Group Adds a group of attributes to be redefined Ea Add Simple Type Adds a simple type to be redefined Add Complex Type Adds a complex type to be redefined Business Rules XSM A business rule is a rule that your business follows It is a written statement specifying what an information system must do or how it must be structured It could be a government imposed law a customer requirement or an internal guideline You can attach business rules to your model objects to guide and document the creation of your model For example the rule an employee belongs to only one division can help you graphically build the link between an employee and a division For more information see Core Features Guide gt Modeling with PowerDesigner gt Objects gt Business Rules XML Modeling 63 CHAPTER 2 XML Diagrams 64 SAP Sybase PowerDesigner CHAPTER 3 Generating and Reverse Engineering XML Schemas and Other Models PowerDesig
101. pe list Its value must be of type ID and unique within the model Data type for the list of values Embedded If selected the type disappears and a simple type is created in the schema within Type the current simple type or element Click Apply and then the Properties tool beside the Embedded type box to define a derivation and a type for the embedded simple type 3 Click OK to close the list property sheet and return to the element or simple type Deriving by Union You can derive an element or simple type by union to define it as a collection of built in and simple data types 1 Open the property sheet of an element or simple type and select Union in the Derivation list For elements the Embedded type field is set to Simple 2 Click the Properties tool to the right of the Derivation box to open the union property sheet and complete the following properties ID ID of the simple type union Its value must be of type ID and unique within the model containing the simple type union Member Types White space separated list of built in data types Values must be qualified names 3 optional Click the Union Types tab and add appropriate simple types to the union 4 Click OK to close the union property sheet and return to the element or simple type Annotations XSM Annotations allow you to add information about an XSD model Annotations can be added at the schema level or on any element or other object within an X
102. ple type is created in the schema simple types within the current simple type Click Apply and then the Properties tool beside only the Embedded type box to define a derivation and a base type for the embedded simple type 3 optional simple type restrictions only Click the Detail tab and enter appropriate facets constraints on the set of values of a simple type for the restriction eon rece e Length Exact number of characters or list items allowed It must be equal to or greater than zero Whitespace Way of handling white spaces You can choose from the following e Preserve white spaces are unchanged e Replace Tabs line feeds and carriage returns are replaced with spaces e Collapse Contiguous sequences of spaces are collapsed to a single space Leading and trailing spaces are removed Minimum length Minimum number of characters or list items allowed It must be equal to or greater than zero Maximum length Maximum number of characters or list items allowed It must be equal to or greater than zero Minimum exclusive Lower bound for numeric values All values are greater than this value Maximum exclusive Upper bound for numeric values All values are lower than this value Minimum inclusive Minimum value allowed for data type Maximum inclusive Maximum value allowed for data type Total Total digits Exact number of decimal digits allowed It must be greater than zero _ Exact number Tota
103. plied to the Emp loyee Address element optional Click the plus sign to the right of the complex type to display its child elements You may need to move the complex type symbol or other symbols to allow all of them to display without overlap 36 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams You can edit the properties and child elements of any instance of a complex type defined in the model and these changes will be propagated to all other instances When working with shortcuts to complex types defined in other models the model containing the complex type must be open for you to be able to display its children When the model is open and the children displayed you can move them around temporarily in the diagram but their positions will not be persisted after you save and close the model Complex types and complex type shortcuts and their children are displayed in the Mapping Editor see Core Features Guide gt Linking and Synchronizing Models gt Object Mappings under each element to which they are applied and each instance of the complex type can be mapped independently through generation see Generating Other Models from an XSM on page 69 or manually Database B z3 Database oA Employee EA Middle Name Groups XSM A group of elements is a set of elements arranged by a group particle all choice or sequence which is then referenced in the model by various elements A group is created i
104. py for editing use the New tool on the resource file list and save it in another location To include resource files from different locations for use in your models use the Path tool on the resource file list To open your model s definition file and review its extensions select Language gt Edit Current Language For detailed information about the format of these files see Customizing and Extending PowerDesigner gt Object Process and XML Language Definition Files Note Some resource files are delivered with Not Certified in their names Sybase will perform all possible validation checks however Sybase does not maintain specific environments to fully certify these resource files Sybase will support the definition by accepting bug reports and will provide fixes as per standard policy with the exception that XML Modeling 11 CHAPTER 1 Getting Started with XML Modeling there will be no final environmental validation of the fix Users are invited to assist Sybase by testing fixes of the definition provided by Sybase and report any continuing inconsistencies Changing the XML Language You can change the XML language being modeled in your XSM at any time Simple types and complex types are only supported by XSDs schemas When changing an XSD into a DTD or an XDR simple types and global complex types directly linked to the lt schema gt tag disappear from the diagram and the Browser tree view Local complex types within
105. rDesigner CHAPTER 1 Getting Started with XML Modeling Editor Menu Shift F11 Contains the following commands New Ctrl N Reinitializes the field by removing all the existing content Open Ctrl O Replaces the content of the field with the content of the se lected file Insert Ctrl I Inserts the content of the selected file at the cursor Save Ctrl S Saves the content of the field to the specified file Save As Saves the content of the field to a new file Select All Ctrl A Selects all the content of the field Find Ctrl F Opens a dialog to search for text in the field Find Next F3 Finds the next occurence of the searched for text Find Previous Shift F3 Finds the previous occurence of the searched for text Replace Ctrl H Opens a dialog to replace text in the field Go To Line Ctrl G Opens a dialog to go to the specified line Toggle Bookmark Ctrl F2 Inserts or removes a bookmark a blue box at the cursor position Note that bookmarks are not printable and are lost if you refresh the tab Next Bookmark F2 Jumps to the next bookmark Previous Bookmark Shift F2 Jumps to the previous bookmark Edit With Ctrl E Opens the previewed code in an external editor Click the down arrow to select a particular editor or Choose Program to specify a new editor Editors specified here are added to the list of editors available at Tools gt General Options gt
106. rection None XML Modeling 71 CHAPTER 4 Checking an XSM Description and Correction Invalid cardinali You should define a minimum 0 or 1 and a maximum cardinality 1 or un ty bounded for a group particle occurrence This check is only available in a model targeted with XDR e Manual correction Double click the group particle symbol and type a value for Minimum 0 or 1 and Maximum 1 or unbounded properties e Automatic correction None Model Checks PowerDesigner provides default model checks to verify the validity of models built on a schema Check Description and Correction Identifier unique Two or more objects cannot have the same identifier ID ness e Manual correction Give a unique identifier to each object e Automatic correction None Undefined identi You must define an identifier ID for each object in the model fier e Manual correction Define an identifier for each object e Automatic correction None Shortcut code Two shortcuts with the same code cannot be in the same namespace uniqueness e Manual correction Change the code of one of the shortcuts e Automatic correction None Undefined target You should define a target namespace to your model namespace f e Manual correction Type a URI for the Target Namespace property in the Detail tab of the model property sheet e Automatic correction None Missing name There should be at least one namespace defined
107. rty sheet see Element Properties on page 20 Such local complex types can only be seen as part of the schema in the Preview tab of the element property sheet In this example the global Address complex type is selected as the type of the User Address element Street Number The generated schema is as follows lt xml version 1 0 encoding UTF 8 gt lt xs schema elementFormDefault qualified xmlns xs http www w3 org 2001 XMLSchema gt lt xs complexType name Address gt lt xs sequence gt lt xs element name Street_Number gt lt xs element name Town gt lt xs element name Zip gt lt xs element name Country gt lt xs sequence gt lt xs complexType gt lt xs element name User gt lt xs complexType gt lt xs sequence gt lt xs element name First Name gt lt xs element name Family Name gt lt xs element name User Address type Address gt XML Modeling 33 CHAPTER 2 XML Diagrams lt xs sequence gt lt xs complexType gt lt xs element gt lt xs schema gt Creating a Complex Type You can create a complex type from the Toolbox Browser or Model menu Complex types can only be created at the model root e Use the Complex Type tool in the Toolbox Select Model gt Complex Types to access the List of Complex Types and click the Add a Row tool e Right click the model or package in the Browser and select New gt Complex Type For infor
108. s that the object has child elements and how they are used see Group Particles XSM on page 29 You can choose between all Each child element can occur 0 or 1 times choice Only one child must be present group Reference to a predefined group see Groups XSM on page 37 sequence All children must be present in order XSD only Specifies the type of content of the object You can select e Complex elements or elements and character data Click the Properties tool to specify an ID unique within the model for the complex content and select the Mixed check box if character data can appear between child elements Simple character data or a simple type but no elements Click the Properties tool to specify an ID for the simple content Derivation XSD only Specifies a derivation method for the data type to extend or restrict its values Resets the Type property to lt None gt Click the Properties tool to further define the derivation see Derivations Extensions Restrictions Lists and Unions XSM on page 50 Detail Tab The Detail tab contains the following properties Property Description Prevents derivation of the object Block Specifies that another object with the same type of derivation cannot be used in place of the current one Mixed Specifies that character data can appear between child elements Only appropriate if the complex type has complex content Specifies that the object cann
109. s the namespaces used to declare objects used in the model e Preview Displays a preview of the XSD DTD or XDR file generated from the XSM XML Modeling 7 CHAPTER 1 Getting Started with XML Modeling Previewing XML Code Click the Preview tab in the property sheet of the model elements and various other model objects in order to view the code that will be generated for it E Element Properties Resume Resume General Detail Attributes Constraints Annotation Notes Preview a R dall am oO fe nico lt xs element id RES name Resume gt lt x3 complexType gt lt x3 sequence id 505 maxOccurs 1 minOccurs 1 gt lt xs element id JBREF name jobReference maxOccurs lt xs element id CONT name Contact maxOccurs 1 mit lt xs complexType gt lt x3 sequence id SQ1 maxOccurs 1 minOccurs _ lt xs element id FN name FirstName maxOccu lt xs element id LN name LastName maxOccur lt xs element id PADD name PersonAddress mi lt xs element id PH name Phone maxOccurs lt x3s complexType gt lt xs all id ALL1 gt lt xs element id HPH name HomePhone lt xs element id 0PH name 0fficePhe lt xs element id FPH name FaxPhone lt xs element id CPH name CellPhone lt xsiall gt x x80 Fle TE Ml More gt gt a v Cancel Apply Help The following tools are available on the Preview tab toolbar 8 SAP Sybase Powe
110. space S Reame e E O Main StartDate xs gYearMonth 1 Contact EndDate xs gYearMonth 2 Achievement a 3 Description a 4 Address H Simple Types jg Complex Types H a Elements Achievement Fy so H Groups D ipti XML Diagram Objects An XML model represents the structure of a potential or existing XSD DTD or XDR through a tree structure of elements PowerDesigner supports all the objects necessary to build XML diagrams Object Tool Symbol Description Element Element The basic object of an XML model An element can Element contain other elements or attributes See Elements N A XSM on page 19 Attribute Additional information about an element or a complex type Defined by a built in data type or a simple data type See Attributes XSM on page 24 Sequence Group particles arranges child elements so that all must Choice appear at least once in the order of their declaration only one must be chosen or any can appear in any order All See Group Particles XSM on page 29 16 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Object Tool Symbol Description Simple Type N A N A XSD only Used in the case of elements or attributes with text only content See Simple Types XSM on page 31 Complex Type XSD only Used to introduce elements or attributes within an element declaration See Complex Types XSM on page 33 Group croup A group of elements arranged by a group particle D
111. ss the non XML object For example user local picture Viewer Value Value of the entity A string of characters in the case of a predefined value A URI in the case of an XML ora non XML file For example http something com pictures 60 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Property Description Used to define and process non XML objects within an XML model Parameter If selected the entity is parsed within the DTD and not within the XML document as for a general entity A parameter entity allows you to predefine a value within a DTD This predefined value can then be easily changed within the DTD Keywords Provide a way of loosely grouping objects through tagging To enter multiple key words separate them with commas Instructions Import Include and Redefine XSM Import Include and Redefine allow you to enrich your XML model with external namespaces schema files or schema components These instructions are only available in a model targeted with XSD Imports An import identifies a namespace whose schema components are referenced by the current schema allowing you to use components from any schema with different target namespace than the current schema In a schema an import is declared with the lt import gt tag For example lt xml version 1 0 encaoding UTF 8 gt lt xsischema xmins xs http www w3 org 2001 xmMLSchema gt lt xsiimport id IMP1L namespace xml ordering
112. straint is defined with its ramifications OOo iO O Selects all the employee child elements of the context node defined in the namespace with the s prefix employee Selects all the employee descendants of the root node employee Selects the employee descendants of the context node company employee Selects the employee descendants of the company child ele ments of the context node company employee Selects all the employee elements with company as parent ele ment in the context node book chapter 2 section 3 Selects the third section in the second chapter of the book employee dept doc Selects all the employee child elements of the context node with a dept attribute set to doc employee dept doc 3 Selects the third employee child element of the context node with a dept attribute set to doc employee 3 dept doc Selects the third employee child element of the context node only if it has a dept attribute set to doc chapter title Selects the chapter child elements of the context node with at least one title child element XML Modeling 49 CHAPTER 2 XML Diagrams syntax Description S chapter title About this book Selects the chapter child elements of the context node with at least one title child element with a text content set to About this book employee numEmployee and Selects all the employee child elements of the context node with dept the numEmployee and dept attributes Selects all the chil
113. t SQL Server Yes XSD or XDR Microsoft SQL Server 2000 and higher Oracle 9i2 Oracle 912 and higher Oracle 912 and higher Ixso Oracle 932 912 IBM DB2 v8 1 and IBM DB2 DAD higher By attaching the SQL XML extensions to an XML model mapped to a PDM you can also generate SQL XML queries to retrieve data in an XML format from relational databases supporting SQL XML Note You can also generate PDM tables from an XML schema For more information see Generating Other Models from an XSM on page 69 Generating an SQL XML Query File SQL XML is an XML extension of the Structured Query Language which allows you to retrieve relational data using extended SQL syntax and produce an XML result You can generate SQL XML queries for global elements in your XSM whatever the targeted XML language XSD DTD or XDR SQL XML has five main elements e XMLELEMENT to edit an element with a name a list of attributes optional and a list of values optional e XMLATTRIBUTES to edit a list of attributes with names and values e XMLAGG to edit in multiple rows a concatenation of elements from a single XML value corresponding to a single column e XMLCONCAT to edit in the same row a concatenation of elements from several XML values corresponding to several columns XML Modeling 87 CHAPTER 5 Working with XML and Databases XMLFOREST to edit in the same row a concatenation of elements from several SQL values corresponding to s
114. t or the Browse tool Automatic correction None Simple Type Union Checks PowerDesigner provides default model checks to verify the validity of simple type unions Check o Description and Correction Undefined base type You must define at least two data types when you derive a simple type by union e Manual correction In the simple type property sheet click the Prop erties tool beside the Derivation box to display the simple type union property sheet and type a white space separated list of at least two data types qualified names in the Member types box Automatic correction None XML Modeling 85 CHAPTER 4 Checking an XSM Annotation Checks PowerDesigner provides default model checks to verify the validity of annotations Check Description and Correction Existence of items An annotation must contain at least one URI for a Documentation or an Application Information e Manual correction Define a URI for a Documentation or an Appli cation Information e Automatic correction None 86 SAP Sybase PowerDesigner CHAPTER 5 Working with XML and Databases Many relational databases now support XML so that you can store or retrieve data through XML files You can use an XML model to generate an annotated schema that will allow you to store or retrieve data in such a database The following databases are available Database Mapped XML Targeted XML lan Required XEM model guage file Microsof
115. tag in the schema within the lt at Type tribute gt tag Resets the Type property to lt None gt Derivation XSD only Specifies a derivation method for the data type to extend or restrict its values Resets the Type property to lt None gt Click the Properties tool to further define the derivation see Derivations Extensions Restrictions Lists and Unions XSM on page 50 Keywords Provide a way of loosely grouping objects through tagging To enter multiple key words separate them with commas 26 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams Detail Tab The Detail tab of an attribute property sheet displays the following properties Property Description Specifies a default value for the object Mutually exclusive with Fixed Specifies a fixed value for the object Mutually exclusive with Default Specifies how the attribute can be used Select from Optional the attribute is optional and may have any value Prohibited the attribute cannot be used Use this value to prohibit the use of an existing attribute in the restriction of another complex type Required the attribute must appear at least once and may have any value matching its data type Form Specifies whether or not the object name must be qualified by the target namespace of the schema Specifies the ID of the object which must be unique within the model Attribute Property Sheet Values Tab The Values tab of an attribute property sheet
116. the duplicate name or code Complex Type Checks PowerDesigner provides default model checks to verify the validity of complex types Check Description and Correction Name Code con if glossary enabled Names and codes must contain only approved terms drawn tains terms not in from the glossary glossary f p e Manual correction Modify the name or code to contain only glossary terms e Automatic correction None Name Code con if glossary enabled Names and codes must not contain synonyms of glossary tains synonyms of terms glossary terms e Manual correction Modify the name or code to contain only glossary terms e Automatic correction Replaces synonyms with their associated glossary terms XML Modeling 75 CHAPTER 4 Checking an XSM Description and Correction Name Code Object names must be unique in the namespace uniqueness e Manual correction Modify the duplicate name or code e Automatic correction Appends a number to the duplicate name or code Existence of at A complex type should have at least one attribute tribute e Manual correction Define an attribute for the complex type e Automatic correction None Existence of par A complex type must contain elements groups group particles and or Any ticle e Manual correction Add items to the complex type or delete complex type e Automatic correction None Element Checks PowerDesigner provides default model ch
117. to the right of the Code field Stereotype Extends the semantics of the object You can enter a stereotype directly in this field or add stereotypes to the list by specifying them in an extension file URI reference identifying the non XML object For example pictures gif URI reference identifying the application that will process the non XML object For example user local picture Viewer ID ID of the notation Its value must be of type ID and unique within the model con taining the notation Keywords Provide a way of loosely grouping objects through tagging To enter multiple key words separate them with commas Entities XSM Entities enable you to include predefined values external XML or non XML files in an XML model targeted with a DTD When an XML processor reads an entity reference in an XML document it will replace this entity reference by its value defined in the DTD file of the XML document An entity reference is the entity name preceded by an ampersand and followed by a semicolon For example amp furtherinfo will be replaced by For further information see The W3C has predefined five entities for XML tags XML Modeling 59 CHAPTER 2 XML Diagrams Entity name Reference Value a In an XML model you just need to type the name and the value of an entity Creating an Entity You can create an entity from the Browser or Model menu e Select Model gt Entities to access the List of Ent
118. traints tab contains the following tools 2 Add Key Constraint The element value must be a key within the specified scope The scope of a key is the containing element in an instance document A key must be unique not null and always present Add Unique Constraint The element value must be unique or null within the specified scope unique constraint Add KeyRef Constraint The element value corresponds to those of the specified key or XML Modeling 47 CHAPTER 2 XML Diagrams For general information about creating objects see Core Features Guide gt Modeling with PowerDesigner gt Objects Constraint Properties To view or edit a constraint s properties double click its Browser or list entry The property sheet tabs and fields listed here are those available by default before any customization of the interface by you or an administrator The General tab contains the following properties Name Code Identify the object The name should clearly convey the object s purpose to non Comment technical users while the code which is used for generating code or scripts may be abbreviated and should not normally include spaces Neither the name nor code should contain colons You can optionally add a comment to provide more detailed information about the object By default the code is generated from the name by applying the naming conventions specified in the model options To decouple name code synchronization clic
119. tributes tab and then click the Add Group with Reference to Group tool see Element Properties on page 20 For general information about creating objects see Core Features Guide gt Modeling with PowerDesigner gt Objects Attribute Group Properties To view or edit attribute group s properties double click its Browser or list entry The property sheet tabs and fields listed here are those available by default before any customization of the interface by you or an administrator The General tab contains the following properties Name Code Identify the object The name should clearly convey the object s purpose to non Comment technical users while the code which is used for generating code or scripts may be abbreviated and should not normally include spaces Neither the name nor code should contain colons You can optionally add a comment to provide more detailed information about the object By default the code is generated from the name by applying the naming conventions specified in the model options To decouple name code synchronization click to release the button to the right of the Code field Name and Code are read only for references to attribute groups Stereotype Extends the semantics of the object You can enter a stereotype directly in this field or add stereotypes to the list by specifying them in an extension file Reference for references to attribute groups Specifies the group being referenced Select a
120. ttribute default 0 type localattribute gt lt fElementType gt In a model targeting XSD you can derive an attribute data type to extend or restrict its values For example Employees number xs positivelnteger references xs string quantities xs unsignedLong fidelity xs boolean solvency xs boolean Company COMPANY foundation xs date status xs token Generated schema 24 SAP Sybase PowerDesigner CHAPTER 2 XML Diagrams lt xml version 1 0 encoding UTF 8 gt lt xsischema xmlns xs http ff ww w3 orgze001yxm Schema gt lt xs element name COMPANY lt xs complexType gt lt xs sequence gt lt xs element name EMPLOYEES gt sxs comp lexType gt lt xsiattribute ref NUMBER gt lt xstattribute gt lt xsicomplexType gt lt xs element gt lt xs element name PRODUCTS gt lt xs i complexType gt lt xsiattribute name REFERENCES type xsistring gt lt xstattribute gt lt xSiattribute name QUANTITIES type xs unsignedcLong gt lt xstattribute gt lt xs complexType gt lt xs re lement gt lt xs element name CLIENTS gt lt xsicomplexType gt lt xsiattribute name FIDELITY type xs string gt lt xstattribute gt lt xSiattribute name SOLVENCY type xs istring gt lt xstattribute gt lt xsicomplexType gt lt xs element lt xs sequence gt lt xSiattribute name FOUNDATION type xs idate gt lt xstattribute gt lt xSiattribute name
121. with IBM DB2 Extender and describing the specific syntax of DAD files Schema validation Validation tag in the DAD files to check the conformity of DAD files with the DAD syntax 8 Click OK to begin the generation The Result dialog box is displayed with the path of the generated DAD DTD and SQL files 9 Click Edit to open the generated DAD file in your associated editor e Extract of a DAD file defined with Xco lection as StorageType and RDB as MappingType XML Modeling 97 CHAPTER 5 Working with XML and Databases lt DOCTYPE DAD SYSTEM E dad dtd gt lt DAD gt lt validation gt Yes lt validation gt lt xcollection gt lt prolog gt xml version 1 0 lt prolog gt lt doctype gt DOCTYPE Root SYSTEM C TEMP DTD_files corporatemember ship dtd lt doctype gt lt root_node gt lt element_node name Root gt lt element_node name DEPARTMENT gt lt attribute_node name DEPNUM gt lt RDB_node gt lt table name DEPARTMENT gt lt column name DEPNUM type INTEGER gt lt RDB_node gt lt fattribute_node gt lt attribute_node name DEPNAME gt lt RDB_node gt lt table name DEPARTMENT gt lt column name DEPNAME type VARCHAR 254 gt lt RDB_node gt lt fattribute_node gt lt element_node name EMPLOYEE gt lt attribute_node name DEPNUM gt lt RDB_node gt lt table name EMPLOYEE gt lt column name DEPNUM type INTEGER gt lt RDB_node gt lt fattribute_node
122. xs rredefine gt lt xsischema gt Creating an Import Include or Redefine Instruction You can create an import include or redefine instruction from the model property sheet or from the Browser or Model menu Select Model gt Import Include or Redefine to access the relevant list and click the Add a Row tool e Open the External Schemas tab in the property sheet of the model and click the Add Import Add Include or Add Redefine tool e Right click the model or package in the Browser and select New gt Import Include or Redefine For general information about creating objects see Core Features Guide gt Modeling with PowerDesigner gt Objects Import Include and Redefine Properties To view or edit an instruction s properties double click its Browser or list entry The property sheet tabs and fields listed here are those available by default before any customization of the interface by you or an administrator The General tab contains the following properties Schema loca URI reference for the location of a schema file with an external namespace You can tion use the Browse tool beside the Properties tool to select a schema file among those opened in the current workspace For example ORDER xsd ID ID of the instruction Its value must be of type ID and unique within the schema containing the instruction import only URI reference for the namespace to import For example xml order ing 62 SAP Sybase P

Download Pdf Manuals

image

Related Search

Related Contents

PE-07-11 温度センサ用接続導線  取扱説明書  取扱説明書 - psn  Handbuch - Toms-Car-HiFi  Gear Head Mouse LM6000U User's Manual  LABORATORIO MECATRONICA    descalcificador matrix 368  FORNO A LEGNA GUSTO TOP  1 - 三菱電機システムサービス  

Copyright © All rights reserved.
Failed to retrieve file