Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2006
    Location
    Gtr London, England
    Posts
    256
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Conecting .xml to .xsd

    Hi,

    Im just getting to grips with the exciting world of xml and schema !!

    Ive written a schema and now need to contect it to the xml document but nothings working.

    Below is the begining of the xml document where I have attempted to contect it to the schema via a namespace and below that is the schema details which I would have thought the xml document would have found without problem..But apparently not !! <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>

    XML:

    <?xml version="1.0" encoding="UTF-8"?>

    <ContactDetails xmlns="x-schema/ContactDetails"
    xmlns:xsi="http://www.w3.org/2006/XMLSchema-instance"
    xsi:schemaLocation="Cocuments and SettingspurtonlDesktopBulkSchema/ContactDetails.xsd">

    </ContactDetails>



    XSD:

    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:ns="x-schema/ContactDetails"
    targetNamespace="http://xml.netbeans.org/examples/targetNS"
    xmlns="http://xml.netbeans.org/examples/targetNS"
    elementFormDefault="qualified">



    Any suggestions would be grately appreciated.

    Cheers.
    Lee

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Conecting .xml to .xsd

    Have a look at the line in your code:

    xsi:schemaLocation="Cocuments and SettingspurtonlDesktopBulkSchema/ContactDetails.xsd"

    This is an absolute link to the XSD and appears to be badly formatted. Can't you just pace it in your root folder as before to read:

    xsi:schemaLocation="ContactDetails.xsd"

    this should be OK for training purposes after that you can convert it to the web site url like:

    xsi:schemaLocation="http://www.leepurton.com/iles/ContactDetails.xsd"l
    Jerry

  3. #3
    3 Star Lounger
    Join Date
    Aug 2006
    Location
    Gtr London, England
    Posts
    256
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Conecting .xml to .xsd

    Hi Jerry,

    Excellent, thanks for that and for your help.

    Cheers.
    Lee

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •