-
Notifications
You must be signed in to change notification settings - Fork 10
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
You can't serialize a free-floating attribute node #1131
Comments
Having fixed a bug where I was doing TVTs in text/plain incorrectly, I have to say I'm unhappy with the results. Consider: <p:with-input>
<p:inline content-type="text/plain" expand-text="false"><![CDATA[
print("<?xml version='1.0'?>")
print(f"<doc>Testing {x*y}</doc>")
]]></p:inline>
</p:with-input> Unless I've done something else wrong, absolutely a possibility, that produces:
Which is ... utterly useless. |
Setting aside, for a moment, the annoying problem of backwards incompatibility, having the TVT output be special variation on |
Yes, I think that makes much more sense. Seriously I can't hardly think about a use case for adding nodes with method "xml" here. |
Can’t we tell people to write |
Document that it's technically incompatible, but can't possibly be useful. Editor to figure out what to do with the error code. Agree with Gerrit, use |
I couldn't find a suitable error so I added |
Fix xproc#1131 1. Make the backwards-incompatible change that TVTs are serialized as text, not XML, when they occur in content types that are not XML or HTML content types. 2. Correct the examples, observing that special case has to be taken with quotes in JSON. 3. Add explicit error (err:XD0052) for attempting to output a free-floating attribute node if the content type is not XML or HTML.
In the section on text value templates, we say that inserting XML into a non-XML document via a TVT inserts the serialization. But there's evidence in the wild of this usage:
with the expectation that the value of the name attribute is inserted. Either we need to special case inserting free-floating attributes or that's an error.
The text was updated successfully, but these errors were encountered: