XML one-liner (if possible)

viktoras d. viktoras at ekoinf.net
Tue Jul 13 18:35:23 EDT 2010


Thank you Colin, Mark!

Changing point of view is refreshing! I rolled out a solution which is 
getting unreasonably complex using all the revXML stuff and finally got 
suck... Now after seeing your examples I  realized that the simplest way 
to display xml with known schema is to transform it by simply replacing 
xml tags with html in the source text and setting htmltext of field to 
it (!).

Best wishes!
Viktoras

Mark Wieder wrote:
> viktoras-
>
> Tuesday, July 13, 2010, 2:19:41 PM, you wrote:
>
>   
>> err., what's the simplest way of displaying all contents of an XML 
>> document in a rev field? e.g. getting a list of all elements with all
>> their attributes and values. Is there a simple way to do this - a one
>> liner probably ;-) ?
>>     
>
> I'm not sure this can be done in one line, but...
>
> place a browser control and a button onto your stack and then:
>
> -- button scrips
> on mouseUp pMouseBtnNo
>     local tBrowserID
>     
>     answer file "where is the file?"
>     if it is not empty then
>         put revBrowserOpen(the windowID of this stack, "file:" & it) into tBrowserID
>         revBrowserSet tBrowserID, "rect", the rect of image "browserimage"
>     end if
> end mouseUp
>
>   




More information about the use-livecode mailing list