|
|||||||
| XML Discussion and technical support for using and deploying XML applications and websites. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
||||
|
||||
|
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.
__________________
I'm thuper, thanks for asking. Do not ask how much you should charge for your work. || Acceptable use policy || Please help us to save Ana It lives! http://www.stephenphilbin.com/ (Well it kinda' does anyway). My portable colour selection tool |
|
#3
|
|||
|
|||
|
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 |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|