Manuel Collado wrote:
> Hussein Shafie escribi?:
>> Goh, Swee-Doon (GPMS) wrote:
>>> I was trying to implement the XML tag view using the stylesheet. While I
>>> could make them look close to what I need, it takes quite a bit of time.
>>> I suspect there is generic stylesheet that can do this. Does this exist?
>> [...]
>> What is called a tag view is
>> something different: it's a graphical view showing formatted blocks
>> where start and end tags are depicted using nice, labeled, icons.
>>
>>> I like the tree view, and I?d like to
>>> know if there is any possibility to support tag view as well.
>>>
>>> What would you suggest for the XML tag view? 
> 
> Just a naive suggestion, that works for any document type:
> 
> ------------------
> * {
>     display: block;
>     margin-left: 1em;
> }
> 
> *:before {
>     display: inline;
>     background-color: yellow;
>     content: xpath("name()") ">";
> }
> 
> *:after {
>     display: inline;
>     background-color: yellow;
>     content: "<" xpath("name()");
> }
> ------------------
> 
> You can add collapsers if you want, or use local-name() instead of 
> name() to get rid of namespace prefixes.
> 

I think it works fine, except that the:

* {
    display: block;
     margin-left: 1em;
}

may not be exactly what you expect from a tag view. Example: it would be
nicer (and more compact) to see a para displayed as a block, while
literal, emphasis, etc, displayed a inlines.

Many thanks for this interesting contribution!



Reply via email to