Prefixes in results in Xspec HTML report
Post here questions and problems related to oXygen frameworks/document types.
Prefixes in results in Xspec HTML report
Hi all,
Does anybody know how to hide prefixes in HTML report? Please check attached picture https://photos.google.com/share/AF1QipM ... ppWkkyTkpn
As you can see there I want to compare value in one segment but instead of I have also all prefixes there.
How to use @href @select and @test correctly, if I want to see only comparable segments and their values without any prefixes?
Please share with me if you know.
Thank you in advance!
Alekso
Does anybody know how to hide prefixes in HTML report? Please check attached picture https://photos.google.com/share/AF1QipM ... ppWkkyTkpn
As you can see there I want to compare value in one segment but instead of I have also all prefixes there.
How to use @href @select and @test correctly, if I want to see only comparable segments and their values without any prefixes?
Please share with me if you know.
Thank you in advance!
Alekso
-
- Posts: 403
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: Prefixes in results in Xspec HTML report
Post by radu_pisoi »
Hi,
Unfortunately I don't know any option that can be used to hide prefixes in HTML report generated by XSpec.
Could you address this question to the XSpec project? I guess the guys that manage this project might have a solution for this problem.
https://github.com/expath/xspec
Unfortunately I don't know any option that can be used to hide prefixes in HTML report generated by XSpec.
Could you address this question to the XSpec project? I guess the guys that manage this project might have a solution for this problem.
https://github.com/expath/xspec
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Re: Prefixes in results in Xspec HTML report
radu_pisoi wrote:Hi,
Unfortunately I don't know any option that can be used to hide prefixes in HTML report generated by XSpec.
Could you address this question to the XSpec project? I guess the guys that manage this project might have a solution for this problem.
https://github.com/expath/xspec
Hi,
Thanks for your reply I will ask them then.
Br,
Alekso
Re: Prefixes in results in Xspec HTML report
Hi,
I can't see a way to hide prefixes in XSpec but you can use @select and nested scenarios to achieve something similar. Say you have this XML as starting point:
and you want to apply this simple identity transform in your XSLT:
you can run this XSpec test with @select in the contexts and a nested scenario:
which will give you this HTML report:
https://gist.githubusercontent.com/ciru ... prefix.png
The first context selects only the element Segment_Identifier, this allows you to show in the report which element is tested. The nested scenario inherits the context from the first scenario and select its text node which is finally compared in the expect part.
Note that with this workaround you have to write a test for each element you want to test in order to identify in the HTML report which element has the wrong value. Alternatively, you can replace in the first context Segment_Identifier with the more general node(). This will allow you to test every node with a single test but you won't know in the HTML report which element has the wrong value, you'll just see there is a wrong value in one of the elements.
Hope it helps...
Sandro
I can't see a way to hide prefixes in XSpec but you can use @select and nested scenarios to achieve something similar. Say you have this XML as starting point:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<Segment_Identifier xmlns:pkg="http://expath.org/ns/pkg" xmlns:impl="urn:x-xspec:compile:xslt:impl" xmlns:tllaa="tllaa">R000</Segment_Identifier>
Code: Select all
<?xml version="1.0" ?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- IdentityTransform -->
<xsl:template match="/ | @* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<x:description xmlns:x="http://www.jenitennison.com/xslt/xspec" stylesheet="prefix.xsl">
<x:scenario label="When processing <Segment_Identifier>">
<x:context href="prefix.xml" select="Segment_Identifier"/>
<x:scenario label="and extracting its text node">
<x:context select="node()/text()"/>
<x:expect label="the value should match">R001</x:expect>
</x:scenario>
</x:scenario>
</x:description>
https://gist.githubusercontent.com/ciru ... prefix.png
The first context selects only the element Segment_Identifier, this allows you to show in the report which element is tested. The nested scenario inherits the context from the first scenario and select its text node which is finally compared in the expect part.
Note that with this workaround you have to write a test for each element you want to test in order to identify in the HTML report which element has the wrong value. Alternatively, you can replace in the first context Segment_Identifier with the more general node(). This will allow you to test every node with a single test but you won't know in the HTML report which element has the wrong value, you'll just see there is a wrong value in one of the elements.
Hope it helps...
Sandro
Re: Prefixes in results in Xspec HTML report
cirulls wrote:Hi,
I can't see a way to hide prefixes in XSpec but you can use @select and nested scenarios to achieve something similar. Say you have this XML as starting point:
and you want to apply this simple identity transform in your XSLT:Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<Segment_Identifier xmlns:pkg="http://expath.org/ns/pkg" xmlns:impl="urn:x-xspec:compile:xslt:impl" xmlns:tllaa="tllaa">R000</Segment_Identifier>
you can run this XSpec test with @select in the contexts and a nested scenario:Code: Select all
<?xml version="1.0" ?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- IdentityTransform -->
<xsl:template match="/ | @* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
which will give you this HTML report:Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<x:description xmlns:x="http://www.jenitennison.com/xslt/xspec" stylesheet="prefix.xsl">
<x:scenario label="When processing <Segment_Identifier>">
<x:context href="prefix.xml" select="Segment_Identifier"/>
<x:scenario label="and extracting its text node">
<x:context select="node()/text()"/>
<x:expect label="the value should match">R001</x:expect>
</x:scenario>
</x:scenario>
</x:description>
https://gist.githubusercontent.com/ciru ... prefix.png
The first context selects only the element Segment_Identifier, this allows you to show in the report which element is tested. The nested scenario inherits the context from the first scenario and select its text node which is finally compared in the expect part.
Note that with this workaround you have to write a test for each element you want to test in order to identify in the HTML report which element has the wrong value. Alternatively, you can replace in the first context Segment_Identifier with the more general node(). This will allow you to test every node with a single test but you won't know in the HTML report which element has the wrong value, you'll just see there is a wrong value in one of the elements.
Hope it helps...
Sandro
Hi Sandro!
You're right, currently I will use this approach when I want to compare results in some segments. Of course it is better than nothing.
Thanks for your help!
Alekso
Return to “SDK-API, Frameworks - Document Types”
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