C. Mar
C. Mar

Reputation: 149

XSLT: How to test css styles?

I have XSL file that transform an input xml files by particular convention.

Among other things, during the conversion, I add CSS styles to some of the HTML tags [implemented in an external CSS file.]

for example:

    <xsl:template match="title">
        <div class="title">
            <xsl:apply-templates/>
        </div>
    </xsl:template>
.title {
    text-align: center;
    font-weight: bold;
    border-style: solid;
}

I want to write a XSL test template that when I run it, I can keep track of changes made to the CSS file.

Does anyone have any idea how to do this?

Upvotes: 1

Views: 161

Answers (1)

Joel Bodenmann
Joel Bodenmann

Reputation: 2282

Making my comment become an answer.

If I understand you correctly you want to run the XSLT and then get a list of changes that were applied, right? I'm fairly new to XSLT but I don't think that you will find a feature like this as part of XSL. However, you can always take the original file and the transformed one and perform a diff using any of the available diff tools. If your XSLT is part of a larger workflow it should be fairly easy to automate this.

If on the other hand you want a unit test, check out XSpec.

Upvotes: 1

Related Questions