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

cdata-section-elements attribute in xsl:output does not seem to be respected in pipeline-step #10

Open
siebej opened this issue Jul 12, 2021 · 1 comment

Comments

@siebej
Copy link

siebej commented Jul 12, 2021

I have declared a cdata-section-elements attribute and also declared output:serialization-parameters. When I use this in stand-alone transformation using saxon-he 10.5 (i.e. using XML Developer), the elements mentioned in the cdata-section-elements attribute are nicely put into a <![CDATA[the content of the element mentioned in the cdata-section-elements attribute is here]]>

When I use this same xslt in a pipeline-step, they don't end up in a cdata.

@maartenkroon
Copy link
Contributor

Hi Siebe,

Attributes that are specified on an xsl:output element (like "indent", "encoding" and indeed "cdata-section-elements") are instructions to the serializer (from tree to string). In a transformation that does not serialize the result to a string (like the intermediate steps in an XSLWeb pipeline, which transform directly to a new "TinyTree"), the xsl:output attributes are completely ignored by Saxon.

Keep in mind that XSLWeb always performs an additional stylesheet transformation after the last transformation in the pipeline (home/common/xsl/system/response/response.xsl). That is why XSLWeb copies all xsl:output attributes from your last transformation step in the pipeline to this additional transformation.

In short, xsl:output attributes (including cdata-section-elements) must be set on the last transformation step of your pipeline to effect the final serialized result. I just tested this with the cdata-section-elements attribute and it works. If it doesn't work in your case please provide a small sample in which the problem can be reproduced.

Maarten

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

No branches or pull requests

2 participants