Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   New to XML, what do you think of this document? (http://www.velocityreviews.com/forums/t170171-new-to-xml-what-do-you-think-of-this-document.html)

Banaticus 11-12-2005 08:36 PM

New to XML, what do you think of this document?
 
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?


Richard Tobin 11-12-2005 09:47 PM

Re: New to XML, what do you think of this document?
 
In article <1131827796.812695.240190@g14g2000cwa.googlegroups .com>,
Banaticus <banaticus@gmail.com> 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

Banaticus 11-12-2005 09:57 PM

Re: New to XML, what do you think of this document?
 
>"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?


Richard Tobin 11-12-2005 10:39 PM

Re: New to XML, what do you think of this document?
 
In article <1131832632.466525.180500@g14g2000cwa.googlegroups .com>,
Banaticus <banaticus@gmail.com> 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


Peter Flynn 11-12-2005 11:48 PM

Re: New to XML, what do you think of this document?
 
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 11-13-2005 12:47 AM

Re: New to XML, what do you think of this document?
 
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

Banaticus 11-13-2005 01:34 AM

Re: New to XML, what do you think of this document?
 
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 11-14-2005 10:55 PM

Re: New to XML, what do you think of this document?
 
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.



All times are GMT. The time now is 02:10 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.