XmlException: "Cannot resolve 'character.xsd'

30 views
Skip to first unread message

Jason Jones

unread,
Apr 24, 2015, 5:05:00 PM4/24/15
to authoring-to...@googlegroups.com

Hi all,

New to the forums. Been working on a starter project to familiarize myself with ATF. Like what I'm learning so far!

I've been trying to create my own tool, based off the new SimpleDomEditorWpf sample project. I've gone through and updated the schema with my own data type, very simple for now:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema
   
targetNamespace="character_1_0"
   
elementFormDefault="qualified"
   
xmlns="character_1_0"
   
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
   
<xs:complexType name="characterType" >
       
<xs:attribute name="name" type="xs:string" />
       
<xs:attribute name="gender" type="xs:string" />
       
<xs:attribute name="race" type="xs:string" />
       
<xs:attribute name="class" type="xs:string" />
       
<xs:attribute name="level" type="xs:integer" />

   
</xs:complexType>

   
<!--Declare the root element of the document-->
   
<xs:element name="character" type="characterType"/>

</xs:schema>

And of course I've gone through and stubbed out some of the objects to match (Context, Document, View, Editor).  Everything builds, but I get a runtime error (see subject line), in the SchemaLoader constructor
public SchemaLoader()
{
   
// set resolver to locate embedded .xsd file
   
SchemaResolver = new ResourceStreamResolver(Assembly.GetExecutingAssembly(), "TableTop/schemas");
   
Load("character.xsd");
}

Error is on the Load call. I updated the string passed to the resolver constructor, as I assumed it needed to reflect the namespace/project name. But I'm not exactly sure if that's right.
I'm not terribly familiar with using XSDs, so this might not be specific to ATF.

Is there something I've overlooked?
Thanks!

JJ

Ron AtSony

unread,
Apr 24, 2015, 5:54:07 PM4/24/15
to Jason Jones, authoring-to...@googlegroups.com
Hi Jason! I'm glad you're coming up to speed with ATF.

I can reproduce your problem. It looks like your character.xsd file can't be found because it's not an embedded resource. In your project settings, make sure that the Build Action for character.xsd is set to Embedded Resource. (In Visual Studio's Solution Explorer, if you select character.xsd, you can see the Build Action property in the Properties editor.)

That should get you past this problem! Please let me know if that was it.

--Ron


--
You received this message because you are subscribed to the Google Groups "Authoring Tools Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to authoring-tools-fr...@googlegroups.com.
Visit this group at http://groups.google.com/group/authoring-tools-framework.
For more options, visit https://groups.google.com/d/optout.

TwainJ

unread,
Apr 24, 2015, 8:20:17 PM4/24/15
to authoring-to...@googlegroups.com, ja...@2jdevelopment.com
Thanks Ron! That was exactly the problem. I'm back in the game.

Cheers,

JJ

Reply all
Reply to author
Forward
0 new messages