> That makes it very flexible in cut & paste situations, or at times when
> you want to shrink down an XML file which has too much information.
An XML file which has too much information has absolutely no bearing
on the use of that XML file at all. You can simply change the query for the
information you require out of it.
When you do an SQL query for data, you can say:
'select * from table'
or you can say:
'select user,pass from table'
Saying "the database has to much information" is just a silly
statement altogether.
> You can often optimize XML files for character count if that is
> important; i.e. </> endtags, scrap unneeded elements, get rid of
> whitespace, and other stuff.
If you remove < /> endtags, your XML parser will fail and your
document will be flagged as an invalid XML document (thank god they finally
added validation INTO the parser now). They were meant to fail like that.
XML is a very strict language, and should be adhered to properly.
If you want to optimize your XML, you should consider changing un-essential
tags to attributes. One example is:
<User>
<FirstName>
John
</FirstName>
<LastName>
Doe
</LastName>
</User>
With the above construct, you could easily ask for all users whose
FirstName was 'John', and get a response back. Or..
<User FirstName="John" LastName="Doe" />
You could use the above construct to represent the same information,
but now your parser has to change to parse out attributes instead of
elements. This is the "proper" way to crunch your XML, but it's also going
to make things harder now, since your parser has to do a lot more to deal
with the same type of question asked of it.
How many people currently close self-closing tags now in their HTML
documents? (raises hand). <img src="foo.gif"> is technically incorrect
according to XHTML 1.0, but <img src="foo.gif /> is correct. It's a good way
to practice writing validatible XML documents today.
But XML has absolutely nothing at all to do with HTML..
> Mostly I'd say that wireless benefits from XML. I use it all the time on
> the Blackberry; headlines, stock quotes. The wmheadlines package also
> uses the same data so it is pretty awesome being able to pick up the
> same article listings from my PC as well as pager, such that when I get
> tired of reading an article on the pager I just go to the PC and it is
> in wmheadlines.
Probably because you're dealing with the same exact 1's and 0's that
were sent to your pager, not a "copy" of that data. It's the same exact
data.
/d
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/