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

CalendarResource should output correct XML #51

Closed
michaelwechner opened this issue Nov 20, 2012 · 4 comments
Closed

CalendarResource should output correct XML #51

michaelwechner opened this issue Nov 20, 2012 · 4 comments
Assignees
Labels

Comments

@michaelwechner
Copy link
Member

When requesting

http://127.0.0.1:8080/yanel/my-realm/calendar.ics?yanel.resource.viewid=xml

then a well-formed XML will be dumped (named calendar.xml) beside calendar.ics inside the realm repository, but the browser does not receive the complete XML, but rather complains about not closed tokens. Please note that 'my-realm' is just an example.

An existing sample can be accessed

http://127.0.0.1:8080/yanel/test/use-cases/calendar.ics?yanel.resource.viewid=xml

assuming that you have the default source version of Yanel installed.

@ghost ghost assigned michaelwechner Nov 20, 2012
@michaelwechner
Copy link
Member Author

I cannot reproduce this issue when using the sample at

http://127.0.0.1:8080/yanel/test/use-cases/calendar.ics

but I can reproduce the problem, that when adding special characters like for example ü,ä, ü that the XML won't be well-formed anymore.

I think the problem is that

src/resources/calendar/src/java/org/wyona/yanel/impl/resources/calendar/CalendarEvent.java#toXML() is using StringBuffer instead the org.w3c.dom classes!

@michaelwechner
Copy link
Member Author

The problem was that the method

src/resources/calendar/src/java/org/wyona/yanel/impl/resources/calendar/CalendarResource.java#getSize()

was not implemented correctly. When requesting the XML view, then the size of calendar.ics was returned anyway, but which of course did not fit, and hence the InputStream was often closed to early

@michaelwechner
Copy link
Member Author

We should still improve the StringBuffer issue

src/resources/calendar/src/java/org/wyona/yanel/impl/resources/calendar/CalendarEvent.java#toXML() is using StringBuffer

@michaelwechner
Copy link
Member Author

StringBuffer has now been replaced by DOM

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

No branches or pull requests

1 participant