basex-href-004
Test that unparsed-text works from BaseX
Test is expected to pass.
The pipeline
<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" name="main" version="3.0">
<p:output port="result" sequence="true"/>
<p:xslt>
<p:with-input port="source">
<doc/>
</p:with-input>
<p:with-input port="stylesheet">
<p:inline>
<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="#all" version="3.0">
<xsl:template match="/">
<text>
<xsl:sequence select="unparsed-text('basex://XProcUnitTestDB/testfolder/file.xml')"/>
</text>
</xsl:template>
</xsl:stylesheet>
</p:inline>
</p:with-input>
</p:xslt>
</p:declare-step>
Result
<text xmlns:t="http://xproc.org/ns/testsuite/3.0"><doc>It worked.</doc></text>
Filesystem environment
| Directory | Perm | Filename | Last-modified | Size | Encoding | Contents (abbreviated) |
|---|
| | .rwx | file.xml | | 21 | | <doc>It worked.</doc> |
Schematron checks
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron"
xmlns:t="http://xproc.org/ns/testsuite/3.0" queryBinding="xslt2">
<s:pattern>
<s:rule context="/">
<s:assert test="text = '<doc>It worked.</doc>'">The result is wrong.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 29 Oct 2025, Norm Tovey-Walsh
- Created test.