[Home] [By Thread] [By Date] [Recent Entries]
Inspired by an issue on another list (JAXB), I'd like to ask whether someone here has ever seen or heard about an XSLT replacing all the @ref by their respective target? I think I would first build a "grand schema" document by finding the transitive closure of all the includes/imports and expanding the document-level defaults such as targetNamespace, blockDefault, elementFormDefault etc into the individual components. Then define a key on the unique name of the component - concatenation of symbol space, target namespace, and local name. Then your transformation can find the @ref attributes (and similar, e.g. @type, @itemType), construct the composite key, and use the key() function to find the component in this "grand schema". That still leaves you a few problems, however. For example, it simply isn't possible in XSD to move a referenced component inline if it is in a different target namespace. So perhaps you only want to move element and attribute declarations inline if they are in the same namespace - perhaps in the same schema document even - in which case it becomes much simpler because they all have the same document-level defaults. Michael Kay Saxonica
|

Cart



