Mark Fletcher wrote:
> I'd like to be able to show repeatable elements as a labeled,
> comma-delimited list. For example, this xml:
>
> <topicmeta>
> <author>Author 1</author>
> <author>Author 2</author>
> <category>Category A</category>
> <category>Category B</category>
> <category>Category C</category>
> </topicmeta>
>
> should look like this:
>
> *author:*
> Author 1, Author 2
>
> *category:*
> Category A, Category B, Category C
>
>
> I've been able to come close with this CSS code:
>
>
> topicmeta > *:before {
>
> display: inline;
>
> content: ", ";
>
> vertical-align: bottom;
>
> }
>
> topicmeta > * {
>
> display: inline;
>
> vertical-align: bottom;
>
> }
>
> topicmeta > *:first-of-type:before {
>
> content: "";
>
> }
>
> topicmeta > *:first-of-type {
>
> display: inline;
>
> width: 20px;
>
> content: division(
>
> content(
>
> paragraph(
>
> content(
>
> element-name(),
>
> ": "
>
> ),
>
> font-weight, bold
>
> ),
>
> xpath(".")
>
> )
>
> )
>
> }
>
>
> This gives me this output:
>
> *author:* *category:*
> Author 1, Author 2 Category A, Category B, Category C
>
>
> But I'd like each element type to appear on the next line. I've tried
> adding:
>
> topicmeta > *:last-of-type {
>
> display: inline-block;
>
> padding-right: 500px;
>
> }
>
> and this can force the subsequent element to wrap, but not in any
> orderly fashion. (width: 100% doesn't have any effect) Is there a way
> to accomplish this?
I don't think so. Without wrapper elements such as "authors" or
"categories":
<topicmeta>
<authors>
<author>Author 1</author>
<author>Author 2</author>
</authors>
<categories>
<category>Category A</category>
<category>Category B</category>
<category>Category C</category>
</categories>
</topicmeta>
I'm affraid that you cannot do much.