Ok, I think I see what I'm not understanding. You don't use the
SaxRepresentation to create the xml. You use it to parse the events on
the fly. Is that correct? I can't find a way to write xml with it. I was
looking a using a pullparser, does that mean I need to use streams instead?
Stanczak Group wrote:
Ok, so I need to create a document on the server side? Then just
return the SaxRepresentation? That simple?
public SaxRepresentation(MediaType mediaType, Document xmlDocument) {
Stanczak Group wrote:
Little confused on how to use the SaxRepresentation. I have this:
@Override
public Representation getRepresentation(Variant variant) {
Representation result = null;
if (variant.getMediaType().equals(MediaType.APPLICATION_XML)) {
???? SaxRepresentation sax = new
SaxRepresentation(MediaType.APPLICATION_XML); ???? What do I do?
}
return result;
}
I'm not sure how to use it. I understand I need to create a subclass
of ContentHandler correct? But say I have a User object to parse, how
to I return this SaxRepresentation with that content handler and User
object?
--
Justin Stanczak
Stanczak Group
812-735-3600
"All that is necessary for the triumph of evil is that good men do nothing."
Edmund Burke