|
Aaron, I am afraid I cannot help you here, as my XML project (self initiated) is put on hold due to other priorities. I think it has to with the encoding to Unicode. And I agree with you on this: it is very cumbersome. For instance chEqual is a programme variable/constant containing one character: "=". You can build such a string easier with Eval, %string it and put that string in the DOM-tree, using AttrName2@x But then it has been said: OO languages are more suited for XML, than RPG. I doubt that statement. Looking plainly at the output of an XML document you can do it with a recursively called procedure, whether or not you're using the XML parser API's. Having said this, let's not start another OO thread. Regards, Carel Teijgeler *********** REPLY SEPARATOR *********** On 14-5-03 at 11:23 Bartell, Aaron L. (TC) wrote: >I am working on some serialization sub procedures and am looking at how to get >the string representation of an XML document <SNIP> >After studying the API's it seems you must got to great lengths to get a >string representation of an XML document regardless of >whether you use SAX or >DOM. For instance here is some code to produce the 'id' attribute in Order. > >// You have to literally add each character including spaces. >... >QxmlXMLFormatter_streamoutXMLCh(gFormatter@: %ADDR(chSpace)) // Add Space > >QxmlXMLFormatter_streamoutDOMString(gFormatter@: AttrName2@) // Add >Attribute Name >QxmlXMLFormatter_streamoutXMLCh(gFormatter@: %ADDR(chEqual)) // Add the >equal sign >QxmlXMLFormatter_streamoutXMLCh(gFormatter@: %ADDR(chDoubleQuote)) //Start >the double quote >QxmlXMLFormatter_setEscapeFlags(gFormatter@: Qxml_AttrEscapes) // not >sure >yet >QxmlXMLFormatter_streamoutDOMString(gFormatter@: AttrVal2@) // Add the >value of the Attribute >QxmlXMLFormatter_setEscapeFlags(gFormatter@: Qxml_NoEscapes) // not sure >yet > >QxmlXMLFormatter_streamoutXMLCh(gFormatter@: %ADDR(chDoubleQuote)) //End >the >double quote >YIKES! Is there an easier way with the provided API's?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.