www.webdeveloper.com
Page 1 of 3 123 LastLast
Results 1 to 15 of 39

Thread: Basic XML Questions

  1. #1
    Join Date
    May 2003
    Posts
    550

    Basic XML Questions

    This summer I will be doing web design for a jeweler.
    I was thinking of using XML to keep track of the products/prices/info. Say the XML file looked like this. (I don't know the XML syntax yet, this is just a sample!).
    <item>
    <productid>001</productid>
    <name>Product Name</name>
    <price>Price</price>
    </item>
    Do you think XML would be work well for this project? If I don't use XML, I would just be using HTML and doing a page for each product, as I dont need a full blown database.
    And how would I take that XML file, and transform it into this?
    Product ID:001
    Name: Product Name
    Price: Price
    Would I use XSL to parse/display the data?
    BTW I don't need like, exact code on how to do this, just someone to point me in the right direction so I can learn this.
    I have already started looking at the W3Schools tutorials on XML.
    Thx in advance

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    I wrote an extermely flexible solution for this member,take a look at this thread..

    http://forums.webdeveloper.com/showt...?threadid=9363

    Works both on IE and NS,and you don't have to worry about learning any other language ,such as xsl and stuff,just plain old JavaScript and DOM will do.

  3. #3
    Join Date
    May 2003
    Posts
    550
    Thanks, Sounds great from that thread, but your site seems to be down
    I have gone to other pages hosted on your server (im guessing that the IP is you running it yourself).
    Ill try again a little later.

  4. #4
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,278
    Originally posted by khalidali63
    [J]ust plain old JavaScript and DOM will do.
    Yes, but one in ten users do not use "plain old JavaScript and DOM" and that one in ten users includes persons with disabilities who cannot use "plain old JavaScript and DOM". As such that solution could cause the page to violate accessibility laws and certainly wouldn't be very nice. As this is to keep track of "products/prices/info" if this is in the US then Title III of the Americans with Disabilities Act would definitely apply and possible Title I as well. Just go ahead and learn XSLT. It's a pretty quick learn and rather useful.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  5. #5
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    yes,the web page is up...sowwy..

  6. #6
    Join Date
    May 2003
    Posts
    550
    Ok thanks! Looks pretty neat khalidali.
    Although I read some tuts on XSLT and that may be the way to go if Charles is correct about those laws.
    Charles-I have seen you post maybe a dozen times that something will not work for 1 in 10 users. I was wondering what exactly it was your referring to when you say that 1 in 10. Is it text only/aural browsers, or disabled javascript or something?

  7. #7
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    Originally posted by brendandonhue
    Ok thanks! Looks pretty neat khalidali.
    ........
    As we all know,there are a tonnes of options out there when you look for coding,it all comes to the final point that what exactly suites your requirements.
    XML/XSL an ultimate option without getting worried about any browser compliance problems...
    JavaScript/XML is only an additional option for users,if charles has something against it why don't he sue MS,who to begin with created the XML data island idea and created a proprietery tag.
    The solution I provided is only intended for people who deem this appropriate for them,for the others all the rest of the options are open for chosing.

  8. #8
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,278
    Currently about one in ten users do not use JavaScript (http://www.thecounter.com/stats/2003/May/javas.php). And because some of those users are disabled and cannot use JavaScript you are not supposed to rely upon it (http://www.w3.org/TR/WCAG10/wai-page...l#tech-scripts) And because of the Americans with Disabilities Act (http://www.usdoj.gov/crt/ada/pubs/ada.txt) if you are in the US you might be facing a lawsuit if your web site does rely upon it (http://www.usdoj.gov/crt/foia/tal712.txt). Other countries have other accessibility laws that apply so be careful.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  9. #9
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    As we all know,there are a tonnes of options out there when you look for coding,it all comes to the final point that what exactly suites your requirements.
    XML/XSL an ultimate option without getting worried about any browser compliance problems...
    JavaScript/XML is only an additional option for users,if charles has something against it why don't he sue MS,who to begin with created the XML data island idea and created a proprietery tag.I thought I did a great job in creating a NS compatible code that works in IE as well,for those who like to use DOM methods to manipulate the xml with javascript.
    The solution I provided is only intended for people who deem this appropriate for them,for the others all the rest of the options are open for chosing.

  10. #10
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,278
    When you post some code or a method that is hurtful to people (and inaccessible pages do hurt the disabled) or that might expose the web author to lawsuits you at least have an obligation to warn them. "Do no harm" as it were. And perhaps you have an obligation to not post harmful code or methods at all but to promote better web practices.

    And see http://www.evolt.org/article/Accessi...da/4090/28074/ for a review of the state of Internet accessibility law in Canada.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  11. #11
    Join Date
    May 2003
    Posts
    550
    Ok thanks.
    I think it would just be best to use XSL, don't want any legal problems, as I don't think I am even of legal age to be working

  12. #12
    Join Date
    Nov 2002
    Location
    Dartmoor [Holiday]
    Posts
    2,382
    I don't think I am even of legal age to be working
    Which country are you in? In the UK, you have to be 14 to work part time, for limited hours. I probably sometimes break the law, but I am working for myself, and as I'm under 18 I can't be sued. Isn't the law great.

    I agree with Charles, you should not use Javascript for page content because it limits your audience, and is unfair (legal or not). Use JS for added interactivity, but the content should be available to everyone.

    Adam

  13. #13
    Join Date
    May 2003
    Posts
    550
    US, and just turned 13.
    I know I can legally work part time at 14.

  14. #14
    Join Date
    Jun 2003
    Location
    Yorkshire UK
    Posts
    96
    If you follow the W3C Accessibility Guidelines I believe they say that if you do use Javascript, then make sure an identical page made without it is available.

    I have two pages on my work site that use drop down menus and Javascript to make them link to other documents. It's the best solution in terms of space and presentation, what the client wanted. But I also have a message that comes up when Javascript isn't used offering a link to the same page, but with the menus turned into simple links.

    I've just made the pages run from XML so I don't have to manually update two pages at once.

  15. #15
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    He guys, I've followed this thread, and I'd like to know what XSLT is, and how it provides a way to, not using Javascript (?), read and process XML documents and print them as HTML markup (am I right?). If I'm not mistaken, XSLT is XML "stylesheets," that provide a way for XML to be parsed... But the question is, how would I go about using it?

    I hope to get into XML, because not only does it look really cool and interesting, but it also provides an efficient way for me to store, extract, and process data.


    Jona

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles