Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8856357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:20:20+00:00 2026-06-14T14:20:20+00:00

it’s going to be a long post, thank you for readying :-) This question

  • 0

it’s going to be a long post, thank you for readying 🙂
This question is from a one level up “view” from this post:

Storing meta information to class properties

We have a XSD from which we are going to generate classes from (C#/Java). So the problem is split into two different parts: Define it in the XSD, then create the datamodel from it.

We want to have some elements in a complex type to carry meta information, but just in certain x-paths in the XSD. That means that when a type is reused as a element in another complex type we want to tell the user whether it is “relevant” for something (I called it security relevant in my other post). The relevance is denoted in several levels. (That explanation also applies for the datamodel in C#/Java ofcourse)

XSD Type Example:

<xs:complexType name="Core">
  <xs:sequence>
    <xs:element name="No" type="xs:int" />
  </xs:sequence>
</xs:complexType>

<xs:complexType name="ComplexA">
  <xs:sequence>
    <xs:element name="Info" type="Core" />
  </xs:sequence>
</xs:complexType>

<xs:complexType name="ComplexB">
  <xs:sequence>
    <xs:element name="Info" type="Core" />
  </xs:sequence>
</xs:complexType>

The Core type has a property “No”. This property can be relevant in other types. For example, it is supposed to be “relevant-level-1” in type ComplexA.Info, in ComplexB.Info it’s not.

We came up with two different ways to achieve this:

1: Introduce a attribute on type level:

<xs:complexType name="ComplexA">
  <xs:sequence>
    <xs:element name="Info" type="Core" />
  </xs:sequence>
  <xs:attribute name="Relevance.Info.No" type="RelevanceType" fixed="Relevance1"/>
</xs:complexType>

<xs:simpleType name="RelevanceType">
  <xs:restriction base="xs:string">
    <xs:enumeration value="Relevance1" />
    <!-- Some more relevance values -->
  </xs:restriction>
</xs:simpleType>

The attribute “Relevance.Info.No” basically tells that the property “No” in the member “Info” has the relevance type “Relevance1”. This approach has obviously some drawbacks. The class generation is very complicated since we would have to manually process this attribute information. A solution for that is posted in the thread mentioned in the beginning.

2: Introduce another complex type for every property with a relevance level:

This will solve the way this “meta data” is attached to the properties, but will apperently produces a lot classes on XSD and C#/Java for every combination of relevance level within a type.

As you can imagine the problems for the creation of the datamodel on C# and Java side are very similar to the problems within the XSD. The best way would be to have XSD ready to automatically create the java classes (JaxB) and C# classes (XGen) without any other manipulation of the generated code (which I’m doing right now).

Do you see any other possibilities to achieve that?

Any help is appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:20:21+00:00Added an answer on June 14, 2026 at 2:20 pm

    Well as I stated in my comment to the answer, I don’t think there is a clean solution to this. Maybe XML is not intended to be used like this.
    But I would be still interested in other solutions…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view passing on information from a database: def serve_article(request, id): served_article
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
Does anyone know how can I replace this 2 symbol below from the string
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.