rookie question - setting a path to a schema

Discussion in 'XML' started by Ian, Jan 21, 2005.

  1. Ian

    Ian Guest

    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
     
    Ian, Jan 21, 2005
    #1
    1. Advertising

  2. /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
     
    Stanimir Stamenkov, Jan 21, 2005
    #2
    1. Advertising

  3. Ian

    Guest

    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
     
    , Jan 21, 2005
    #3
  4. //:

    > 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
     
    Stanimir Stamenkov, Jan 21, 2005
    #4
  5. Ian

    Ian Rutgers Guest

    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!
     
    Ian Rutgers, Jan 22, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Big E

    Rookie Question

    Big E, Jun 17, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    369
    avnrao
    Jun 17, 2004
  2. Greg Smith

    Rookie question

    Greg Smith, Oct 7, 2005, in forum: Java
    Replies:
    4
    Views:
    369
    Monique Y. Mudama
    Oct 8, 2005
  3. Markus
    Replies:
    1
    Views:
    1,672
    Markus
    Nov 23, 2005
  4. Prawdziwa Blondynka
    Replies:
    0
    Views:
    539
    Prawdziwa Blondynka
    Mar 7, 2005
  5. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,333
    Stanimir Stamenkov
    Apr 25, 2005
Loading...

Share This Page