New to XML, what do you think of this document?

Discussion in 'XML' started by Banaticus, Nov 12, 2005.

  1. Banaticus

    Banaticus Guest

    http://www.banaticus.com/test/neighborhoods.xml
    I've tried validating it in several online validators but either the
    validation just doesn't work or I get conflicting errors. The document
    works fine for what I'm using it for, to create a Google Map. But, the
    Google Map isn't loading on some Win 2000 computers and I think it
    could be because of this XML document. What do you all think?
     
    Banaticus, Nov 12, 2005
    #1
    1. Advertising

  2. In article <>,
    Banaticus <> wrote:

    >http://www.banaticus.com/test/neighborhoods.


    You have <!ELEMENT neighborhood> which is syntactically incorrect.
    It appears to contain a marker followed by a sequence of corners
    so it should be something like <!ELEMENT neighborhood (marker, corner*)>.

    You are declaring the attributes of marker and corner as if they were
    child elements. Attributes are declared with ATTLIST declarations.
    You really need to look this up in an XML textbook.

    Including a long paragraph of text as an attribute (history) is not a
    good idea, but is not illegal.

    Any XML parser should reject this document!

    -- Richard
     
    Richard Tobin, Nov 12, 2005
    #2
    1. Advertising

  3. Banaticus

    Banaticus Guest

    >"Any XML parser should reject this document!"
    >>"either the validation just doesn't work or I get conflicting errors"


    The document works fine for my purposes, I just need help learning how
    to do the Doctype declarations so that I can have some auomated parser
    check the document for me (in case I put in a " in a block of text
    instead of an &quot;). Is there a website that you'd reccomend for
    learning how to do this?
     
    Banaticus, Nov 12, 2005
    #3
  4. In article <>,
    Banaticus <> wrote:

    >The document works fine for my purposes


    This is not a good way to think. Using wrong XML that happens to work
    because it isn't checked will just lead to trouble later on.

    >I just need help learning how
    >to do the Doctype declarations so that I can have some auomated parser
    >check the document for me (in case I put in a " in a block of text
    >instead of an &quot;).


    Having a DOCTYPE won't help with that. There's (almost) only one
    place where you have to use &quot; instead of ", and that's in an
    attribute value delimited by ". This should be detected regardless of
    whether you have a DOCTYPE.

    Roughly speaking, the only thing a DOCTYPE helps with is ensuring that
    you have the right attributes on your elements, and that you have the
    right elements inside other elements.

    >Is there a website that you'd reccomend for learning how to do this?


    I haven't really compared sites, but you might try

    http://www.w3schools.com/dtd/

    -- Richard
     
    Richard Tobin, Nov 12, 2005
    #4
  5. Banaticus

    Peter Flynn Guest

    Banaticus wrote:

    >>"Any XML parser should reject this document!"
    >>>"either the validation just doesn't work or I get conflicting errors"

    >
    > The document works fine for my purposes, I just need help learning how
    > to do the Doctype declarations so that I can have some auomated parser
    > check the document for me (in case I put in a " in a block of text
    > instead of an &quot;). Is there a website that you'd reccomend for
    > learning how to do this?


    The XML FAQ is at http://xml.silmaril.ie/

    ///Peter
     
    Peter Flynn, Nov 12, 2005
    #5
  6. Banaticus

    Peter Flynn Guest

    Banaticus wrote:

    > http://www.banaticus.com/test/neighborhoods.xml
    > I've tried validating it in several online validators but either the
    > validation just doesn't work or I get conflicting errors.


    That's because it's not XML. It's just a bunch of text and pointy
    brackets masquerading as XML.

    > The document works fine for what I'm using it for, to create a Google
    > Map.


    Not with XML software it doesn't.

    > But,
    > the Google Map isn't loading on some Win 2000 computers and I think it
    > could be because of this XML document. What do you all think?


    I think you need to learn a little more about XML. I've rewritten
    the document to the prevailing conventions for you to examine, see
    http://silmaril.ie/tmp/neighborhoods.xml

    ///Peter
     
    Peter Flynn, Nov 13, 2005
    #6
  7. Banaticus

    Banaticus Guest

    Wow, that's beautiful. Now I just need to rewrite my map code at
    banaticus.com/test/map.htm to use the updated code. The way the
    influences are structured will sure make it easier to feed them into a
    better dispay sytem. I just restructured the dtd according to the
    http://www.w3schools.com/dtd/ but your way is much more elegant. After
    I rewrite the map code, edit the polylines so that the 5 neighborhoods
    that I have now touch up better, then I can get to work putting the
    rest of the 29 neighborhoods into this truly svelte XML document.
    Thanks again.
     
    Banaticus, Nov 13, 2005
    #7
  8. Banaticus

    Banaticus Guest

    Thanks, but I'm going to restructure the code yet again. This time to
    conform to the Google Earth KML (well, really XML) documentation. This
    way I end with an XML document that's easily read and can either be
    parsed by JavaScript to produce a Google Map that anyone with a good
    browser can view, or it can be downloaded and parsed by someone's
    individual copy of Google Earth. Thus, I get to take advantage of both
    the "feature rich, but requires downloading file" and the "everyone can
    use it" programs with the same XML document.
     
    Banaticus, Nov 14, 2005
    #8
    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. Tony Prichard
    Replies:
    0
    Views:
    737
    Tony Prichard
    Dec 12, 2003
  2. Steven Bethard

    Think you've got a new decorator syntax?

    Steven Bethard, Aug 16, 2004, in forum: Python
    Replies:
    1
    Views:
    281
    David Fraser
    Aug 19, 2004
  3. Replies:
    0
    Views:
    612
  4. Replies:
    1
    Views:
    875
    Jack Klein
    Apr 13, 2005
  5. David Mark
    Replies:
    17
    Views:
    242
    David Mark
    Mar 23, 2010
Loading...

Share This Page