[plt-scheme] Need help with struct:html
Brian Beckman writes:
> Looking at the html library documentation in HelpDesk gives me the
> following...
>
> --- begin quote ---
>
> Pcdata, Entity, and Attribute are defined in the XML documentation.
>
> > Html-content = Html-element | Pcdata | Entity
>
> > Html-element = any of the structures below which all inherit from
> (define-struct html-element (attributes)). Any html tag that may
> include content also inherits from
> (define-struct (html-full struct:html-element) (content))
> without adding any additional fields.
>
> A Html is
> (make-html (listof Attribute) (listof Contents-of-html))
>
> A Contents-of-html is either
> - Body
> - Head
>
> ...
>
> --- end quote ---
>
> so, I try things like
>
> (html-Html-content s)
> (html-content s)
> (Html-content s)
> (html-element s)
> (Html-element s)
> (html-Html-element s)
> (html-Body s)
> (html-Contents-of-html s)
> (Contents-of-html s)
>
> and so on ... getting nothing but errors of various kinds, mostly
> "undefined identifier".
I think you want `html-full-content'; that's the accessor for the
`content' field of the `html-full' struct, which every tag that can
have content will inherit from. I agree this documentation is rather
obfuscated.
--dougo at place.org