Results 1 to 5 of 5

Thread: XML: Where do I put the schema?[Moved]

  1. #1

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690

    XML: Where do I put the schema?[Moved]

    Fair warning - I'm new at this business.

    I have an .xsd and an .xml file, the top of the xml looks like this:
    Code:
    <?xml version='1.0' encoding='UTF-8'?>
    <SleuthNameInfo
    xmlns="http://sleuthsoftware.com/MasterNameLookup"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:SchemaLocation = "http://sleuthsoftware.com/MasterNameLookup SleuthNameInfo.xsd"
    xsi:noNamespaceSchemaLocation="SleuthNameInfo.xsd"
    ORI="NM1234567">
    When I test the validation with XmlSpy, both xml and xsd files are in the same directory and all works fine. Now I want to upload to my web site and validate with .NET. I get this exception message:
    Code:
    The 'http://sleuthsoftware.com/MasterNameLookup:SleuthNameInfo' element is not declared
    I'm assuming it's because the XmlValidatingReader cannot find the schema file. Is that right? If so, where do I need to put the .xsd?

    Thanks,
    Mike

    Edit: After reading/trying code, I believe this is more or a .NET issue, not really sure. So I asked a similar question here Apologies for a cross-post.

    The reason I think it's more a .NET thing is because I never set up my XmlValidatingReader correctly, which I'm trying to do now, just can't get it yet.
    Last edited by Mike Hildner; Dec 14th, 2004 at 08:34 PM. Reason: I think I asked a bad question, moving to a different forum id.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: XML: Where do I put the schema?[Moved]

    Another option is to give a complete location in the schema-location attribute.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690

    Re: XML: Where do I put the schema?[Moved]

    Quote Originally Posted by CornedBee
    Another option is to give a complete location in the schema-location attribute.
    ok, can you give me an example? Not sure exactly how I would do that. Thanks.

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: XML: Where do I put the schema?[Moved]

    xsi:SchemaLocation = "http://sleuthsoftware.com/MasterNameLookup http://sleuthsoftware.com/schemas/SleuthNameInfo.xsd"
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690

    Re: XML: Where do I put the schema?[Moved]

    That was easy, thanks Still doesn't resolve my error, though. I think I need to read up a little, as I don't understand really what schemaLocation and what not do. I think my problem's in there somewhere. I'll post if I figure it out. Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width