Validating XML against schema

A

adelormex

Hi all,

I guess this topic has been beated to death but around I can still
only find school-book examples.

Even some of the books on .NET 2.0 still use the deprecated method,
which I wouldn't mind, as long as it worked.

Well here is a real-world scenario: I want to validate a resume[1]
document against it's official schema[2]

Here's the code I'm using http://dpaste.com/hold/32393/ which returns:
The 'http://www.w3.org/XML/1998/namespace:lang' attribute is not
declared.

I tried also fixing the xml manually with no success and made an
attempt with other languages and toolkits with the same outcome.

Are the HR-XML samples/schemas plain broken or what am I missing?

Thanks,
A.D.
 
M

Martin Honnen

A

adelormex


That schema imports another one you can find here:
<URL:http://www.w3.org/2001/xml.xsd>

There is also a validation flag AllowXmlAttributes you can set to allow
xml:lang and other attributes like xml:space, see
<URL:http://msdn2.microsoft.com/en-us/library/system.xml.xmlreadersettings....>
<URL:http://msdn2.microsoft.com/en-us/library/system.xml.schema.xmlschemav....>

Hi Martin,

Good tips, looks like it works now.

http://dpaste.com/hold/32453/

Thanks,
A. D.
 
C

Chuck - HR-XML

It is true - the HR-XML "Standalone" schemas are not truly standalone.
They've been flattened so all necessary types from included schemas
within the hr-xml namespace are within one file. But you still need
any imported files. The necessary import files are available within
the HR-XML distribution package within the Standalone folder.

Chuck Allen
HR-XML Consortium, Inc.
http://www.hr-xml.org/blog
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top