At 5:32 PM +0100 1/26/06, you wrote:
Hi List!

The XML Parser Xtra converts XML-formatted text into a Lingo property list.

Now, I need to do the opposite: I have a property list and would like to
convert that into an XML text.

Should be possible to code that in Lingo, but I don't know XML very well nor
am I good in programming recursions which I think would be necessary.

Is there an Xtra or script out there that does that for me?

Thanks
Michael

Hi Michael,

While setting the #type to #field will get you a GPDL popup with all the field members of a movie, you might need a smaller sunset of them. This is also doable.

If you build a list of the fields that you want to use within the GPDL, it can be used as the elements of the GPDL popup. The below offers a list of the names of the fields that are within castLib 1 & ignores any other fields within the movie.

If you want to limit it to a set of known members. just make a list & use that.

on getPropertyDescriptionList me
  GPDLprops = [:]

  -- make a list of fields
  castNo = 1
  castCnt = the number of members of castLib castNo
  fieldNames = []
  repeat with i = 1 to castCnt
    if member(i, castNo).type = #field then
      fieldNames.append(member(i, castNo).name)
    end if
  end repeat

  if fieldNames <> [] then
    -- if there are fields, then use the list elements in the GPDL popup
    GPDLprops[#myListChoice] = [ \
   #comment: "Field choices", \
   #format: #string, \
   #range: fieldNames, \
   #default: fieldNames[1] \
  ]
  else
    -- if NOT, exit so the behavior won't get attached !! (& ALERT)
    ALERT "no valid fields"
    exit
  end if

  return GPDLprops
end getPropertyDescriptionList

hth
-Buzz
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
lingo-l@penworks.com  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to