Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] ANN: xml-object.r , and...a question about REBOL's built-in parse-xml

From: gavin::mckenzie::sympatico::ca at: 4-Oct-2001 22:45

Folks, First, there's a new rev of xml-object.r (v 1.0.4) available at: This release fixes an error with whitespace processing. And, I changed my switch statements based on the recent switch/type? thread. I've noticed some limitations in xml-object. If you have element with an attribute and a subelement with the same name, bad things happen. This should really be considered poor form in XML. However, it is legitimately possible to encounter an attribute and subelement of the same local-name within different namespaces. I could also improve my mixed-content processing somewhat...anyway, more work to do. Now...on to a question. I've been building some REBOL-Server-Pages where I query against a MS-SQL-Server and get back an XML result set. So, I've been using the built-in REBOL parse-xml rather than my parse-xml+ script, and I noticed something that became very frustrating: when parse-xml encounters a XML declaration (<?xml version ...?>) it calls a function... check-version: func [version][print ["XML Version:" version]] ...which has the nasty side effect of printing out "XML Version" with the version number. This message, of course, messes up my carefully crafter HTML page that is produced from my REBOL server page. Anyway, my quick fix was to use my parse-xml+ function, but given that the XML I was processing was tightly controlled and straightforward I was actually expecting to stick to the built-in function. Oh well, I suppose I could hack the build-in xml-language object that parse-xml uses and stub out the check-version function, but that seems beside the point. Has anyone else used parse-xml and considered this a real problem? I do hope that some future rev of REBOL will drop the check-version print. Gavin.