473,405 Members | 2,379 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,405 software developers and data experts.

rookie question - setting a path to a schema

Ian
I would like to set a path to a schema where both the xml file and the
schema are on my local hard drive (e.g. c:\XML\auto.xml and
c:\XML\auto.xsd)

Thank you,

Ian
Jul 20 '05 #1
4 3524
/Ian/:
I would like to set a path to a schema where both the xml file and the
schema are on my local hard drive (e.g. c:\XML\auto.xml and
c:\XML\auto.xsd)


"2.6.3 xsi:schemaLocation, xsi:noNamespaceSchemaLocation"
<http://www.w3.org/TR/xmlschema-1/#xsi_schemaLocation>

Examples:

"5.6 schemaLocation" <http://www.w3.org/TR/xmlschema-0/#schemaLocation>

Note, these provide only a hint to the processor. If you manipulate
the files programmatically, depending on the programming framework
you use, you should be able to control these with processor's
specific calls.

--
Stanimir
Jul 20 '05 #2
Hi Stanimir,

According to the specification:

A schema is not required to have a namespace (see Undeclared Target
Namespaces (§3.4)) and so there is a noNamespaceSchemaLocation
attribute which is used to provide hints for the locations of schema
documents that do not have target namespaces.

In this case the schema does have a namespace, but it is located on a
network or local hard drive. In testing, I have had some success with
http://localhost but that only works if all files are on my local hard
drive and not on the network .... any further thoughts?

Thanks,

Ian
Stanimir Stamenkov wrote:
/Ian/:
I would like to set a path to a schema where both the xml file and the schema are on my local hard drive (e.g. c:\XML\auto.xml and
c:\XML\auto.xsd)
"2.6.3 xsi:schemaLocation, xsi:noNamespaceSchemaLocation"
<http://www.w3.org/TR/xmlschema-1/#xsi_schemaLocation>

Examples:

"5.6 schemaLocation"

<http://www.w3.org/TR/xmlschema-0/#schemaLocation>
Note, these provide only a hint to the processor. If you manipulate
the files programmatically, depending on the programming framework
you use, you should be able to control these with processor's
specific calls.

--
Stanimir


Jul 20 '05 #3
/ia*********@gmail.com/:
A schema is not required to have a namespace (see Undeclared Target
Namespaces (§3.4)) and so there is a noNamespaceSchemaLocation
attribute which is used to provide hints for the locations of schema
documents that do not have target namespaces.

In this case the schema does have a namespace, but it is located on a
network or local hard drive. In testing, I have had some success with
http://localhost but that only works if all files are on my local hard
drive and not on the network .... any further thoughts?
The namespace URI is nothing more but uniquely identifying the
namespace - it doesn't designate the resource of the schema document.

Here:

-----"c:\XML\auto.xsd"

<?xml version="1.0" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:x-ian-test:auto">

<xs:element name="example" type="xs:string" />

</xs:schema>

-----"c:\XML\auto.xml"

<?xml version="1.0" ?>
<example xmlns="urn:x-ian-test:auto"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:x-ian-test:auto auto.xsd">

bla-bla

</example>
There:

<http://www.w3.org/TR/xmlschema-0/#UsingSchemaLocationInQuarterly>:
The schemaLocation attribute value consists of one or more pairs of
URI references, separated by white space. The first member of each
pair is a namespace name, and the second member of the pair is a
hint describing where to find an appropriate schema document for
that namespace.
<http://www.w3.org/TR/xmlschema-1/#schema-loc> (a bit down bellow):
3. On the other hand, in case a document author (human or not)
created a document with a particular schema in view, and warrants
that some or all of the document conforms to that schema, the
'schemaLocation' and 'noNamespaceSchemaLocation' attributes ... are
provided. The first records the author's warrant with pairs of URI
references (one for the _namespace name_, and one for a hint as to
the _location of a schema document_ defining names for that
namespace name).


--
Stanimir
Jul 20 '05 #4
I understand what you are saying now. Appreciate you taking the time to
spell it out for me!

Thank you,

Ian

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #5

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

Similar topics

11
by: Don Bruder | last post by:
Got a stumper here. I imagine that for someone experienced in C++, this is too pathetic for words. For a rookie, using this project as a sort of "midterm exam" in his self-taught "how to program in...
0
by: Prawdziwa Blondynka | last post by:
Hi, I would like to do the following with C++ and Xerces: set the schema path in an XML file to parse in this way: XMLCh* schemaLocation = XMLString::transcode(namespaceAndPath);...
7
by: Andrei Ivanov | last post by:
This happend again, but now, postgresql tells me where it happens: pg_dump: SQL command failed pg_dump: Error message from server: ERROR: did not find '}' at end of input node pg_dump: The...
2
by: LesleyW | last post by:
I'm using a public set of schemas for GML, avaiable at www.opengis.net/gml. They all include or import each other but live in a folder hierarchy, so the import statement includes...
1
by: Scott | last post by:
I am using the BETA DB2 Provider for .NET and have ran into the following issue. I would like to specify a library list and, for each unqualified table/schema name that I specify in my query, I...
1
by: phil campaigne | last post by:
On Mon, 1 Mar 2004, phil campaigne wrote: >> Nigel J. Andrews wrote: >> > > >>> >On Mon, 1 Mar 2004, Phil Campaigne wrote: >>> > >>> >
2
by: Mark | last post by:
Hi... I've been trying the .Validate() method on the XmlDocument to validate some xml against a schema, but one thing I noted was that unless the document explicitly declares the schema as a...
4
by: jrett | last post by:
I'm new to ASP.NET and fairly inexperienced with web development in general, but I've been a professional software dev for over 10 years, C++, Unix and windows, C# the past 4 years. I've been...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.