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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:06:30+00:00 2026-05-12T16:06:30+00:00

So I am beginning with XML and Schemas and I ran across this today

  • 0

So I am beginning with XML and Schemas and I ran across this today and I have not been able to figure it out.

I am getting and error that says,

Ln 5 Col 2 : Cannot find the
declaration of element ‘assignments’.

I believe I have declared the element, but perhaps I am missing something and have not.

This is my XML file:

<?xml version="1.0" encoding="UTF-8"?>
<assignments
    xmlns="http://www.w3.org/2001/XMLSchema-instance"
    SchemaLocation="A3.xsd"
>
    <assignment id="a1">
        <name>Schemas</name>
        <page>110</page>
    </assignment>

    <assignment id="a2">
        <name>Namespaces</name>
        <page>258</page>
        <files>names.xml</files>
        <files>names.dtd</files>
    </assignment>

    <assignment id="a3">
        <name>RELAX NG</name>
        <page>305</page>
        <files>account.xml</files>
        <files>customers.xml</files>
        <files>finance.xsd</files>
    </assignment>

</assignments>

This is my Schema file:

<?xml version="1.0" encoding="UTF-8"?>
<schema 
    xmlns="http://www.w3.org/2001/XMLSchema" 
    xmlns:target="http://www.levijackson.net/web340/ns" 
    targetNamespace="http://www.levijackson.net/web340/ns" elementFormDefault="qualified"
>
<element name="assignments" type="target:TypeAssignments"></element>

<complexType name="TypeAssignments">
    <sequence>
        <element name="assignment" type="target:assignmentInfo"></element>
    </sequence>
    <attribute name="id" type="string" use="required"/>
</complexType>

<complexType name="assignmentInfo">
    <sequence>
            <element name="name" type="string"></element>
            <element name="page" type="target:TypePage"></element>
            <element name="file" type="target:TypeFile" minOccurs="0" maxOccurs="unbounded"></element>
    </sequence>
</complexType>

<simpleType name="TypePage">
    <restriction base="integer">
        <minInclusive value="50" />
        <maxInclusive value="498" />
    </restriction>
</simpleType>

<simpleType name="TypeFile">
    <restriction base="string">
        <enumeration value=".xml" />
        <enumeration value=".dtd" />
        <enumeration value=".xsd" />
    </restriction>
</simpleType>

</schema>

As I am still learning, feel free to point out any other mistakes I may have made not related to the problem.

Thanks
Levi

  • 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-12T16:06:30+00:00Added an answer on May 12, 2026 at 4:06 pm

    The solution to this problem was that I was not declaring my main element ‘assignments’ as a complex element, I actually wasn’t declaring it as anything at all.

    So by taking this line from my schema file:

    <element name="assignment" type="target:assignmentInfo" minOccurs="0" maxOccurs="unbounded"></element>
    

    and changing it into this:

    <element name="assignments">
        <complexType>
            <sequence>
                <element name="assignment" type="target:assignmentInfo" minOccurs="0" maxOccurs="unbounded"></element>
            </sequence>
        </complexType>
    </element>
    

    The element was properly defined, thanks for the help everyone.

    Levi

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

Sidebar

Related Questions

I'm OK with the java for this beginning app I'm attempting. But the XML
I have the following layout <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=match_parent android:layout_height=match_parent android:orientation=horizontal android:background=#f00
I'm practising grid view from the book, Beginning android 2, I typed this xml
I am really new to XMl and have been tasked with extracting some values
I am beginning with Mule flows and have seen the I have seen this
I have been following a book on Android Beginning Android Application. I have been
I don't understand why I keep getting this error message: Multiple annotations found at
I'm doing a c# course at university, and now I'm beginning linQ to xml,
Since beginning to use VB.NET some years ago I have become slowly familiar with
I was beginning to write a bubble sort for this when I thought maybe

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.