SitePoint Sponsor

User Tag List

Page 2 of 6 FirstFirst 123456 LastLast
Results 26 to 50 of 142
  1. #26
    SitePoint Zealot
    Join Date
    Feb 2003
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Because it's a buzzword, and buzzwords tend to be used with different meanings by different people. I've had this discussion with a friend as well, and it comes down to what technology you prefer.

    Using XML for storage is not unpopular, and I wouldn't go so far as to say it's not what xml was meant for. One area where it shines: Single-source publishing, for example DocBookXML. You write the document (or a complete book) once in one format, and then it can be easily and automatically translated into html4, xhtml, pdf, rtf, ps, wml, etc. etc. (at least in theory - most people fail in trying to get the proper environment together in the first place)

    Of course that is neither unique nor brand new. There have alway been plenty of converters for (la)tex for example, but those were all applications that were written once and only for one purpose. With XML and the surrounding standards and tools, you write a document and it's "specification" and then can let it be translated by whichever application in whichever language you want - as long as it supports the same standard. At least in theory.

    Practically however, things are not nearly as easy as they are sometimes made out to be. I remember wanting to use XML for one application a few years back, and it turned out that a) my language of choice had sketchy xml support b) didn't support Schema validation at all c) DTDs were way to weak to be useful d) there were no editors available that I would have wanted to put into user's hands (most of which also had only the very basic xml-support - too little to be useful).

    I find the XML concept intresting and it could be the next big thing
    I had to laugh really hard, when i read that. Beause it alrady was the next big thing several years ago, only the promises that were made were (IMHO) never really fulfilled. But it looks a lot better today than a few years ago, it might actually be possible that we get there someday...

    What really p'd me off, was the fact that XML inspired so many Architecture Astronauts to build hideous things like the WS-* mumbo-jumbo. Or all the people that use XML-Files for configuration (in fact, I even did that myself back then, and I feel ashamed for it ). XML is just way too verbose for that.

    Many places where XML is in use, you could do well without - it just introduced an unnecassary layer, as you can see in the many XML-RPC vs REST discussions (or not, depending on which side you're on). This russian-doll type layering is humorously illustrated in The essence of XML.

  2. #27
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    NY, USA
    Posts
    712
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rikshot
    Um, then why did the author wrote the book? As far as ive read the sample chapters, he doesnt utilize databases at all? Or does he in the full book? The book seems to be a complete waste of time, if it uses XML to make a CMS when XML is not ment to be used like that...
    Not sure what your gettin at, I don't know why the author wrote the book, I'm actaully referring to the site point article of authoring an XML driven CMS. Sorry if I have the wrong thread here. My bad.

    Does he utilize databases in his book, I couldn't begin to tell you because I haven't read it.

    Quote Originally Posted by rikshot
    The book seems to be a complete waste of time, if it uses XML to make a CMS when XML is not ment to be used like that...
    I would agree with that sentiment. XML's main purpose is to share data in a "standard" way, regardless of platform, language or whatever. It was never meant to replace the role of a database, especially within an application where the data never leaves the application.

    If data has to be shared across apps, or distributed out to other businesses then XML is a nifty solution.

    Why one would bother with XML to build a fully self sufficient CMS is beyond me... and perhaps I'm missing something here, I certainly don't "know-it-all".

    XML would come into play if you wanted to syndicate your content to outside sources and had no clue how the reicpient would recieve that data.

    Kinda like: http://www.sitepoint.com/syndication/

  3. #28
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by R. U. Serious
    Many places where XML is in use, you could do well without - it just introduced an unnecassary layer, as you can see in the many XML-RPC vs REST discussions (or not, depending on which side you're on).
    We should probably answer for the original poster some places where XML can be put to use with PHP. Here are a two reasons I have used XML:

    - XML is a good format to put data into that is going to be compiled into some run-time format that performs better. For example, you might want to have your template builders use XML because there are many tools out there to use for authoring. Then compile the XML templates into PHP. XML configuration data can me converted into PHP or serialized data to the quickly loaded. Etc.

    - XML is necessary when communicating with system that only have XML interfaces such as SOAP. You may not like XML and thinks SOAP sucks, but when your boss/client needs to connect to a vendor and that's all they provide your opinion matters little.
    Christopher

  4. #29
    Ribbit... Eric.Coleman's Avatar
    Join Date
    Jun 2001
    Location
    In your basement
    Posts
    1,268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As I posted on the first page, which seemed to be overlooked:

    The Problem:

    You have an Indian Language in a SQL database online. Not only do you need this online database search able, but you need to create a downloadable cdrom that is also able to search the database.

    The Solution:

    I dump specific text from the db to xml files, and use Flash to search the xml files on the cdrom. It's actuall brilliant and requires nothing more than the flash file, and a directory containing the xml files.

    Perfecto... hehe
    Perfect application of it.
    Eric Coleman
    We're consentratin' on fallin' apart
    We were contenders, now throwin' the fight
    I just wanna believe, I just wanna believe in us

  5. #30
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by R. U. Serious
    Using XML for storage is not unpopular, and I wouldn't go so far as to say it's not what xml was meant for.
    This is exactly what XML was meant for. To serve as a text data container, provide a way to descript it, and to be valid.

    And BTW:
    This is exactly what a database (i.e. MySQL) is meant for. To serve as a text data container. No description, no valid standard.

  6. #31
    SitePoint Zealot
    Join Date
    Feb 2003
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Eric.Coleman: What is the advatage of XML in that case? I am not sure what that data looks like, but when you say language (as in dictionary), it seems those are simple key value pairs - nothing hierarchical that would justify the use of xml. But maybe I just misunderstood the task you were trying to solve.

  7. #32
    Ribbit... Eric.Coleman's Avatar
    Join Date
    Jun 2001
    Location
    In your basement
    Posts
    1,268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    R.U. Serious:

    This is a Lenape Indiain Language, the kind of data involved are parts of speach (verb, noun, etc) sounds files, images, IPA information, as well as keywords. The english and lenape version of the text.

    Could you propose a better method of searching and mainting the data outside of MySQL for a Flash based CD-Rom?
    Eric Coleman
    We're consentratin' on fallin' apart
    We were contenders, now throwin' the fight
    I just wanna believe, I just wanna believe in us

  8. #33
    SitePoint Zealot
    Join Date
    Feb 2003
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So I did have a wrong understanding of the data involved. Under those circumstances XML seems an adequate solution to me.

  9. #34
    SitePoint Guru
    Join Date
    Oct 2001
    Posts
    656
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is exactly what a database (i.e. MySQL) is meant for. To serve as a text data container.
    Hehe Get yourself a proper education on databases. A database is so much more than that. The problem is not only that you don't know what a database is but also that you do not know that you should know it.

    If you knew what a database really is you would also able to see why XML is not a good replacement.
    I once had a problem.
    I thought: "Oh, I know: I'll just use XML!"
    Now I had two problems.

  10. #35
    SitePoint Addict timvw's Avatar
    Join Date
    Jan 2005
    Location
    Belgium
    Posts
    354
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    - Actually, it's pretty easy to represent each XML file structure in a Relational Model.
    The only problem is with SQL, you need to use an approach like NestedSets to query it.

    - Although the structure is human-readable, the complete XML content isn't always (and binary XML isn't going to improve that). An example:
    Code:
    <Picture>
        <![CDATA[q?T]]>
     </Picture>

  11. #36
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by timvw
    The only problem is with SQL, you need to use an approach like NestedSets to query it.
    What is the problem with SQL ? I didn't get that. Are you saying XML can't be queried like a normal relational database ? If so, take a look here: http://www.w3schools.com/xquery/default.asp

    Quote Originally Posted by timvw
    - Although the structure is human-readable, the complete XML content isn't always (and binary XML isn't going to improve that). An example:
    Code:
    <Picture>
        <![CDATA[q?T]]>
     </Picture>
    The example is as invalid as it gets. I worked with XML a lot and I never saw the need to include binary data in XML as you just showed it's posible. Also, please take a look here: http://www.w3schools.com/svg/default.asp

  12. #37
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would say the advantage of XML is within your own hands, you could build up any structure you like with XML, XML however these days is a broad concept of many interactions between leaf protocolls like Xslt, DTD, XPath, Xquery, SOAP, DOM, SAX, WSDL, and many more to go, these protocolls all have their own purpose within and with or in combination with well formed XML or XHTML pages.

    The 3rd Edition of Beginning XML from Wrox has 995 Pages that all have something to do with XML, so i dont think your question is right, it's not relevant, the important thing is can XML solve your problem, and how can it solve your problerm, and in what ways can i solve , and therefore i definatly say go and dive into the world of XML if that is what your asking but else you would have to state your problem....

    Btw, Proton, nice subline...
    I once had a problem.
    I thought: "Oh, I know: I'll just use XML!"
    Now I had two problems.

    Bwahahaha,.....lol, but it's true

    cheers,
    Galo
    Business as usual is off the menu folks, ...

  13. #38
    SitePoint Addict timvw's Avatar
    Join Date
    Jan 2005
    Location
    Belgium
    Posts
    354
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bonefry
    What is the problem with SQL ? I didn't get that. Are you saying XML can't be queried like a normal relational database ?
    No, i was saying that modelling a tree in a SQL database isn't straightforwarded, not if you want to query it efficiently. And thus i referred to a possible solution like NestedSets.



    Quote Originally Posted by bonefry
    The example is as invalid as it gets. I worked with XML a lot and I never saw the need to include binary data in XML as you just showed it's posible.
    An example is not invalid because you have never seen the need for it.

  14. #39
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by timvw
    No, i was saying that modelling a tree in a SQL database isn't straightforwarded, not if you want to query it efficiently. And thus i referred to a possible solution like NestedSets.
    Ohh, sorry. Now I get it. Well, this is one reason people feel the need for object oriented databases sometimes.

    Quote Originally Posted by timvw
    An example is not invalid because you have never seen the need for it.
    There is a difference between what a technology can do, and what it should do. Just because it can embed binary data, doesn't mean you should do it. Also, for example in RSS, you don't pass the binary data that forms a picture, you just keep the picture somewhere and pass the URL . And this is the normal approach for passing binary data around in XML.

  15. #40
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Captain Proton
    Hehe Get yourself a proper education on databases. A database is so much more than that.
    Looks like the proper education on databases is your weak side And with XML there are two weak sides of you . And two problems

    Quote Originally Posted by Captain Proton
    If you knew what a database really is you would also able to see why XML is not a good replacement.
    I've never said XML is meant to be a replacement for a database. But it can be used like one.

    Check the following links:
    http://www.xml.com/pub/a/2001/10/31/nativexmldb.html

    http://www.sleepycat.com/products/xml.shtml

    http://www.25hoursaday.com/StoringAndQueryingXML.html


    As was mentioned in the introduction, there is a dichotomy in how XML is used in industry. On one hand there is the document-centric model of XML where XML is typically used as a means to creating semi-structured documents with irregular content that are meant for human consumption. An example of document-centric usage of XML is XHTML which is the XML based successor to HTML.

    The other primary usage of XML is in a data-centric model. In a data-centric model, XML is used as a storage or interchange format for data that is structured, appears in a regular order and is most likely to be machine processed instead of read by a human.

  16. #41
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bonefry
    Just because it can embed binary data, doesn't mean you should do it.
    I don't see a difference if you are to pass an image as a single file (image.jpg), or a binary data (image.xml or image.txt). It depends on what the developer intends to do and what problem he has to solve.

  17. #42
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Captain Proton
    Hehe Get yourself a proper education on databases. A database is so much more than that. The problem is not only that you don't know what a database is but also that you do not know that you should know it.

    If you knew what a database really is you would also able to see why XML is not a good replacement.
    And one last, XML database vendors:


  18. #43
    SitePoint Addict timvw's Avatar
    Join Date
    Jan 2005
    Location
    Belgium
    Posts
    354
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by REMIYA
    The other primary usage of XML is in a data-centric model. In a data-centric model, XML is used as a storage or interchange format for data that is structured, appears in a regular order and is most likely to be machine processed instead of read by a human.
    But is there also a formal definition of "data-centric model" ?

    (Remember why we moved from a structured/hierarchical model to a relational model?)

  19. #44
    SitePoint Addict timvw's Avatar
    Join Date
    Jan 2005
    Location
    Belgium
    Posts
    354
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by REMIYA
    I don't see a difference if you are to pass an image as a single file (image.jpg), or a binary data (image.xml or image.txt). It depends on what the developer intends to do and what problem he has to solve.
    Well, there are some differences

    For example, you can't stuff anything you want in CDATA. So if you want to do it anyway, you'll have to use for example base64encode. And let's not forget the overhead of that.

    Even Microsoft seems to realize that if i look at their new Office XML documents. (A zip container with binary files and XML files (with references to the binary files)

  20. #45
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yet there is no difference, there is only data, and a way to submit it. It is just a simple developer's choice.

    Good or bad, who can bet on it?

  21. #46
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    NY, USA
    Posts
    712
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by REMIYA
    And one last, XML database vendors:
    Thanks, when I have the time, I'll be sure to look through those links and study the advantages of XML "databases". Maybe I'll learn a thing of two and see the light.

    However to this point, myself and developers I work with see nothing more in XML than a standard, helpful way to make data available to anyone or anything without sweating how the data should be formatted.

    At the present moment... we sure as heck are not about to ditch MS SQL Server to store our data in a bunch of XML files. Doing so would gain nothing and cost us a lot of convenience in functionality, such as stored procedures and triggers, user defined functions... I could go on and on.

    I have found a few uses for XML to store data... only because it needs to be available to other applications. It's value lies in the exchange of data, not storage. For simple data storage, there is no need to get away from regular database software. Just my HO.

  22. #47
    SitePoint Guru
    Join Date
    Oct 2001
    Posts
    656
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've never said XML is meant to be a replacement for a database. But it can be used like one.
    Read that again to see that in your second sentence you say that XML can be used as a replacement for a database.

    And one last, XML database vendors:
    Because lots of people are selling products does not mean the technology behind it is a good thing. Sure it can be made into some working product, but that does not mean the product is good.
    I once had a problem.
    I thought: "Oh, I know: I'll just use XML!"
    Now I had two problems.

  23. #48
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Captain Proton
    Read that again to see that in your second sentence you say that XML can be used as a replacement for a database.
    I think there is a difference between "is meant to be" and "can be used as".
    Quote Originally Posted by Captain Proton
    Because lots of people are selling products does not mean the technology behind it is a good thing. Sure it can be made into some working product, but that does not mean the product is good.
    But it may indicate a demand, which may in turn might mean that people find it useful (whether you do or not). There certainly cases where being able to talk to a database directly using XML would be easier than converting back and forth.
    Christopher

  24. #49
    SitePoint Guru OfficeOfTheLaw's Avatar
    Join Date
    Apr 2004
    Location
    Quincy
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I only read the first few posts, but I thought I'd chime in my experience using xml.

    A long time ago I built an online job application system, that soon grew to have all kinds of requirements that the client desired. They wanted to display the job application in pdf to print out for interviews. They wanted to import applications into some propietary medical database (it was a hospital). Finally, they also expressed a desire to perhaps be able to import the data to a different system in the future. Internally, I also desired maximum reuse.

    When I began refactoring with these objectives, XML as the data format became a strong candidate. I used XSL-FO to transform the xml to a pdf. I used XSLT for templating and this fit nicely with keeping the application in an XML data format. Also, the fact the data is in xml allows future developers to do whatever they want with it. I never got around to importing the data into their propietary medical system, but a general idea that was brainstormed would be to use SOAP to send the application data to the server and somehow import it from there.

    With XSL, you can transform xml into anything you want really, heck you could even transform it to office xml to view, say, as a word document. Now people have stated they prefer csv over xml, but I would like someone to explain to me how they handled nested data that is heirarchical in nature as csv?

    I mean it's easy to scream why do this:
    Code:
    <id>2</id>
    <name>James</name>
    <whatever>blah</whatever>
    when you could just do this:
    Code:
    id,name,whatever
    2,James,blah
    That is convenient, and in fact it may be better to use route two. But my system required data like this:

    Code:
    <application id="0002123">
     <metadata>
      <submitDate>2005-03-02</submitDate>
      <recruiter>
       ... recruiter data ...
      </recruiter> 
     </metadata>
     <personalInformation>
      ... personal info ...
     </personalInformation>
     <employmentHistory>
      <employmentRecord id="21">
       <employer>
        <name>Evil, Inc.</name>
        <address>
         <street />
         <city />
         <zip />
        </address>
        <supervisor />
       </employer>
       <startDate />
       <endDate />
       <leaveReason />
      </employmentRecord>
     </employmentHistory>
    </application>
    Although that is a very quick write up off the top of my head, the actual xml is quite complex at times... sending this data as possibly hundreds of csv snippets seems rather redundant, doesn't it?

    James Carr, Software Engineer


    assertEquals(newXPJob, you.ask(officeOfTheLaw));

  25. #50
    SitePoint Addict timvw's Avatar
    Join Date
    Jan 2005
    Location
    Belgium
    Posts
    354
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by OfficeOfTheLaw
    When I began refactoring with these objectives, XML as the data format became a strong candidate.
    How do you refactor objectives? Would be nice if you could explain that, because i've never seen someone do that. And it could allow me to understand why XML became a strong candidate.

    Quote Originally Posted by OfficeOfTheLaw
    I used XSLT for templating and this fit nicely with keeping the application in an XML data format.
    How do you keep the application in an XML data format? (Btw, as long as you have a tool that is able to generate XML, XSL can be used to transform it to the desired output)

    Quote Originally Posted by OfficeOfTheLaw
    Also, the fact the data is in xml allows future developers to do whatever they want with it.
    That is true for every data format you use (Assuming you document it as good as you would do with the XML format)

    Quote Originally Posted by OfficeOfTheLaw
    I never got around to importing the data into their propietary medical system, but a general idea that was brainstormed would be to use SOAP to send the application data to the server and somehow import it from there.
    To me it sounds like there hasn't been much brainstorming. It's more or less the same as saying, we'll use a freezer to store the application data and somehow import it from there.

    Quote Originally Posted by OfficeOfTheLaw
    Now people have stated they prefer csv over xml, but I would like someone to explain to me how they handled nested data that is heirarchical in nature as csv?
    Could you explain why you think that csv is heirarchical in nature? Which part of a cvs file could be considered the root? And which parts would be the nodes/leaves?

    (Imho, the example you've shown is easily represented in a Relational model)

    Quote Originally Posted by OfficeOfTheLaw
    sending this data as possibly hundreds of csv snippets seems rather redundant, doesn't it?
    Sending this data as plain text (xml) seems rather redundant, doesn't it? You could easily archive it (bz2, zip, tar, ...)

    Btw, you shouldn't care about the number of files either. They will be processed by machines, not humans


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •