473,399 Members | 2,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Re: How to associate XML with XSD

Hi,

I also have a question when using VS 2008 to edit the xml file. In my
xml file, I used schemaLocation attribute to specify the xsd. If I put
the xsd in our internal sharepoint site such as:
xsi:schemaLocation="someNs http://sharepoint/Test.xsd"

VS2008 xml editor shows that "this schema referenced from this
location in your document contains errors". However if I copy the xsd
to the local folder, and use this:
xsi:schemaLocation="someNs C:\Test.xsd"

Then it works fine. Also the first method works in VS 2005. So is
there anything changed in the VS 2008 xml editor?

Thanks,
Heng-yi
On Apr 7, 10:03*pm, stch...@online.microsoft.com (Steven Cheng [MSFT])
wrote:
Hi Bob,

As for XML document/file and the XML schema(xsd) it rely on(conform to),
here are some of my understanding:

** From XML standard, we generally do not specify the location (url or file
path ) of the xml schema, we only add namespace attributes in XML document
so as to indicate what namespace those Nodes in XML document belong to. *

** For the location where to find the schema, it is normally the XML
Editor/Designer's task. Yes, there is "xsi:schemaLocation" attribute that
can help specify a schema via url/path location, however, *this is still
depend on whether the XML Editor or designer will use it. If the IDE won't
take care of this attribute(will try locating the schema from the specified
location and perform validation).

** For Visual Studio, it use several means to find the schemas to validate
the document or provide intellisense:

1) schema in *the Visual Studio's global cache location. e.g. the VS 2008
use the following path:

C:\Program Files\Microsoft Visual Studio 9.0\Xml\Schemas

2) You can also add schema in the property window when you editing a xml
file in VisualStudio xml editor

3) Visual studio xml editor will also look for "schemaLocation" you
specified in xml document for reference

You can also add your own schemas to global cache or customize it. The
following MSDN documenet has mentioned those features:

#Schema Cache *http://msdn2.microsoft.com/en-us/lib...21(VS.80).aspx

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msd...@microsoft.com.

==================================================
Get notification to my posts through email? Please refer tohttp://msdn.microsoft.com/subscriptions/managednewsgroups/default.asp...
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) athttp://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights..

--------------------


From: "Bob Altman" <r...@nospam.nospam>
References: <uVZqyNQmIHA.3...@TK2MSFTNGP02.phx.gbl>
Subject: Re: How to associate XML with XSD
Date: Mon, 7 Apr 2008 16:54:40 -0700
I think I found most of my answers myself. *(Actually, a coworker happened
to
wander by my padded cell and he enlightened me ;-) *I'd appreciate if
someone
who actually knows this stuff would comment on this posting to let me know
if
I've got this more or less correct. *Thanks!
1. Assuming that I have an XML file and its associated XSD file, what do
I put
into the XML file to tell Visual Studio to use the XSD file to wire up
intellisense?
My coworker showed me how to include a bunch of xmlns gibberish in the
top-level
element to specify the schema location:
<TopLevelElement
*xmlns="MyDefaultNamespace"
*xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
*xsi:schemaLocation="MyDefaultNamespace MySchemaFile.xsd" >
In the above example, "MyDefaultNamespace" is usually a string that looks
like a
web URL, but it can pretty much be any string that doesn't include
whitespace or
escaped characters.
2. Is there something else that I need to (or should) do to tell the VS
IDE
that my XML file has an associated XSD file?
The "properties" for the XML file includes a field that specifies the
related
XSD file. *I don't know what happens if this property conflicts with the
above
XML text.
The existence of this property solves another mystery -- how the IDE knows
about
the schema of app.config files even though the text of the app.config file
doesn't contain any obvious reference to a schema file.- Hide quoted text-

- Show quoted text -
Jun 27 '08 #1
0 3155

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: knutsample | last post by:
Hello! I'm trying to associate a file extension to my wxPython script so that all I have to do is double click on the file and my python script will load up with the path of that file. For...
6
by: Ashok | last post by:
hi, i want to know how to make a specific type of file open in an application i developed in python when the user clicks on the file.(in windows) for eg. a .txt file when clicked opens in notepad,...
0
by: Raj | last post by:
hi, I associate dataset with one xmldatadocument? how can I disassociate from xmldatadocument, so I can associate with another xmldatadocument. and, how can I remove xmldatadocument from...
2
by: John Baker | last post by:
Hi: I have used this group a number of times simply because while the manuals for Access may show the technology, but most are really weak on how to apply it in special situations and the...
2
by: Angel | last post by:
How do I associate a server side command button to a Javascript function that is in the Web Form HTML Code? Thanks
0
by: Dailan | last post by:
Hi, I create a tree view. Each node has link button associate with it, which includes add, edit, delete buttons. The way I did is for users who have very low capablity of using computer. Now I...
1
by: Brian Kitt | last post by:
Over the years, from time to time, I've added a website as a 'favorite', and noticed that an icon (other than the standard ie icon) would be associated with it. Unfortunatley I don't have any of...
4
by: BD | last post by:
Hi all. Running SQL2K SP4 on W2K3 Standard, SP4. I have just refreshed a database on one server with a backup from another. The database had existed previously on the target server, and I am...
0
by: maurice ling | last post by:
"The Python Papers" (http://pythonpapers.org), ISSN 1834-3147, is an online e-journal, covering articles on Python in the community, industry and academia. We were established in the second half...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.