Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I know this forum is not about XML specific in details. But...maybe those with lots of experince in working with XML files have come across this and could shed some lights on me.

 

We have received schema files from the third party and I am trying to read the schema into the dataset using the "XmlDataDocument" object. However, out of the (3) schema files that we are receiving, (1) is the main file that references the other (2) schema files as "includes". For some reason, I am getting "undeclared reference" during the read on=f the main schema file when ever it gets to the point where it is referring to something in the "include" files. Is there anything specific that I need to do with the Include files?

 

HELP!

  • *Experts*
Posted

I've only done this when including files - I've never tried an "include" if it's memory based (reading an XML string).

 

In my XSL file I have:

<xs:include schemaLocation="../../../schema/customtypes.xsl"></xs:include>

 

In this case, the customtypes.xsl file lives "up" 3 folders and then "down" in the "schema" folder. It works fine for me. I would guess that if the customtypes.xsl file were in the same folder just using the following would work:

<xs:include schemaLocation="customtypes.xsl"></xs:include>

 

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted
Do you mean to say "XSD" File instead of "XSL"? Do I need to do anything else withe TargetNamesapce and all that attributes that are already in the schema that they had sent?
  • *Experts*
Posted

For my XSD's, I use the following schema line, more or less (note the xmlns is just an empty string). The targetNamespace is removed as it generally causes trouble (can't remember why - we started removing them almost 2 years ago and it's been our "standard")

 

<xs:schema id="name" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

 

-Ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

Thanks. I tried all the leads that you'd offered. (even modifying their schema line) Still getting the same error. Uggghhhh...

If I take out their "Includes" reference and just cut and paste all the info from their INCLUDE files into the Main XSD, it works. So it has to be something along the line of referencing the include files.

Thanks anyway. But if you find or recall anything else that I should try, I'd appreciate it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...