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 3969422
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:57:43+00:00 2026-05-20T03:57:43+00:00

I have given the local name of an element or attribute and the schema

  • 0

I have given the local name of an element or attribute and the schema for the document. What is the easiest way to determine the basic datatype of the element or attribute. By basic datatype I mean the xs:string, xs:date etc. (The built in data types for the xml schema.)

One of the problems I face is that it is rare for the elements type to be one of the basic built in types. 99% of the time it is a complex type that 50% of the time refers to another complex type that refers to another complex type and so on.

A simple Example for this schema: I want to find the basic type for Employee/Person/Name/LastName (determine that LastName is xs:normalizedString).
In the schema Employee is defined as an xs:element and type=”bns:EmployeeType”

EmplyeeType has a Person element defined but it is type “PersonType” and then Name in person is NameType which is a complex type that extends GeneralName type that is type BasicNameType and that type finally defines the LastName which is of type “LastNameType” and on and on. There also definitions etc.

I am currently writing a parser using linq-to-xml to get at this but it isn’t easy or pretty. I have searched for other solutions and haven’t found any but I fully admit my XML/schema/XPath ignorance.

Is there an easy way to get the basic type for elements?

  • 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-05-20T03:57:43+00:00Added an answer on May 20, 2026 at 3:57 am

    Don’t attempt to do this by hand.

    I’m not familiar with Linq, so there might be other ways of doing this, but one way is to use schema-aware XSLT or XQuery. If you process your validated document using a schema-aware XSLT or XQuery processor then you will be able to do tests like

    if (. instanceof attribute(*, xs:normalizedString)) ...
    

    which is true if the context node is an attribute node that was validated against an attribute declaration whose governing type is xs:normalizedString.

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

Sidebar

Related Questions

Here's my template: <xsl:template name=rec> <xsl:for-each select=*> <div class={local-name()}> <xsl:for-each select=@*> <xsl:attribute name=data-{local-name()}> <xsl:value-of
I have part of XmlDocument Example.xml as given below: <rapaine dotoc=palin domap=rattmin> <derif meet=local
I have the following code (VB.NET) which is designed to determine if a given
I have given a table background image using css background-image property. The cells are
Note: I have given up on compiling iPhone Apps without a developer certificate for
My boss have given me assignment to find how a web based application developed
i have developed an web application[ERP FOR A SCHOOL].i have given the build for
Many thanks for the advice you have given me thus far. Using testbenches is
My question is as follows: I have given a workbook to multiple people. They
Sometimes pdf might have a transparent background. And In my application I have given

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.