Schema Question from a newbie...

Discussion in 'XML' started by Ralph Krausse, Sep 1, 2004.

  1. Ok so I am learning xml and schema's. argh.....

    In this schema, this line...
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    say that the elements and data types declared with the xs prefix come
    from http://www.w3.org/2001/XMLSchema. But that is url and I can go to
    it. I see nothing that says anything about elements and data types. I
    know the w3.org creates the standards for this type of stuff but
    where?

    In this line:
    targetNamespace="urn:xmlns:25hoursaday-com:my-bookshelf"
    defines the targetNamespage as urn:xmlns:25hoursaday-com:my-bookshelf.
    What does 'urn:xmlns:25hoursaday-com:my-bookshelf' mean? Is this just
    arbitrary text?
    Could it be anything?

    In this line"
    xmlns:bk="urn:xmlns:25hoursaday-com:my-bookshelf"
    say that the elements and data types declared with the bk prefix come
    from urn:xmlns:25hoursaday-com:my-bookshelf. What is
    'urn:xmlns:25hoursaday-com:my-bookshelf'. I know it was defined by
    targetNamespace but what does that reslove to?

    Where or what is 'urn:xmlns:25hoursaday-com:my-bookshelf'


    *****************************************************************

    <?xml version="1.0" encoding="UTF-8" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="urn:xmlns:25hoursaday-com:my-bookshelf"
    xmlns:bk="urn:xmlns:25hoursaday-com:my-bookshelf"
    elementFormDefault="qualified">
    <xs:element name="books">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="book" type="bk:bookType" maxOccurs="unbounded"
    />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:complexType name="bookType">
    <xs:sequence>
    <xs:element name="title" type="xs:string" />
    <xs:element name="author" type="xs:string" />
    <xs:element name="publication-date" type="xs:date" />
    </xs:sequence>
    <xs:attribute name="publisher" type="xs:string" />
    <xs:attribute name="on-loan" type="xs:string" />
    </xs:complexType>
    </xs:schema>

    *********************************************************************

    thanks

    Ralph Krausse
    www.consiliumsoft.com
    Use the START button? Then you need CSFastRunII...
    A new kind of application launcher integrated in the taskbar!
    ScreenShot - http://www.consiliumsoft.com/ScreenShot.jpg
    Ralph Krausse, Sep 1, 2004
    #1
    1. Advertising

  2. In article <>,
    Ralph Krausse <> wrote:

    % In this schema, this line...
    % xmlns:xs="http://www.w3.org/2001/XMLSchema"
    % say that the elements and data types declared with the xs prefix come
    % from http://www.w3.org/2001/XMLSchema. But that is url and I can go to
    % it. I see nothing that says anything about elements and data types. I
    % know the w3.org creates the standards for this type of stuff but
    % where?

    First thing: the URI used in a namespace doesn't have to refer to
    a real-world resource. In some cases, people will put content there,
    but you shouldn't expect it.

    Second thing: this particular URI has a link to part 1 of the
    specification on it. A Google search is probably a better starting
    point, but if you want the definitive description, it's right there.

    % In this line:
    % targetNamespace="urn:xmlns:25hoursaday-com:my-bookshelf"
    % defines the targetNamespage as urn:xmlns:25hoursaday-com:my-bookshelf.
    % What does 'urn:xmlns:25hoursaday-com:my-bookshelf' mean? Is this just
    % arbitrary text?
    % Could it be anything?

    On a technical level, the name space URI is just a string with some
    syntax requirements. The point is to provide a globally unique name
    which sets that particular name space aside from all others. For this to
    work, you need some way of keeping other people from using the same name
    space as you. Internet addresses are convenient for this purpose, since
    the domain registry ensures different organisations will not have
    conflicting domain names, so if everybody uses addresses within their
    own registered domains, there will be no conflicts.

    Strictly speaking, I believe that URIs with the urn: protocol are also
    supposed to be registered with some organisation. People do what they
    like, though.



    --

    Patrick TJ McPhee
    East York Canada
    Patrick TJ McPhee, Sep 2, 2004
    #2
    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. Markus
    Replies:
    1
    Views:
    1,492
    Markus
    Nov 23, 2005
  2. Klaus Johannes Rusch

    Re: Convert DB2 schema to XML Schema

    Klaus Johannes Rusch, Aug 6, 2003, in forum: XML
    Replies:
    0
    Views:
    548
    Klaus Johannes Rusch
    Aug 6, 2003
  3. Brett Selleck

    Schema Metadata not a Metadata Schema

    Brett Selleck, Sep 4, 2003, in forum: XML
    Replies:
    1
    Views:
    397
    Andy Dingley
    Sep 4, 2003
  4. Fred Smith
    Replies:
    1
    Views:
    921
    Martin Honnen
    Feb 5, 2004
  5. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,165
    Stanimir Stamenkov
    Apr 25, 2005
Loading...

Share This Page