-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
BaseStreamWriter.writeSpace(String) should not close open element #95
Comments
Hmmh. Indentation mentioned was meant for for element indentation, and not for changing possible white-space between attributes. And But if you or anyone is interested in extending things to work for this usage as well, I think that would make sense. |
Unfortunately not. If I call the following methods, I get the exception from above
This is due to the fact that
That feels wrong and IMHO the javadoc should state this limitation more explicitly in |
We are always open for patches: I don't have time to work on this myself in near-term but I think this could be something easy for others to pick up so will label as such. |
This is tricky from a backwards-compatibility point of view as the API javadoc explicity says
(http://fasterxml.github.io/stax2-api/javadoc/3.1.4/org/codehaus/stax2/XMLStreamWriter2.html#writeRaw(java.lang.String)) |
Good point; it is bit of ambiguous case since without flushing like that possibly existing use cases could break. Not sure how to proceed here, however, since as a practical matter I do not think I want to start making changes to Stax2 API just for this use case. A likely workaround here might just be to instead use underlying |
Sometimes it is useful to also indent attributes within an element. For that
org.codehaus.stag2.writeSpace(String)
should be used. Unfortunately that will always close any open start tags so it cannot be used to indent attributes as internally it callswriteText
(woodstox/src/main/java/com/ctc/wstx/sw/BaseStreamWriter.java
Line 1175 in fee31c2
writeRaw(String)
as this prevents it being used for indenting attributes. Any subsequent calls ofwriteAttribute(...)
lead to exceptionThe text was updated successfully, but these errors were encountered: