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 "Hoss Man (JIRA)" <ji...@apache.org> on 2007/07/03 02:34:04 UTC

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

Server Side XSLT for update processing
--------------------------------------

                 Key: SOLR-285
                 URL: https://issues.apache.org/jira/browse/SOLR-285
             Project: Solr
          Issue Type: New Feature
            Reporter: Hoss Man


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.


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

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man updated SOLR-285:
--------------------------

    Component/s: update

> 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.


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

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man updated SOLR-285:
--------------------------

    Attachment: xslt_updater.diff

this is mainly just a proof of concept ... there is a lot of room for improvement here .. this reuses the same TransformerProvider as the XSLTResposneWriter but doesn't even try to use hte cache (even if it did, using it in conjunction with XSLTResposneWriter would constantly invalidate the cache)

the biggest improvement would be to find someway to pipeline the XSLT transformation into the Stax parsing ... i tried to at least use a DOMResult for hte transformer and a DOMSource for the XMLStreamReader but i got this exception...

SEVERE: java.lang.UnsupportedOperationException: XMLInputFactory.createXMLStreamReader(javax.xml.transform.dom.DOMSource) not yet implemented
        at com.bea.xml.stream.MXParserFactory.createXMLStreamReader(MXParserFactory.java:70)

...oh well.


patch also includes a simple rss2solr.xml stylesheet that does some very simplistic/silly transformations to match the example schema.xml


comments from people who understand javax.xml.* better then i do would be greatly appreciated.

> Server Side XSLT for update processing
> --------------------------------------
>
>                 Key: SOLR-285
>                 URL: https://issues.apache.org/jira/browse/SOLR-285
>             Project: Solr
>          Issue Type: New Feature
>            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.


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

Posted by "Thomas Peuss (JIRA)" <ji...@apache.org>.
    [ 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.