xml - XSD elements - adding displayname for UI display -


so have xsd schema use generate ui, create xml document conforms schema. xelements in schema, want have display name used ui, rather element name not human readable.

edit: use c# , linq parse xsd , generate ui. there no tool.

the original idea use annotations/appinfo add custom 'comment type' attributes every element, got extremely verbose, obfuscating core purpose of schema. wondering whether can add 'displayname' attribute xsd schema elements, not translate xml data requiring attribute.

e.g. xsd before :-

<xs:element name="grnbulb" type="xs:string">   <xs:annotation>     <xs:appinfo>       <displayname>bulbasaur</displayname>     </xs:appinfo>   </xs:annotation> </xs:element> 

xsd after :-

<xs:element name="grnbulb" type="xs:string" displayname="bulbasaur" /> 

in either case, require xml data same :-

<grnbulb>awesome</grnbulb> 

and displayname used ui display (bulbasaur : textbox). possible / feasible, or better ways accomplish same task?

my final degree project multiplatform mobile app used xml schema same purpose, in addition, if user wants he/she use xslt transform xml document html or pdf, , used schematron add semantic restrictions (assertions) allowed me implement error prevention. displayname great improvement app, had problem before , come solution talking about.

as xml schema specs says in every element can add

{any attributes non-schema namespace . . .}>

and xml schema still valid attributes. easier use xs:appinfo, why not use it? you can create own namespace improvements. note maybe want add more improvements in future.

<?xml version="1.0" encoding="utf-8"?> <xs:schema      xmlns:xs="http://www.w3.org/2001/xmlschema"     xmlns:imp="http://myimprovementsuri.com">     <xs:element name="grnbulb" type="xs:string" imp:displayname="bulbasaur"/> </xs:schema> 

since implemented similar functionality tell of improvements added namespace in case want know them:

  • imp:label - same displayname both xs:element , xs:attribute.
  • imp:image - adds icon near label of element or attribute.
  • imp:newpage - element display in new page (i had implement multi page navigation because of little mobile screen sizes), element showed link , when press link element displayed in full page. don't think useful desktop platforms.
  • imp:view - element have different views (e.g.: can display enum or choice radio buttons or select, can display string element input or textarea, etc.)
  • imp:listlabel, imp:listimage, imp:newpage - same others lists. when has maxoccurs>1 or minoccurs<1 created list have own header own improvements. example: icon of group of people in list header , icon of person in header of every occurrence of person in list.

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -