realbasic-nug
[Top] [All Lists]

Re: XHTML Parser

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: XHTML Parser
From: Brady Duga <duga at ljug dot com>
Date: Sun, 31 Jul 2005 14:10:11 -0700
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <2005731163913106156845 at sjgHPnotebook dot rgbltd dot co dot uk> <EA93463D-74A1-4E80-954E-A1125B70BEAD at thezaz dot com>

On Jul 31, 2005, at 1:30 PM, Thom McGrath wrote:

Basically, I need to parse custom tags. So I want to be able to step through the hierarchy and replace tags with content, kind of like MovableType. Find/Replace does not work in this situation.

It fails in that it doesn't parse. I get an XMLException. It does include proper syntax and document type definition.

If it is getting an XMLException, it is probably not well-formed XML, in which case it isn't XHTML. Writing a proper HTML parser is non- trivial, especially if you want it to deal with all the poorly-former XML out there. If the HTMLViewer class gave us access to the DOM (which should be possible at least on Mac and Windows, probably Linux), then you could use the platforms HTML parser and access the HTML DOM tree. It is possible to do this yourself, but is clearly more work. On the Mac, it will mean using Cocoa interfaces (see Charles' book for doing that with declares).



--Brady
The La Jolla Underground

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>