How to formulate a test for call-template and also provide an xml fragment (<context>)

83 views
Skip to first unread message

Bernhard Wagner

unread,
Sep 22, 2010, 5:45:51 AM9/22/10
to XSpec
I'm trying to port this test from utfx to xspec:

<utfx:test>
<utfx:name>test for named template 'findLanguage'</utfx:name>
<utfx:call-template name="findLanguage"/>
<utfx:assert-equal>
<utfx:source>
<dtb:dtbook xml:lang="de-CH"></dtb:dtbook>
</utfx:source>
<utfx:expected>
\usepackage[ngerman]{babel}&#10;
</utfx:expected>
</utfx:assert-equal>
</utfx:test>

This tests call-template while providing an xml fragment (<x:context>
in xspec.)

I believe this can't be formulated currently in xspec, since it seems
to be a mixture of the "Matching Scenario" and the "Named Scenario" in
xspec parlance. (See http://code.google.com/p/xspec/wiki/WritingScenarios#Matching_Scenarios
and http://code.google.com/p/xspec/wiki/WritingScenarios#Named_Scenarios).

Do you have suggestions how to translate this kind of test into xspec?
Or would this require xspec to be extended?

Thanks
Bernhard

Florent Georges

unread,
Sep 22, 2010, 6:22:40 PM9/22/10
to xspec...@googlegroups.com
On 22 September 2010 10:45, Bernhard Wagner wrote:

> This tests call-template while providing an xml fragment (<x:context>
> in xspec.)

> [...]

> Do you have suggestions how to translate this kind of test into xspec?
> Or would this require xspec to be extended?

I can be wrong , but I think there is no way to write such a test
with XSpec (please someone prove me wrong!)

This is unfortunately a general problem with XSpec, it fulfills very
easily most of the cases, but the language has not been designed at
once, and has a lot of such little corner cases. Some concepts are
not orthogonal enough, but this is difficult to change because there
is some legacy and existing code using the current design.

In this case, I guess we could overload the semantics of x:context
in case it is followed by an x:call[@template]. Something like:

<x:scenario>
<x:context>


<dtb:dtbook xml:lang="de-CH"/>

<x:context>
<x:call template="findLanguage"/>
...

I am not a big fan of overloading, but I cannot really think of
another name for x:context here...

Any idea?

Regards,

--
Florent Georges
http://fgeorges.org/

Bernhard Wagner

unread,
Oct 6, 2010, 11:58:22 AM10/6/10
to XSpec
Thank you, Florent.

How long do you estimate would it take to implement this feature?
Do you plan to implement it?
We're currently evaluating different xslt testing tools and this
particular scenario is of interest to us.

Thanks
Bernhard

Florent Georges

unread,
Oct 13, 2010, 6:17:17 AM10/13/10
to xspec...@googlegroups.com
On 6 October 2010 16:58, Bernhard Wagner wrote:

Hi,

> How long do you estimate would it take to implement this feature?
> Do you plan to implement it?

I'd like first to give a chance to hear from other people on
the list. Any idea? Any comment? For the context:

http://groups.google.com/group/xspec-users/browse_thread/thread/17b9ebef6033ef76/0b70e911876794f6

If people agree, or no one disagree, I guess this is not a big
deal. The most difficult part is to find some time to work on
it. Any contribution welcome ;-)

Reply all
Reply to author
Forward
0 new messages