Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline script #6

Closed
bertfrees opened this issue Feb 13, 2014 · 4 comments · Fixed by #17
Closed

Inline script #6

bertfrees opened this issue Feb 13, 2014 · 4 comments · Fixed by #17

Comments

@bertfrees
Copy link
Member

Support defining an XProc script inline in the XProcSpec test. (This is just an idea, I have no actual use case for it yet, but it seems useful.)

@rom1mouret
Copy link
Collaborator

I do call some XProc filters to post-process the result in order to make the <p:except type="compare"> simpler to use, especially when some ids have been randomly generated by the script to test. Inline XProc would be useful for this indeed. In the meantime, the <x:call script="..."> can call an XProc step wrapper that includes the filter.

@josteinaj
Copy link
Member

There should be support for defining your own type of assertions. Check out
this for an example of an assertion that tests for an xml declaration:

https://github.com/josteinaj/nordic-epub3-dtbook-migrator/blob/master/nordic-epub3-dtbook-migrator/src/test/xprocspec/epub3-to-dtbook.xprocspec
https://github.com/josteinaj/nordic-epub3-dtbook-migrator/blob/master/nordic-epub3-dtbook-migrator/src/test/xprocspec/xprocspec-assert-xml-declaration.xpl

As for unpredictable values, you can test portions of the result but that's
not always a solution. XSpec let's you put three dots ("...") in attribute
values and text nodes to represent "any content here". Would that be a good
solution?

Would you like some filtering functionality added to the context element as
well?
13. feb. 2014 18:48 skrev "Romain Mouret" [email protected]
følgende:

I do call some XProc filters to post-process the result in order to make
the simpler to use, especially when some ids have been randomly generated
by the script to test. Inline XProc would be useful for this indeed. In the
meantime, the can call an XProc step wrapper that includes the filter.


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-35005198
.

@bertfrees
Copy link
Member Author

We're a bit wandering of track now, but anyway, here is another example were custom assertions are used:

https://github.com/daisy-consortium/pipeline-mod-braille/blob/master/pipeline-braille-utils/liblouis/liblouis-formatter/src/test/xprocspec/test_format.xprocspec
https://github.com/daisy-consortium/pipeline-mod-braille/blob/master/pipeline-braille-utils/liblouis/liblouis-formatter/src/test/xprocspec/pef-compare.xpl

This works great for me. The three dots would be a nice additional feature, although I don't think I would use it. I also have to deal with randomly generated identifiers, but that was not the only reason for creating a special pef:compare step.

@josteinaj josteinaj self-assigned this Feb 13, 2014
@josteinaj josteinaj added this to the 1.1 milestone Feb 14, 2014
@josteinaj
Copy link
Member

allow

<x:script>
    <p:declare-step/>
</x:script>

as the first child of x:description as an alternative to the x:description/@script attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants