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

    XML - Declaration of element

    Hi,

    Im new to the dizzy world of xml and schema and have just returned from a four day course in a bit of a daze.

    Im just testing out a previously validated xml document and schema on netbeans, which worked well on the course but Im now getting the following error message;

    cvc-elt.1: Cannot find the declaration of element 'Books'. [30]

    Any suggestions would be grately appreciated.

    As a side issue, can anyone recommend any xml reference books i.e. Dummys guide type thing?

    Cheers.
    Lee

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: XML - Declaration of element

    Hi Lee

    Sounds like the normal announces of XML XSL etc <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Have a loom at another validator try W3C XML schema validator , you can't argue with them.

    I take the exercise is the usual book store with ISBN etc...if it is I will drag out one of my books and have a look but if it has worked, and you haven't made changes I would say it is the validator
    Jerry

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

    Re: XML - Declaration of element

    Hi Jerry,

    Thanks for that, I'll check out that validator.

    I should have mentioned before that when I click on the validation error message it highlights a line in the schema root of the xml document as follows;

    xsi:schemaLocation='HottXMLIntro file:/C:/Documents and Settings/purtonl/Desktop/Lee/Lee__HOTTXML/Mod08/Solutions/Books.xsd'>

    Im not sure it looked like this when I was on the course but maybe you can spot something?

    The thing is if I view the document in a IE browser it does appear to be how it should ?!!

    Thanks again for your help on this.

    Cheers.
    Lee

  5. Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: XML - Declaration of element

    For "file://" type URIs usually there are more slashes and no : after the drive letter. So that path probably isn't quite right. I'm not sure where it actually should point; in the "real world" the schema usually is remote from the user and not on a local drive.

  6. Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: XML - Declaration of element

    Hi Lee

    Right it appears that in your training session you must have had a locally based schemaLocation.

    SchemaLocation usually come in this format:

    <pre>xsi:schemaLocation="http://www.w3.org/1999/XSL/Transform
    http://www.w3.org/1999/XSL/Transform.xsd
    http://www.w3.org/1999/xhtml
    http://www.w3.org/1999/xhtml.xsd"></pre>


    Try copying the Books.xsd file to the root folder of your file so it reads

    <pre>xsi:schemaLocation="books.xsd"></pre>

    obviously search for it and copy it to the required location

    Worth a try
    Jerry

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

    Re: XML - Declaration of element

    Hi Jerry,

    Thanks for the tip. Ive moved the books.xsd to the file root folder.

    No more error messages....For the moment anyway !!

    Thanks for all your help.

    Cheers.
    Lee

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

    Re: XML - Declaration of element

    Hi jscher,

    Thanks for the advice, have got rid of the error message now by moving books.xsd to the root folder.

    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
  •