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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:10:18+00:00 2026-05-30T13:10:18+00:00

I am trying to validate an XML document against an XML Schema . The

  • 0

I am trying to validate an XML document against an XML Schema .
The Error i get is Unknown Element ‘jobinfo’ which exists at the root of
the hierarchy. The element ‘jobinfo’ is there in the XML Schema . I am a newbie to this area. Can anyone help pls ?

Here is my XML

<?xml version="1.0" encoding="utf-8"?>
<saw:jobInfo xmlns:saw="com.analytics.web/report/v1.1">
   <saw:jobStats>...........</saw:jobStats>
   <saw:detailedInfo> .....</saw:detailedInfo>
   <saw:fileInfo>..........</saw:fileInfo>
</saw:jobInfo>

Here is my XSD

 <?xml version="1.0" encoding="utf-8" ?>
 <xs:schema targetNamespace="com.analytics.web/report/v1.1"  
   xmlns="com.analytics.web/report/v1.1" xmlns:saw="com.analytics.web/report/v1.1" 
   xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" 
   attributeFormDefault="unqualified">

 <xs:element name="jobInfo" type="jobInfo"/>
   <xs:complexType name="jobInfo">
      <xs:sequence>
         <xs:element name="jobStats" type="jobStats" minOccurs="1" maxOccurs="1"/>
         <xs:element name="detailedInfo"  type="detailedInfo" minOccurs="0" maxOccurs="1"/>
         <xs:element name="fileInfo"  type="fileInfo" minOccurs="0"/>
      </xs:sequence>
   </xs:complexType>

    < other 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-30T13:10:19+00:00Added an answer on May 30, 2026 at 1:10 pm

    The problem with your element type jobStats, detailedInfo and fileInfo.

    Since these types are not defined.

    I have modified XSD to this way:-

    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema targetNamespace="com.analytics.web/report/v1.1" xmlns="com.analytics.web/report/v1.1" xmlns:saw="com.analytics.web/report/v1.1" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
        <xs:element name="jobInfo" type="jobInfo"/>
        <xs:complexType name="jobInfo">
            <xs:sequence>
                <xs:element name="jobStats" type="xs:string" minOccurs="1" maxOccurs="1"/>
                <xs:element name="detailedInfo" type="xs:string" minOccurs="0" maxOccurs="1"/>
                <xs:element name="fileInfo" type="xs:string" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:schema>
    

    OUTPUT Sample XML Format will be as follows:

    <?xml version="1.0" encoding="UTF-8"?>
    <saw:jobInfo xsi:schemaLocation="com.analytics.web/report/v1.1 Untitled1.xsd" xmlns:saw="com.analytics.web/report/v1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <saw:jobStats>String</saw:jobStats>
        <saw:detailedInfo>String</saw:detailedInfo>
        <saw:fileInfo>String</saw:fileInfo>
    </saw:jobInfo>
    

    You should specify xsi:schemaLocation on XML, while validate with XSD.

    xsi:schemaLocation="yourXSDfilepath"
    
    <saw:jobInfo xsi:schemaLocation="yourXSDfilepath"  xmlns:saw="com.analytics.web/report/v1.1">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to validate my XML document against my XML schema. This is my
I am trying to validate my xml against it's xsd and getting the error
The XML I'm trying to validate is as follows: <root> <element attribute=foo> <bar/> </element>
I am trying to create an XSD schema which will validate the following xml.
I am trying to validate an XML document against a dozen or so schemas
I am trying to validate an XML against schema using LibXML::Schema Validator CPAN module.
I'm trying to validate the following XML against a XSD schema using Ruby. It
I am trying to validate xml files against a very large industrial schema using
I'm trying to validate an XML file, but I get the following error: Can
I'm trying to validate an XML input against an XML Schema in SQL Server

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.