using in xml namespace defined in schema

Discussion in 'XML' started by Dominique, Jun 30, 2004.

  1. Dominique

    Dominique Guest

    I want to use a namespace in an XML file, that I have created in the
    schema for this xml file. do i have to redefine this namespace in the
    xml file? or is there a way to re-use the definition from the schema?

    here is the example I found on the net, that I am trying to validate,
    and it doesn't work...

    link:
    http://www.laltruiste.com/document.php?compteur=2&rep=4&evolution=8

    code example:
    http://www.laltruiste.com/coursschema/exemples/xsd_import.zip

    *** Sent via Devdex http://www.devdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Dominique, Jun 30, 2004
    #1
    1. Advertisements

  2. Dominique wrote:

    > I want to use a namespace in an XML file, that I have created in the
    > schema for this xml file. do i have to redefine this namespace in the
    > xml file? or is there a way to re-use the definition from the schema?


    If your schema declares that an element has to be in a certain namespace
    e.g. if you use
    <xs:schema
    targetNamespace="http://example.com/2004/07/kibology"
    elementFormDefault="qualified"
    ...>
    then of course your instance XML document needs to use that namespace by
    declaring a prefix for it e.g.
    <ki:root
    xmlns:ki="http://example.com/2004/07/kibology">...</ki:root>
    or use the namespace as the default namespace e.g.
    <root xmlns="http://example.com/2004/07/kibology">...</root>

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jul 1, 2004
    #2
    1. Advertisements

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,936
    Markus
    Nov 23, 2005
  2. Fred Smith
    Replies:
    1
    Views:
    1,203
    Martin Honnen
    Feb 5, 2004
  3. Hari Om
    Replies:
    1
    Views:
    593
    Martin SChukrazy
    Mar 2, 2004
  4. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,573
    Stanimir Stamenkov
    Apr 25, 2005
  5. Replies:
    1
    Views:
    725
    George Bina
    Jul 20, 2006
  6. Replies:
    3
    Views:
    4,601
  7. Oodini
    Replies:
    1
    Views:
    2,068
    Keith Thompson
    Sep 27, 2005
  8. Replies:
    5
    Views:
    1,715
    Brian McCauley
    Nov 29, 2006
Loading...