rookie question - setting a path to a schema

I

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
 
S

Stanimir Stamenkov

/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.
 
I

ian.rutgers

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
 
S

Stanimir Stamenkov

/[email protected]/:
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:
 
I

Ian Rutgers

I understand what you are saying now. Appreciate you taking the time to
spell it out for me!

Thank you,

Ian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,838
Latest member
KandiceChi

Latest Threads

Top