Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > rookie question - setting a path to a schema

Reply
Thread Tools

rookie question - setting a path to a schema

 
 
Ian
Guest
Posts: n/a
 
      01-21-2005
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
 
Reply With Quote
 
 
 
 
Stanimir Stamenkov
Guest
Posts: n/a
 
      01-21-2005
/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
 
Reply With Quote
 
 
 
 
ian.rutgers@gmail.com
Guest
Posts: n/a
 
      01-21-2005
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


 
Reply With Quote
 
Stanimir Stamenkov
Guest
Posts: n/a
 
      01-21-2005
/(E-Mail Removed)/:

> 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 xmlnss="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn-ian-test:auto">

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

</xs:schema>

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

<?xml version="1.0" ?>
<example xmlns="urn-ian-test:auto"
xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn-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
 
Reply With Quote
 
Ian Rutgers
Guest
Posts: n/a
 
      01-22-2005
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!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
question about 290,291,270,228 from a rookie duke MCSE 1 02-26-2006 06:36 AM
Rookie question Greg Smith Java 4 10-08-2005 04:54 PM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM
Setting a schema path that contains whitespaces (Xerces) Prawdziwa Blondynka XML 0 03-07-2005 06:56 PM
Rookie Question Big E ASP .Net 2 06-17-2004 05:27 AM



Advertisments