General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion XMax and CSS – Style based on Attribute Problem

  • craig_83

    XMax and CSS – Style based on Attribute Problem

    Participants 1
    Replies 2
    Last Activity 13 years, 5 months ago

    I am using XMetal Developer (Visual Studio 2009 add on) to create CSS for my XMax control.

    I want style and XML element based on its attribute value, for example:


              …
       

    In the style sheet this is defined as:

    Questions[ParagraphFormat=”Item”] {
      margin-bottom: 10pt;
      padding-top: 6px;
      padding-left: 4px;
      border: 1pt navy solid;
    }

    However, this formatting is not being applied. I have tried a few other elements and even tried a wildcard e.g. *[ParagraphFormat=”Item”], but the style is not being picked up. All the other styles, based on elements, work, the problem is just with styles based on attributes.

    What could be the reason for this?

    Reply

    craig_83

    Reply to: XMax and CSS – Style based on Attribute Problem

    I managed to solve this problem.

    The style needed to inclued 'display: block;'. That's why, for example, the border wasn't being displayed. This obviously makes sense as you can only apply border elements to block elements when using HTML etc.

    Reply

    Derek Read

    Reply to: XMax and CSS – Style based on Attribute Problem

    Your assumption is correct for our products (that many CSS settings are only applicable to elements displayed as block).

    Just to clarify though, the same is not true for most modern HTML browsers. However, we don't claim that our products are equivalent (or will ever be equivalent) to an HTML browser. An HTML browser has to be perfect at one thing: rendering HTML (perhaps several slightly different versions, but HTML nonetheless). Our editors must allow clients to render the content for [u]any[/u] DTD or Schema in a meaningful and easy to edit way.

    So, the primary goal for us is to provide enough CSS formatting capability to make it possible to edit an XML (or SGML) document comfortably. A secondary goal for many of our clients that we try to fulfill to some extent is to have the editing view match their output fairly closely (some would like it to be exact). However, as it is possible to transform your XML or SGML into any conceivable output format we may never allow you to accomplish that goal entirely, though in many cases you can often come fairly close (the “good enough” factor).

    In fact, we have some clients that actually purposefully style their content very differently from any of their output formats so that their authors completely ignore what that final output will appear as and force them to concentrate purely on the content. Of course, this does not mean the content is not displayed in an easy to read and edit fashion.

    Some people have begun referring to the content displayed in XML editing software (any XML editing software, not just ours, and when it supports such a feature) not as WYSIWYG but as WYSIWOO: What You See Is One Option.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support