on 03-25-2016 7:08 PM
I have an XSD model with a simple string extended attribute at the Element level and I'd like to update the XML Language definition to include the value of my extended attribute in the XML as a commented field.
What syntax do I need to use to access the extended attribute?
I have found the resolution. Bridging pages 248-249 of the Customizing PowerDesigner guide, there is "Note: To access an extended attribute defined in another extension file attached to the model, prefix the name with the .D formatting option. For example: %.D:MyExtAtt%"
I can put the following code in the 'extendedAttributesDecl' to comment my Elements with the value of my extended attribute:
.if(%.D:oURI%)
<!-- element UIR: %.D:oURI%-->
.endif(\n)
Bonus item was finding that './/' or '.comment' can be used to add inline comments to the GTL code that won't be output in the generated result.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't have any examples to share with you, but here are a couple of pointers. There's a likely-looking property in the XML Language definition:
Profile\Element\Templates\extendedAttributesDecl
Take a look at 'Customising and Extending PowerDesigner' on the Help menu - topic "Customising Generation with GTL". Looks like the "itemDecl" template may provide you with some good examples.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, this is the area where I found myself stumped.
I have an extended attribute for Elements which is a string that contains a resolvable URL to a published glossary, separate from the element definition which is set in the comment's section.
Under the "itemDecl" section for Element, I'm wanting to extend it, or possibly the "extendedAttributesDecl" to include this specific item in a comment in the XML output. I guess it's really a two part question, 1) How do I interrogate the extended attributes of an object with GTL and 2) what %variable% would display the results?
I'm unable to upload a sample model (blocked by company policy), but I've been using a really simplified, generic model for testing. I have one complex type with two elements within it. I've added a "URI" extended attribute of type string to both complex element and element and populated it with the elementname + "URI" to just identify it in the output.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.