On 7/26/10 2:25 PM, Tony Giaccone wrote: > Felix, > > While that's interesting, it's not exactly what I had in mind. > > > Can i generate my own xml, by creating a JSP that does the transformation in > the same way, I can for html? > > For example from the 15 min example.. > > a JSP put at: > > /apps/foo/bar/html.esp > > generates the html for that node.. > > If I put a JSP at: > > /apps/foo/bar/xml.esp > > Will that then be called to generate the XML? I suppose the easiest way to > test that would be to put one there and see what happens, but I guess I want > to know if it works and if there's any kind of flaw with that idea.
Yes. Assuming that your resource type is foo/bar or foo:bar. > > > Tony > > > On Jul 26, 2010, at 2:09 PM, Felix Meschberger wrote: > >> Hi, >> >> The default XML renderer of Sling (provided by the Sling Default GET >> Servlets bundle) uses JCR Document View export to generate XML. If you >> want JCR System View export, specify the "sysview" selector as in >> >> http://host/content/path.sysview.xml >> >> Hope this helps. >> >> Regards >> Felix >> >> On 26.07.2010 18:43, Tony Giaccone wrote: >>> >>> >>> I've been playing around with generating XML outputs based on the data >>> that's passed in, and I'm curious about how Sling >>> decides what to use as the tag for the stanza of xml.. >>> >>> >>> I used this curl to insert a document into my repository... >>> >>> >>> curl -D - -F"sling:resourceType=mjb/blog" -F"seq=105" -F"firstName=Roberta" >>> -F"lastName=Chambers" >>> "http://admin:ad...@localhost:8080/sling/content/blog/*" >>> >>> >>> And got this data: >>> >>> <_x0033__1280162305912 jcr:primaryType="nt:unstructured" >>> firstName="Roberta" lastName="Chambers" seq="105" >>> sling:resourceType="mjb/blog" xmlns:ocm="http://jackrabbit.apache.org/ocm" >>> xmlns:fn="http://www.w3.org/2005/xpath-functions" >>> xmlns:fn_old="http://www.w3.org/2004/10/xpath-functions" >>> xmlns:xs="http://www.w3.org/2001/XMLSchema" >>> xmlns:jcr="http://www.jcp.org/jcr/1.0" >>> xmlns:mix="http://www.jcp.org/jcr/mix/1.0" >>> xmlns:sv="http://www.jcp.org/jcr/sv/1.0" >>> xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:rep="internal" >>> xmlns:nt="http://www.jcp.org/jcr/nt/1.0"/> >>> >>> >>> That tag <_ x0033__1280162305912 is really not what I want there. What i'd >>> like to see is >>> >>> <blog blog_id=033__1280162305912 >>> >>> >>> Is there a way to change how that tag is generated? >>> >>> >>> Tony > >
