Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 06-08-2007, 01:44 PM XML
Mattmaul1992's Avatar
Ultra Talker

Posts: 486
Name: Matt
Trades: -1
Hi,

I'm not sure how after so long I just start to decide using XML in my projects but I guess I am now because it seems a lot of scripts are using it. I really don't see the point of it though.. I've taken the tutorial at W3schools (I'll admit I did read a little to fast so i might have missed the whole point but..) on XML and still find it pointless. In a PHP application what are some uses of XML especially with template building like in IPBs' templates.
I know I didn't describe this very well. I'll come back and add a little more description soon.
Thanks!
__________________
PHP Code:
$talkupation++; 

Please login or register to view this content. Registration is FREE
- Free IPB forum hosting (releasing today!!!), no ads, free modifications
Mattmaul1992 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-08-2007, 02:51 PM Re: XML
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
If you're only working in one small corner of software development, a particular module of PHP, there probably isn't any reason to use XML.

But when you need to expose or consume web services, do cross-platform or cross-application integration, flexible user defined data stores, and really all kinds of other things, XML is invaluable.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 06-11-2007, 03:17 AM Re: XML
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
RSS, ATOM, and xHTML are some nice implementations of XML that may justify it's use. Additionally backend b2b communications may come through in XML.

For myself, I rarely create XML files, but I frequently read them. XML files use up, IMO, way too much space for most of the programs I write and don't justify the extra structure especially given that PHP 4 sucks at working with XML (I've developed a number of ways around it out of necessity, but it still sucks.) Instead, I store stuff in the db or in configuration files which set PHP variables. This requires no additional time parsing and the data stored is the data needed, with not very much space wasted to structure (the whole point, afaik, of XML).
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 06-11-2007, 06:17 AM Re: XML
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
I totally agree with Jeremy.
But there is 1 occasion where I worked with xml+xsl, it's when I was given as a absolute must features that every pages of the site would be available as a PDF.

What I did, is that every datas where stored (in the db) as XML fragments.
I used php XSLT engine to apply stylesheets transformation to Xhtml for the regular display, and a second stylesheet to transform the xml via apache's .org xml-FO engine, which allows you to generate PDF from XML.

But it's really the only time I truly created XML with PHP...
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 06-14-2007, 01:32 AM Re: XML
VTWebProperties's Avatar
Skilled Talker

Latest Blog Post:
WEB 2.0 Apps For iPhone
Posts: 64
Name: Ed
Location: Vermont
Trades: 0
If you ever do backend integrations between disparate systems XML is a beautiful thing lending human-readable and therefore understandable hierarchy to data structures.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
VTWebProperties is offline
Reply With Quote
View Public Profile Visit VTWebProperties's homepage!
 
Old 06-14-2007, 05:16 AM Re: XML
millwalll's Avatar
Webmaster Talker

Posts: 674
Name: James
Location: KENT
Trades: 3
Hi all,

Not sure if this right place but need some help on xml. I am trying to lean it from a book and have 2 question.

1 Would this be classed as the same thing.

<name> language="english">Tiger</name>

<name> language=&quot;english>Tiger</name>

2 What does <![CDATA[ ]]> do is this like a multyline comment ??
__________________

Please login or register to view this content. Registration is FREE
millwalll is offline
Reply With Quote
View Public Profile Visit millwalll's homepage!
 
Old 06-14-2007, 05:35 AM Re: XML
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
your syntax is wrong in both cases.
Code:
<name language="english">Tiger</name>
This would be the only valid syntax. XML is not HTML, you don't apply html entities to it, but you use html entities if you output HTML via a xsl transformation.

And a CDATA section is a section that will not be parsed by the XSL engine uppon transformation. It's raw text, that will be outputed as such.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 06-14-2007, 05:51 AM Re: XML
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Quote:
Originally Posted by tripy View Post
And a CDATA section is a section that will not be parsed by the XSL engine uppon transformation. It's raw text, that will be outputed as such.
Totally correct, I'd just add that CDATA indicates to all agents - XSL or otherwise to not parse the inner section as XML.

As a side question, what do you think about using attributes instead of sub-tags? That is

Code:
<name>
  <lang>en</lang>
  <value>Tiger</value>
</name>
as opposed to
Code:
<name lang="en">Tiger</name>
?
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 06-14-2007, 09:18 AM Re: XML
millwalll's Avatar
Webmaster Talker

Posts: 674
Name: James
Location: KENT
Trades: 3
Quote:
Originally Posted by tripy View Post
your syntax is wrong in both cases.
Code:
<name language="english">Tiger</name>
This would be the only valid syntax. XML is not HTML, you don't apply html entities to it, but you use html entities if you output HTML via a xsl transformation.

And a CDATA section is a section that will not be parsed by the XSL engine uppon transformation. It's raw text, that will be outputed as such.
Ok

so could I do this

<name language="english">Tiger</name>
<name language=&quot;english>Tiger</name>

If not where would I use the special symbols like &lt; &gt; so on?

when you mean raw text does that mean if I used cdata it treats all lines between the tag as text So it will display as text. Where if I don't use CDATA it will not display the code but will display the other text.
__________________

Please login or register to view this content. Registration is FREE
millwalll is offline
Reply With Quote
View Public Profile Visit millwalll's homepage!
 
Reply     « Reply to XML
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.27701 seconds with 12 queries