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

  • Home
  • SEARCH
  • 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 6862101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:37:11+00:00 2026-05-27T02:37:11+00:00

I have xml file like this <?xml version=1.0 encoding=UTF-8?> <specification xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:noNamespaceSchemaLocation=file://Desktop/normal.xsd> <university> <refstr>bdvl_te_skrm_stc</refstr>

  • 0

I have xml file like this

<?xml version="1.0" encoding="UTF-8"?>
<specification xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"          
xsi:noNamespaceSchemaLocation="file://Desktop/normal.xsd">
  <university>
    <refstr>bdvl_te_skrm_stc</refstr>
    <ref_complete_customer path="/work/bsr.xml"/>
    <Code>A0f11478</Code>
    <Area>sku</Area>
    <started>1987</started>
    <branch>
      <electronics>
        <students Nr="120" ece="ab">
          <student Name="svr" year="2010" rank="3"/>
          <student Name="bvr" year="2010" rank="1"/>
        </students>
      </electronics>
    </branch>
    <semister>
      <semister num="3"/>
      <extrainfo/>
    </semister>
    <address>
      <extrainfo> some data.
      </extrainfo>
    </address>
  </university>
</specification>

genarated xsd schema for this xml file is

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"      
  xmlns:wmh="http://www.wmhelp.com/2003/eGenerator" elementFormDefault="qualified">

<xs:element name="specification">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="university"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

<xs:element name="university">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="refstr"/>
      <xs:element ref="ref_complete_customer"/>
      <xs:element ref="Code"/>
      <xs:element ref="Area"/>
      <xs:element ref="started"/>
      <xs:element ref="branch"/>
      <xs:element ref="semister"/>
      <xs:element ref="address"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

<xs:element name="refstr" type="xs:string"/>

<xs:element name="ref_complete_customer">
  <xs:complexType>
    <xs:attribute name="path" type="xs:string" use="required"/>
  </xs:complexType>
</xs:element>

<xs:element name="Code" type="xs:string"/>

<xs:element name="Area" type="xs:string"/>

<xs:element name="started" type="xs:string"/>

<xs:element name="branch">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="electronics"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

<xs:element name="electronics">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="students"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

<xs:element name="students">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="student" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Nr" type="xs:string" use="required"/>
    <xs:attribute name="ece" type="xs:string" use="required"/>
  </xs:complexType>
</xs:element>

<xs:element name="student">
  <xs:complexType>
    <xs:attribute name="Name" type="xs:string" use="required"/>
    <xs:attribute name="year" type="xs:string" use="required"/>
    <xs:attribute name="rank" type="xs:string" use="required"/>
  </xs:complexType>
</xs:element>

<xs:element name="semister">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="semister"/>
      <xs:element ref="extrainfo"/>
    </xs:sequence>
    <xs:attribute name="num" type="xs:string"/>
  </xs:complexType>
</xs:element>

<xs:element name="extrainfo" type="xs:string"/>

<xs:element name="address">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="extrainfo"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

</xs:schema>

but when I validate this type of xml it gives error like this

“element university{} has invalid structure for schema definition. this error showing at “address element” in the university node.”

I am not able to rectify this error, can any one tell me how to modify this error.What should I change in the schema. when I validate schema it has no errors.

Thanks in advance.

  • 1 1 Answer
  • 1 View
  • 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-27T02:37:12+00:00Added an answer on May 27, 2026 at 2:37 am

    If I run your XML through validation with the provided XML Schema, I don’t see any problem with the address element. However, in your schema the semister element definition refers to itself. Since it doesn’t specify minimal occurrences, the default is gonna be 1. This effectively creates an infinitely recursive requirement. Consider changing your XML Schema like this…

    <xs:element name="semister">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="semister" minOccurs="0"/>
                <xs:element ref="extrainfo" minOccurs="0"/>
            </xs:sequence>
            <xs:attribute name="num" type="xs:string"/>
        </xs:complexType>
    </xs:element>
    

    Or whatever seems like an appropriate constraint that doesn’t force an infinite recursion.

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

Sidebar

Related Questions

I have an XML file looks like this: <?xml version=1.0 encoding=utf-8 ?> <PathMasks> <Mask
I have an eclipse's .classpath file that looks like this: <?xml version=1.0 encoding=UTF-8?> <classpath>
I have a xml file like this <?xml version=1.0 encoding=UTF-8?> <gallery > <gallerydata> <galleryname>
I have a XML file, like this: <?xml version=1.0 encoding=utf-8 ?> <ROOT> <NAME> ItemName
I have a XML file like this : <?xml version=1.0 encoding=UTF-8 standalone=no ?> <user>
I have an XML file formatted like this: <?xml version=1.0 encoding=utf-8?> <Snippets> <Snippet name=abc>
I have an XML File that looks like this: <?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
have an xml file like this. <?xml version =1.0 encoding =utf-8?> <menu> <menuNode title=Register
I have XML-file with settings like this <?xml version=1.0 encoding=utf-8 ?> <configuration> <configSections> <sectionGroup
I have an xml file which looks like this <?xml version=1.0 encoding=UTF-8 ?> <BulkDataExchangeRequests

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.