DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Validation Error with conref

  • edwardwoodward

    Validation Error with conref

    Participants 4
    Replies 5
    Last Activity 9 years, 12 months ago

    Hello,
    I'm using XMetaL(R) Author Enterprise 6.0 (Japanese).
    XMetaL gives me validation errors in the source when I link by conref to valid content in the target. For example, if I link to a table element, it says a required element is missing, so I have to add a tgroup (and then a cols attribute) to get rid of the error. Is it OK to ignore these errors? My understanding of conref is that it includes all of the content under the target element. Is that not correct?

    Thanks in advance.

    Reply

    Derek Read

    Reply to: Validation Error with conref

    In DITA most elements do not have required children or attributes so this issue doesn't come up. Table is probably the only construction that has required elements. XMetaL allows you to render the referenced content (and it does so by default) but for validation it does not replace the local content with the referenced content, only the local content is used.

    So, if you conref a table the local copy of the table must still have the minimum of required elements for the referencing document to be valid. The same would be true if you conref a tgroup (must have a tbody), tbody (needs a row), or row (must have an entry).

    Reply

    Derek Read

    Reply to: Validation Error with conref

    If you insert your table using the Insert Table option from the Insert menu then you won't need to worry about the construction of the (local) table element markup.

    Reply

    edwardwoodward

    Reply to: Validation Error with conref

    Thanks for the replies.
    It makes sense, but it would make more sense (to me, with my admittedly limited knowledge of DITA) not to get a validation error if you are using conref correctly.
    I like the idea of just setting the conref and not having to worry about about the content under the element containing conref.

    Anyway, understood, cheers.

    Reply

    Derek Read

    Reply to: Validation Error with conref

    I see where you're coming from, but DITA conref is not like XML entities (the closest thing I can think of to what you are suggesting).
    DITA conref is more along the lines of XInclude (if you must equate it to something, though they differ in some respects).

    According to the XML recommendation (W3C) an entity is expanded before validation occurs and that might allow you to do the type of thing you are thinking of. This can be done because entities are part of the XML recommendation and so this special step (expand the entity before validating) is performed by validating XML processors.

    DITA, as an application of XML, basically sits on top of the XML rules and cannot override those rules or inject new ones, instead it must work within those existing XML validation rules. That means each XML document must be valid unto itself and you cannot rely on a validating XML processor to break those rules and make an exception for specific document types or other specifications. First and foremost XMetaL Author Enterprise is an XML authoring tool and so it obeys the XML rules for validation, which is not to say that DITA breaks those rules. DITA is designed to work within them.

    Reply

    Derek Read

    Reply to: Validation Error with conref

    A couple of more points pointed out by a colleague…

    In the case where the conref resolution fails the local content is there for fallback output (this is another similarity with XInclude, though XInclude defines an explicit element). If the local content is not valid then output should fail completely. Having said that, I think most people do not anticipate this need so their local content is usually left “empty”. However, the possibility is there.

    The -dita-use-conref-target value for attributes is another case where the DITA spec recognizes the need for XML validity. It is there to support the case where you may not want to use the local attribute value when an attribute is required: http://docs.oasis-open.org/dita/v1.1/OS/langspec/common/ditauseconreftarget.html

    Reply

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

Lost Your Password?

Products
Downloads
Support