The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,224 other subscribers

Archive for September 1st, 2013

XSD/XML Schemas: resolving `Namespace ” is not available to be referenced in this schema` (via: StackOverflow)

Posted by jpluimers on 2013/09/01

While working on my Delphi: First try on an XSD for .groupproj files, I bumped into an error `Namespace ” is not available to be referenced in this schema`.

I added a targetNamespace attribute to the GroupProj.xsd so the .grouproj files would use the right namespace.

That resulted into two funny errors:

  1. Namespace ” is not available to be referenced in this schema.
    Visual Studio (which I normally use for editing XSD) would only throw this error on these elements:
    <xsd:element ...>
    So it would not throw them on nodes using the empty namespace.
    That was really confusing!
  2. When validating .grouproj files using this GroupProj.xsd, I would get this error for all .groupproj files:
    System.Xml.Schema.XmlSchemaValidationException: Type ‘<type>’ is not declared. (in this case for ‘<type>’  ‘ProjectType’).
    That was odd too: the ‘ProjectType’ was indeed declared, and should be valid.

I could hardly find any information about the latter error, but the former gave a few useful hits.

Thanks User weston – Stack Overflow. for answering this: it made me smack to my head (like usual, a case of EBCAK). Read the rest of this entry »

Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development, XML/XSD, XSD | Tagged: , , | 2 Comments »

 
%d bloggers like this: