Defining if a Specific XSLT was Created for a Given XML
As we described last week, we will implement a tool that receives an XML file and verify the existence of a XSLT file that is able to perform the transformation on the XML.
In order to fully define the different situations, we had to take some assumptions. The assumptions are taken in the basis that a XSLT file only transforms a XML when all of its requested XPaths exist in the XML.
Having this basis, we define that the XSLT and XML have a complete match when their XPath sets are equal, as you can see in the picture bellow.This means that for each XML XPath there is a XSLT transformation, and therefore, the mapping already exists and the complete transformation can be done.



In these cases, the mapping will be done manually by the user.
Finally, we assume that there is a partial match between a XML and a XSLT if all the elements in the XSLT XPath set exist in the XML XPath set. This assumption is taken in the cases like the one in the picture bellow.
Wen we have the partial match, the user gets the chance to select which XSLT file should be used for the transformation.
We intend to divide the incoming files in one of the types mentioned above.
In order to fully define the different situations, we had to take some assumptions. The assumptions are taken in the basis that a XSLT file only transforms a XML when all of its requested XPaths exist in the XML.
Having this basis, we define that the XSLT and XML have a complete match when their XPath sets are equal, as you can see in the picture bellow.This means that for each XML XPath there is a XSLT transformation, and therefore, the mapping already exists and the complete transformation can be done.
If, for any given reason, the XSLT XPath set has, at least, an element that does not belong to the XML XPath set, then we consider that there is no match. We assume this because the XSLT would never be able to do his 'job' - the transformation - if all the elements he refers don't exist on the XML. The specific cases are shown in the pictures bellow.



In these cases, the mapping will be done manually by the user.
Finally, we assume that there is a partial match between a XML and a XSLT if all the elements in the XSLT XPath set exist in the XML XPath set. This assumption is taken in the cases like the one in the picture bellow.
Wen we have the partial match, the user gets the chance to select which XSLT file should be used for the transformation.We intend to divide the incoming files in one of the types mentioned above.

1 Comments:
This comment has been removed by a blog administrator.
By
Anonymous, at 20 November, 2006 13:15
Post a Comment
<< Home