You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Thomas Peuss (JIRA)" <ji...@apache.org> on 2007/09/26 16:25:50 UTC

[jira] Commented: (SOLR-285) Server Side XSLT for update processing

    [ https://issues.apache.org/jira/browse/SOLR-285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12530453 ] 

Thomas Peuss commented on SOLR-285:
-----------------------------------

The major problem I have with this solution is that it holds the whole transformed document in memory. My suggestion is to use a stream transformation technology like Joost (http://joost.sourceforge.net/). Here is a little snippet what you can do:
           PipedReader read=new PipedReader();
           PipedWriter writer=new PipedWriter(read);
			Processor proc = 
			   new Processor(new InputSource(new FileReader("order-group.stx")), pContext);
            StreamEmitter emitter = StreamEmitter.newEmitter(writer,
                    "UTF-8",proc.outputProperties);
            proc.setContentHandler(emitter);
            proc.setLexicalHandler(emitter);

            proc.parse(new InputSource(new FileReader("order.xml")));

            BufferedReader bufRead=new BufferedReader(read);
            System.out.println(bufRead.readLine());

So you can give this Reader directly to the XmlUpdateHandler then and you are done without buffering the transformed document in memory.

The downside of course is that you have to provide STX-files instead of XSL-files. But the syntax is very similar.

What do you think?

> Server Side XSLT for update processing
> --------------------------------------
>
>                 Key: SOLR-285
>                 URL: https://issues.apache.org/jira/browse/SOLR-285
>             Project: Solr
>          Issue Type: New Feature
>          Components: update
>            Reporter: Hoss Man
>         Attachments: xslt_updater.diff
>
>
> Ideally, we should support a way for people to specify send XML ContentStreams to Solr and do server side XSLT processing to convert it (much like the XSLTResposneWriter supports server side XSLT processing of responses.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.