• 0

[XML] XML file and schema (XSD) unable to validate?


Question

Basically, I am trying to use a XML validator (this one) to validate my XML file and my schema. For some reason though, it is throwing up errors and I have no idea why. So I was wondering if my wonderful fellow Neowinians could help me out :).

The XML file...

<?xml version="1.0" encoding="iso-8859-1"?>

<lotsoftestdata
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNameSpaceSchemaLocation="mySchema.xsd">t;tests>
	<test>
		<myTest1>Test data 1</myTest1>
		<myTest2>Test data 2</myTest2>
		<myTest3>Test data 3</myTest3>
		<myTest4>Test data 4</myTest4>
		<myTest5>Test data 5</myTest5>
		<myTest6>Test data 6</myTest6>
	</test> 

	<test>
		<myTest1>Test data 7</myTest1>
		<myTest2>Test data 8</myTest2>
		<myTest3>Test data 9</myTest3>
		<myTest4>Test data 10</myTest4>
		<myTest5>Test data 11</myTest5>
		<myTest6>Test data 12</myTest6>
	</test> 

	<test>
		<myTest1>Test data 13</myTest1>
		<myTest2>Test data 14</myTest2>
		<myTest3>Test data 15</myTest3>
		<myTest4>Test data 16</myTest4>
		<myTest5>Test data 17</myTest5>
		<myTest6>Test data 18</myTest6>
	</test>
</tests>

</lotsoftestdata>

The XML schema (XSD)...

<?xml version="1.0" encoding="utf-16"?>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">lt;xsd:element name="lotsoftestdata">
	<xsd:complexType>
	  <xsd:sequence>
		<xsd:element name="tests">
		  <xsd:complexType>
			<xsd:sequence>
			  <xsd:element maxOccurs="unbounded" name="test">
				<xsd:complexType>
				  <xsd:sequence>
					<xsd:element name="myTest1" type="xsd:string" />
					<xsd:element name="myTest2" type="xsd:string" />
					<xsd:element name="myTest3" type="xsd:string" />
					<xsd:element name="myTest4" type="xsd:string" />
					<xsd:element name="myTest5" type="xsd:string" />
					<xsd:element name="myTest6" type="xsd:string" />
				  </xsd:sequence>
				</xsd:complexType>
			  </xsd:element>
			</xsd:sequence>
		  </xsd:complexType>
		</xsd:element>
	  </xsd:sequence>
	  <xsd:attribute name="xsi:noNameSpaceSchemaLocation" type="xsd:string" />
	</xsd:complexType>
  </xsd:element>
</xsd:schema>

Some of the validation errors I am getting from the XMLme (here) validator I am using are...

Schema Error: System.Xml.Schema.XmlSchemaException: Invalid 'name' attribute value 'xsi:noNameSpaceSchemaLocation': 'The ':' character, hexadecimal value 0x3A, at position 3 within the name, cannot be included in a name.'. at System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e, XmlSeverityType severity) at System.Xml.Schema.SchemaCollectionPreprocessor.ValidateNameAttribute(XmlSchemaObject xso) at System.Xml.Schema.SchemaCollectionPreprocessor.PreprocessLocalAttribute(XmlSchemaAttribute attribute) at System.Xml.Schema.SchemaCollectionPreprocessor.PreprocessAttributes(XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaObject parent) at System.Xml.Schema.SchemaCollectionPreprocessor.PreprocessComplexType(XmlSchemaComplexType complexType, Boolean local) at System.Xml.Schema.SchemaCollectionPreprocessor.PreprocessElementContent(XmlSchemaElement element) at System.Xml.Schema.SchemaCollectionPreprocessor.PreprocessElement(XmlSchemaElement element) at System.Xml.Schema.SchemaCollectionPreprocessor.Preprocess(XmlSchema schema, String targetNamespace, Compositor compositor) at System.Xml.Schema.SchemaCollectionPreprocessor.Execute(XmlSchema schema, String targetNamespace, Boolean loadExternals, XmlSchemaCollection xsc) at System.Xml.Schema.XmlSchema.CompileSchema(XmlSchemaCollection xsc, XmlResolver resolver, SchemaInfo schemaInfo, String ns, ValidationEventHandler validationEventHandler, XmlNameTable nameTable, Boolean CompileContentModel) at System.Xml.Schema.XmlSchemaCollection.Add(String ns, SchemaInfo schemaInfo, XmlSchema schema, Boolean compile, XmlResolver resolver) at System.Xml.Schema.XmlSchemaCollection.Add(String ns, XmlReader reader, XmlResolver resolver) at System.Xml.Schema.XmlSchemaCollection.Add(String ns, XmlReader reader) at Validator.Button1_Click(Object sender, EventArgs e)

Any help will be greatly appreciated.

Cheers!

3 answers to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • - What's your salary? Is it more than $100k a year? - Nah, it's $100 mil a year.
    • Compared to my ear buds which are the size of a matchbox, cover a much broader frequency range, and work everywhere without setup? Yeah, still not buying this as a replacement.
    • Meta's Superintelligence team staffed by 50% Chinese talent, 40% ex-OpenAI by Hamid Ganji Mark Zuckerberg's latest big bet at Meta involves building a team of the best AI superstars in the market to lead the so-called Superintelligence Labs. The goal of this team is to develop AI models that will ultimately lead to Artificial General Intelligence (AGI). AGI refers to an AI model with capabilities comparable to, or even beyond, those of the human brain. Achieving human-level cognitive abilities with an AI model requires substantial investments, as well as hiring the best talent to build such a system. That's why Meta is throwing hundreds of millions of dollars at AI researchers from OpenAI, Apple, and other companies to recruit them for its Superintelligence team. A user on X has now shared a spreadsheet that provides us with some unique insights into Meta's Superintelligence team and the origins of its 44 employees. The leaker claims this information comes from an anonymous Meta employee. The listing claims that 50 percent of the staff at the Superintelligence team are from China, which demonstrates the significant role of Chinese or Chinese-origin researchers in Met's AI efforts. Additionally, 75 percent of these staff hold PhDs, and 70 percent of them work as researchers. Interestingly, 40 percent of the staff are ex-OpenAI employees whom Mark Zuckerberg poached from the maker of ChatGPT. Additionally, 20 percent of Meta's Superintelligence team members come from Google DeepMind, and another 15 percent come from Scale AI, a startup that Meta recently acquired in a $15 billion deal. Another interesting point is that 75 percent of the Superintelligence team are first-generation immigrants. The leaker claims that each of these employees is now earning between $10 million and $100 million per year, although Meta still needs to confirm these substantial figures. However, it has already been reported that Meta is offering up to $100 million in signup bonuses to poach the best AI talent from OpenAI and other rivals. The revelation that half of Meta's Superintelligence team consists of Chinese nationals could trigger concerns within the Trump administration and Congress.
    • From a quick Google it seems 6GHz is optional on 802.11be. Ubiquiti has one, Unifi U7 Lite.
    • Disagreed, I feel it’s going somewhere and his role served a purpose - and moreover with maybe what 10 mins of screen time - he had a bit of character development also.
  • Recent Achievements

    • First Post
      nobody9 earned a badge
      First Post
    • One Month Later
      Ricky Chan earned a badge
      One Month Later
    • First Post
      leoniDAM earned a badge
      First Post
    • Reacting Well
      Ian_ earned a badge
      Reacting Well
    • One Month Later
      Ian_ earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      505
    2. 2
      ATLien_0
      207
    3. 3
      Michael Scrip
      206
    4. 4
      Xenon
      140
    5. 5
      +FloatingFatMan
      115
  • Tell a friend

    Love Neowin? Tell a friend!