XSpec error
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 57
- Joined: Tue Jul 21, 2009 1:48 am
XSpec error
Hi, I'm struggling a bit with an error produced running an XSpec on my Schematron. The Schematron runs successfully against an instance, but when I run the XSpec it errors out: "XPDY0002: The context item for axis step root/Document is absent." I have isolated this to a variable defined in the pattern that selects an element value from the instance being validated:
$statusFilter then gets used in another variable where the error actually pops up. When I make $statusFilter just a sequence of string values (@value="'stable','deprecated'"), the XSpec runs. I've attached the items in question (just unzip and fix the RegistryPath var as appropriate), any help would be appreciated. (let me know if the attachment didn't work - couldn't tell if it did or not).
Code: Select all
<sch:let name="statusFilter" value=" if(//status = ('production','sample'))
then ('stable','deprecated') else ('unstable','stable','deprecated') " />
xspec-error.7z
You do not have the required permissions to view the files attached to this post.
-
- Posts: 57
- Joined: Tue Jul 21, 2009 1:48 am
Re: XSpec error
After reviewing some of the details of the XSpec documentation this weekend I found the issue. Seems that you must set the XSpec x:documentation/@run-as attribute to "external" for the global context item to be the x:context content. This would seem to be a good default to have, however not fully understanding what else it impacts (it's 'experimental' according to the docs) I guess it's just something to be aware of when you have global variables outside of a rule context. Hope this helps someone else who runs into the problem - it certainly stumped me for a long while!
Thanks, Scott
https://github.com/xspec/xspec/wiki/Ext ... ntext-item
Thanks, Scott
https://github.com/xspec/xspec/wiki/Ext ... ntext-item
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: XSpec error
Post by alex_jitianu »
Hi Scott,
Thank you for sharing this with the Oxygen community. Indeed, "export" does sound as a good default value, but the people from the XSpec community probably know better. You can record an issue to change the default and see what they have to say about it: https://github.com/xspec/xspec/issues
Best regards,
Alex
Thank you for sharing this with the Oxygen community. Indeed, "export" does sound as a good default value, but the people from the XSpec community probably know better. You can record an issue to change the default and see what they have to say about it: https://github.com/xspec/xspec/issues
Best regards,
Alex
-
- Posts: 12
- Joined: Fri Mar 04, 2022 12:27 pm
Re: XSpec error
Allow me to ask a similar question, yet a little different:
my local testing environment is rather easy:
I have a directory in which my xsl as well as the acompanying xpsec file reside:
let's name them tei-transcript.xsl and tei-transcript.xspec, wich are the names they actually have.
I get the following error upon attempting to have the tei-transcript.xspec executed:
The actual XSL contains a single template were I count all <lb>-elements annd output them in html-<span class="lineNumber">.
Any hints, or should I open a new thread?
my local testing environment is rather easy:
I have a directory in which my xsl as well as the acompanying xpsec file reside:
let's name them tei-transcript.xsl and tei-transcript.xspec, wich are the names they actually have.
I get the following error upon attempting to have the tei-transcript.xspec executed:
the code of the xspec is rather easy at the moment, tis is neither a minimal reproducable example nor am I missing sth., I just wanted to start implementing tests for XSL today:System-ID: /home/kevin/Dokumente/pa000008/xsl/tei-transcript.xspec
Umwandlung: Run XSpec Test
Build-Datei: /home/kevin/Dokumente/pa000008/xsl/build.xml
Dokumenttypen: XSpec
Programmname: ANT
Fehlerlevel: fatal
Beschreibung: Transformation failed. /home/kevin/.com.oxygenxml/extensions/v24.1/frameworks/com.oxygenxml.xspec.XSpecSupportFramework/xspec.support-2.2.6/build.xml:443: Java returned: 2
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<x:description xmlns:x="http://www.jenitennison.com/xslt/xspec"
xmlns:tei="http://www.tei-c.org/ns/1.0" stylesheet="tei-transcript.xsl"
>
<x:scenario label="Scenario for testing function lb">
<x:call template="tei:lb"/>
<x:expect label="Not yet implemented" select="'Not yet implemented'"/>
</x:scenario>
</x:description>
Code: Select all
<template match="tei:lb"/>
Any hints, or should I open a new thread?
-
- Posts: 57
- Joined: Tue Jul 21, 2009 1:48 am
Re: XSpec error
You might want a new thread for this... I haven't done XSLT testing with XSpec yet but you might try the @run-as="external" on <x:description> just to see if something changes. I have yet to figure out what exactly it does but it has solved some XSpec problems for me. You might also want to try a XSLT template that's not completely empty. Just my thoughts... sometimes you just have to try stuff until it works
I definitely recommend using XSpec - it works great even if it's a bit tricky to use sometimes. Good luck!
Scott

Scott
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: XSpec error
Post by alex_jitianu »
Hi,
When the XSpec fails there are two tabs opened. One of them has the name ANT [Run XSpec Test] and contains the transformation log. In it you can find additional information about why it failed.
At a glance, it looks like you have a match template so you need to create a matching scenario. Only if you have a named template, for example can you call it like this:
Best regards,
Alex
When the XSpec fails there are two tabs opened. One of them has the name ANT [Run XSpec Test] and contains the transformation log. In it you can find additional information about why it failed.
At a glance, it looks like you have a match template so you need to create a matching scenario. Only if you have a named template, for example
Code: Select all
<xsl:template name="tei:lib">
Code: Select all
<x:call template="tei:lb"/>
Alex
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service