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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:02:42+00:00 2026-06-10T17:02:42+00:00

I try to validate this (XSD : http://www.imsglobal.org/xsd/imsrdceo_rootv1p0.xsd ) : <?xml version=1.0 encoding=utf-8?> <rdceo

  • 0

I try to validate this (XSD : http://www.imsglobal.org/xsd/imsrdceo_rootv1p0.xsd) :

<?xml version="1.0" encoding="utf-8"?>
<rdceo xmlns="http://www.imsglobal.org/xsd/imsrdceo_rootv1p0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsrdceo_rootv1p0 http://www.imsglobal.org/xsd/imsrdceo_rootv1p0.xsd http://www.w3.org/XML/1998/namespace http://www.w3.org/2001/xml.xsd">
    <identifier>5040d336776eb</identifier>
    <title>
        <langstring xml:lang="en">titre</langstring>
    </title>
</rdceo>

But it says (on various sites and with my PHP code):

The attribute ‘xml:lang’ is not allowed

Here is my PHP code.

<?php

class RDCEOObjectiveBuilder {

    public  $id,
            $title,
            $description;

    public function build() {
        $dom = new DOMDocument('1.0', 'utf-8');

        $root = $dom->createElementNS(
            'http://www.imsglobal.org/xsd/imsrdceo_rootv1p0',
            'rdceo'
        );
        $root->setAttributeNS(
            'http://www.w3.org/2000/xmlns/' ,
            'xmlns:xsi',
            'http://www.w3.org/2001/XMLSchema-instance'
        );
        $root->setAttributeNS(
            'http://www.w3.org/2001/XMLSchema-instance',
            'xsi:schemaLocation',
            'http://www.imsglobal.org/xsd/imsrdceo_rootv1p0 http://www.imsglobal.org/xsd/imsrdceo_rootv1p0.xsd http://www.w3.org/XML/1998/namespace http://www.w3.org/2001/xml.xsd'
        );

        $id = $dom->createElementNS('http://www.imsglobal.org/xsd/imsrdceo_rootv1p0', 'identifier', $this->id);

        $title = $dom->createElementNS('http://www.imsglobal.org/xsd/imsrdceo_rootv1p0', 'title');
        $title_lang = $dom->createElementNS('http://www.imsglobal.org/xsd/imsrdceo_rootv1p0', 'langstring', $this->title);
        $title_lang->appendChild(new DOMAttr('xml:lang', 'en'));
        $title->appendChild($title_lang);

        $root->appendChild($id);
        $root->appendChild($title);
        $dom->appendChild($root);

        $dom->schemaValidate('imsrdceo_rootv1p0.xsd');
        $dom->formatOutput = true;
        return $dom->saveXML();
    }
}

$test = new RDCEOObjectiveBuilder();
$test->id = uniqid();
$test->title = 'titre';
echo $test->build();
?>

I don’t understand why xml:lang is not allowed… In every examples on http://www.imsglobal.org/competencies/ (the ones who created the xsd), they uses xml:lang

Example : http://www.imsglobal.org/competencies/Examples/MadeUp_Examplev1.xml

Can you tell me why ?
Thanks a lot !

  • 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-06-10T17:02:44+00:00Added an answer on June 10, 2026 at 5:02 pm

    The key thing here is the use of the xs:anyAttribute on the langstring element, it’s processing clause which is strict, and how xml:lang is supposed to work.

    strict means the XML processor must obtain the schema for the required namespaces and validate any attribute from those namespaces.

    The thing, any decent XML Schema processor is supposed to have built in support for what I call fundamental schemas; xml.xsd, which describes xml:lang, is just one of them.

    In my case, using QTAssistant, your XML validates just fine.

    I can tell you that it would’ve helped other processors if they (the schema authors) would’ve included an xsd:import to the http://www.w3.org/XML/1998/namespace, even without a schema location, and maybe even explicitly ref the xml:land attribute for content which is subject to i18n.

    But they didn’t… What you can do now is to use another XSD you write that imports both yours and the xml.xsd and you should be fine. As a not of caution, don’t import on the http://www.w3.org/2001/03/xml.xsd schema location, since that link is throttled and you’ll get timeouts. Have a local copy and then to that. Something like this:

    <?xml version="1.0" encoding="utf-8" ?>
    <!--XML Schema generated by QTAssistant/XML Schema Refactoring (XSR) Module (http://www.paschidev.com)-->
    <xsd:schema targetNamespace="http://tempuri.org/XMLSchema.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/XMLSchema.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:import schemaLocation="..." namespace="http://www.imsglobal.org/xsd/imsrdceo_rootv1p0"/>
        <xsd:import schemaLocation="..." namespace="http://www.w3.org/XML/1998/namespace"/>
    </xsd:schema>
    

    QTAssistant diagram for rdceo

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

Sidebar

Related Questions

I have this code to validate an XML file against an XSD file: $file
I have an xml document: <?xml version=1.0 encoding=utf-8?> <Root> <Child name=MyType compareMode=EQ></Child> </Root> And
I am currently using my XSD to Validate my xml. This part works fine
I am trying to validate some XML via lxml and an xsd (ogckml22.xsd). This
I'm using this to (try) to validate a 'strong' password in ColdFusion 7. if
We are getting following error when we try to validate our app. This bundle
I'm trying to validate my XML files from given XSD file with the following
I have an xsd. When I try to validate it in BizTalk it gives
I try to validate my xhtml and i have a little problem with this:
I have a command line program to validate an XML against an XSD file.

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.