Project

Profile

Help

Bug #3225

closed

Adaptive and JSON output methods using JAXP interfaces

Added by Radu Coravu almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
JAXP Java API
Sprint/Milestone:
-
Start date:
2017-05-18
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.7
Fix Committed on Branch:
9.7, trunk
Fixed in Maintenance Release:
Platforms:

Description

Two kind of related problems.

  1. Using this XSLT:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    exclude-result-prefixes="xs"
    version="3.0">
    <xsl:output method="json" media-type="application/json"></xsl:output>
    <xsl:template name="main">
        <xsl:sequence select="json-doc('http://ip.jsontest.com')"></xsl:sequence>
    </xsl:template>
</xsl:stylesheet>

and transforming using the JAXP interfaces gets us:

> ; SystemID: file:/C:/Users/radu_coravu/Desktop/test.xsl; Line#: 8; Column#: 9
> net.sf.saxon.trans.XPathException: Cannot write a function item to an XML tree
> 	at net.sf.saxon.event.SequenceWriter.append(SequenceWriter.java:387)
> 	at net.sf.saxon.event.ProxyReceiver.append(ProxyReceiver.java:233)
> 	at net.sf.saxon.event.ProxyReceiver.append(ProxyReceiver.java:233)
> 	at net.sf.saxon.event.SequenceReceiver.append(SequenceReceiver.java:124)
> 	at net.sf.saxon.event.ComplexContentOutputter.append(ComplexContentOutputter.java:622)
> 	at net.sf.saxon.expr.Expression.process(Expression.java:911)
> 	at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:259)
> 	at net.sf.saxon.Controller.transformDocument(Controller.java:2434)
> 	at net.sf.saxon.Controller.transform(Controller.java:1985)
> 	at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:590)
> 	at net.sf.saxon.jaxp.TransformerImpl.transform(TransformerImpl.java:185)
  1. Using this XSLT:
<xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="3.0">
    <xsl:output method="adaptive"/>
    
    <xsl:template name="main">
        <xsl:sequence select="[1, 2, 3]"/>
    </xsl:template>
</xsl:stylesheet>

and transforming using JAXP obtains the result "1 2 3" instead of "[1,2,3]"

Please register to edit this issue

Also available in: Atom PDF