www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > XML

    XML Discussion and technical support for using and deploying XML applications and websites.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 03-06-2007, 10:36 PM
    squishy squishy is offline
    Registered User
     
    Join Date: Jan 2006
    Posts: 89
    XML Parsing... apparently server-side???... or just very complex???

    I recently bought a book on XML. There are various example codes in there, along with screen shots of the output... and also screen shots of the source code as viewed from the clients browser.

    In my -limited- experience with XML I have noticed that my source code, when viewed from my browser, shows only XML. Of course the related stylesheets are referenced and I am capable of looking at their source codes through the browser, as well. But, when it comes down to it, I only see XML or XSLT or DTD or CSS, etc.

    My confusion lies in the examples shown in my book. The author shows source code, post-parsing, as pure HTML. Apparently this authors browser (or server) is parsing the XML and XSLT, translating it into the associated HTML that the browser can interpret... and that HTML is the essence of the source code that one can view from a browser.

    When I attempt the same coding as the examples in the book illustrate, I get what I normally get: XML, XSLT, etc. I dont know how or where the author is getting her HTML source code. If I am to follow her example, as her book training suggests, I dont know what I am doing wrong.

    Does anyone know how I can get a browser (or my server) to parse XML (and associated stylesheets) into pure HTML, such that a visitor is incapable of seeing anything but HTML source code from their browser?
    Reply With Quote
      #2  
    Old 03-07-2007, 03:24 AM
    Stephen Philbin's Avatar
    Stephen Philbin Stephen Philbin is offline
    Thuper Moderator
     
    Join Date: Mar 2004
    Posts: 3,065
    If you don't want your visitor to see anything other than HTML, then you don't have a choice; you will have to have your server apply the stylesheet to the markup to produce the HTML output that your server will send to the user (which would probably place considerable overheads on the host machine for each request). How you apply that stylesheet to your markup will depend on your server software, though.
    Reply With Quote
      #3  
    Old 03-07-2007, 10:12 AM
    alx_web alx_web is offline
    Registered User
     
    Join Date: Mar 2007
    Posts: 7
    Hi Squishy,

    Are actually linking your XML document to the XSL stylesheet? Browsers have built in XSLT parsers so you should be able to transform your XML with an XSL file. Here is how you link it if you didn't know.

    Add this to the XML document after the <?xml version="1.0"?> element:

    <?xml-stylesheet type="text/xsl" href="filename.xsl"?>

    For server-side scripting there are various ways you can build your own parsers in PHP using DOM, SimpleXML and SAX. They may look difficult but are actually very easy once you get over the shock of the syntax.

    Let me know if this is helpful

    cheers

    Alx
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    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 Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 12:39 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.