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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:56:46+00:00 2026-05-25T16:56:46+00:00

The XSD: <?xml version=1.0 encoding=utf-8 ?> <xs:schema xmlns:DataBodyTemperature=Docobo.DataBodyTemperature attributeFormDefault=qualified elementFormDefault=qualified xmlns:xs=http://www.w3.org/2001/XMLSchema> <xs:complexType name=tDataBodyTemperature> <xs:sequence>

  • 0

The XSD:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:DataBodyTemperature="Docobo.DataBodyTemperature" attributeFormDefault="qualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="tDataBodyTemperature">
    <xs:sequence>
      <xs:element name="Answer" type="xs:double" />
      <xs:element minOccurs="0" maxOccurs="1" name="AmbientTemperature" type="xs:double" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="tDataItem">
      <xs:choice>
        <xs:element name="DataBodyTemperature" type="tDataBodyTemperature" />
      </xs:choice>
  </xs:complexType>
  <xs:element name="DataItem">
    <xs:complexType>
      <xs:complexContent mixed="false">
        <xs:extension base="tDataItem">
          <xs:attribute fixed="1" name="SchemaVersion" type="xs:integer" />
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
</xs:schema>

The XML:

<DataItem>
  <DataBodyTemperature xmlns:DataBodyTemperature="Docobo.DataBodyTemperature">
    <DataBodyTemperature:Answer>37.8</DataBodyTemperature:Answer>
    <DataBodyTemperature:AmbientTemperature>28.5</DataBodyTemperature:AmbientTemperature>
  </DataBodyTemperature >
</DataItem>

I am getting a validation error:
Xml failed schema validation: The element ‘DataBodyTemperature’ has invalid child element ‘Answer’ in namespace ‘Docobo.DataBodyTemperature’. List of possible elements expected: ‘Answer’

  • 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-25T16:56:47+00:00Added an answer on May 25, 2026 at 4:56 pm

    Your problem is that your schema doesn’t specify a target namespace – consequently all types are associated with the null namespace.

    Your error is caused because the schema specifies that the DataBodyTemperature element (which is in the null namespace) should contain only Answer and AmbientTemperature elements (both of which are declared in the null namespace), however in your document these elements are in fact in the Docobo.DataBodyTemperature namespace, essentially making them completely different elements.

    A sample of xml conforming to your given schema would be:

    <DataItem SchemaVersion="1">
      <DataBodyTemperature>
        <Answer>1</Answer>
        <AmbientTemperature>1</AmbientTemperature>
      </DataBodyTemperature>
    </DataItem>
    

    Notice that there is no namespace declaration – all elements are in the default namespace. I suspect what you really want however is to modify your xsd so that it specifies a target namespace.

    <xs:schema targetNamespace="Docobo.DataBodyTemperature" xmlns:dbt="Docobo.DataBodyTemperature" attributeFormDefault="qualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:complexType name="tDataBodyTemperature">
        <xs:sequence>
          <xs:element name="Answer" type="xs:double" />
          <xs:element minOccurs="0" maxOccurs="1" name="AmbientTemperature" type="xs:double" />
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="tDataItem">
        <xs:choice>
          <xs:element name="DataBodyTemperature" type="dbt:tDataBodyTemperature" />
        </xs:choice>
      </xs:complexType>
      <xs:element name="DataItem">
        <xs:complexType>
          <xs:complexContent mixed="false">
            <xs:extension base="dbt:tDataItem">
              <xs:attribute fixed="1" name="SchemaVersion" type="xs:integer" />
            </xs:extension>
          </xs:complexContent>
        </xs:complexType>
      </xs:element>
    </xs:schema>
    

    Note that you now also need to qualify the tDataItem and tDataBodyTemperature types as they are no longer declared in the null namespace.

    Also note that in your sameple XML the DataItem and DataBodyTemperature elements aren’t in the “Docobo.DataBodyTemperature” namespace and so now wouldn’t be validated against the above schema.

    You may also find it helpeful to get a sample xml document for a schema – you can do this in Visual Studio 2008 or later using the XML Schema Explorer, see How to generate sample XML documents from their DTD or XSD?.

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

Sidebar

Related Questions

I have the following xml schema: <?xml version=1.0 encoding=utf-8?> <xsd:schema xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xs=http://www.w3.org/2001/XMLSchema xmlns:xsd=http://www.w3.org/2001/XMLSchema attributeFormDefault=unqualified
I have an xsd document that starts with: <?xml version=1.0 encoding=UTF-8?> <xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema> <xs:import
Let's say I define the following XML schema, author.xsd: <?xml version=1.0 encoding=UTF-8?> <xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema>
Here is my pages.xsd <?xml version=1.0 encoding=UTF-8 ?> <xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema xmlns:mac=http://www.tvworks.com/tva/xml/ns/max/data-types elementFormDefault=qualified attributeFormDefault=unqualified> <xs:import
I have following XML schema: <?xml version=1.0 encoding=UTF-8 standalone=no?> <xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema> <xs:element name=content type=contentType/>
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>
<?xml version=1.0 encoding=UTF-8?> <definitions xmlns:def=http://www.w3.org/2002/ws/databinding/examples/6/09/ xmlns:xs=http://www.w3.org/2001/XMLSchema xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance> <types> <xs:schema xmlns=http://www.w3.org/2002/ws/databinding/examples/6/09/ targetNamespace=http://www.w3.org/2002/ws/databinding/examples/6/09/ elementFormDefault=qualified> <xs:include xmlns:wsdl11=http://schemas.xmlsoap.org/wsdl/
I'm using this wsdl-file to describe my webservice: <?xml version=1.0 encoding=UTF-8 ?> <wsdl:definitions targetNamespace=http://www.myapproach.de/knowledgebase
My xml <?xml version=1.0 encoding=ISO-8859-1?> <credits> </credits> My schema <?xml version=1.0 encoding=UTF-8 ?> <xsd:schema
I've a SOAP response in a var $soap_response like this: <SOAP-ENV:Envelope SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/ xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema

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.