SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
-
Apr 29, 2003, 09:46 #1
- Join Date
- Jan 2003
- Location
- Belgium
- Posts
- 133
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Parsing XML with SAX/CData/Int.Characters/Speed
I've implemented some classes to edit and retrieve XML articles.
Basically, ach XML file contains some 'meta' type info (keywords, descr) and some sections. The whole system is based on SAX callbacks, and works fine IMHO.
The point is: how can I include normal HTML tags within the section content? Normally this is where a DTD / CData section comes in right?
Say I would like to do this:
Code:... <section id="intro"> <content> This is some <b>bold</b> text </content> </section> ...
Another thing I'm not sure about is whether to use iso-8859-1 encoding (there's a lot of int. char. content) or to use UTF-8.
I think it's best to convert these to HTML entities on display, not when saving to the XML file.
Are those nasty HTML entities still recommended over a simple character set definition? Everything should be int. char. and Euro sign safe though...
The last thing I'm wondering about is whether such a system can keep up speed wise. Not that I really have doubts, as everything is working as expected, SAX seems really quick, the content files are typically only around 5000 chars, and the intended use is for a low to medium traffic site. I was planning to use a cache system where complete pages will be cached once generated, but I'm not sure it's needed.
Thanks
-
Apr 29, 2003, 12:23 #2
- Join Date
- Jan 2003
- Posts
- 5,748
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Sorry I don't use SAX though an answer to a few points:
1) SAX is fast - ie it'll do the job - though XSL-T is a lot faster - why I'm using it 8)
2) With Sablotron I get errors if I use iso-8859-1 so I'm using utf-8 at the moment but personally I think it's an IE issue
2.1) I've had problems in the past using iso-8859-1 and client side XSL stylesheets
3) If you need to embolden some text for example, why not have <bold>...</bold> XML tags ? I might be mis - guided here since I'm looking at it from the XSL-T perspective ?
Hope I've helped in some way................
-
Apr 29, 2003, 12:42 #3
- Join Date
- Jan 2003
- Location
- Belgium
- Posts
- 133
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Dr Livingston
2) With Sablotron I get errors if I use iso-8859-1 so I'm using utf-8 at the moment but personally I think it's an IE issue
2.1) I've had problems in the past using iso-8859-1 and client side XSL stylesheets
3) If you need to embolden some text for example, why not have <bold>...</bold> XML tags ? I might be mis - guided here since I'm looking at it from the XSL-T perspective ?
-
Apr 29, 2003, 23:07 #4
- Join Date
- Jan 2003
- Posts
- 5,748
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
After running into some trouble myself yersterday I went on the rake to read up on some stuff and over at www.xml.com I came across the following link which might help ?
http://www.xml.com/pub/rg/SAX_Tutorials
Haven't looked but something in there might help ? Also any overhead would proberly be from mysql and not directly by XSL-T LoL
It's all pretty fast and I'm happy 8) But I get the point....
-- EDIT--
Try www.h2hosting.com for Sablotron w/ PHP 8) $79 per year so it's not too risky.
Bookmarks