mule - Mulesoft XSLT Streaming Large xml files -
i using mulesoft 3.6 ce. have large xml file, split small xml elements , push jms queue. trying explore xslt options achieve using mule's out of box streaming functionality without writing code.
for example have incoming file
<books> <book> <isbn>1</isbn> <title>book 1</isbn> </book> <book> <isbn>2</isbn> <title>book 2</isbn> </book> .... </books>
and want write each element jms queue following snippet
<book> <isbn>1</isbn> <title>book 1</isbn> </book>
any highly appreciated.
regards, srinivas
since mule support xslt 2.0/3.0, try this, assuming isbns unique
<?xml version="1.0" encoding="utf-8" ?> <xsl:transform xmlns:xsl="http://www.w3.org/1999/xsl/transform" version="2.0"> <xsl:output method="xml" encoding="utf-8" indent="yes" /> <xsl:template match="/books/book"> <xsl:result-document method="xml" href="output_{isbn}.xml"> <xsl:copy-of select="." /> </xsl:result-document> </xsl:template> </xsl:transform>
i don't think you'll able capture output of without custom code or separate port, i'm not 100% sure of how mule handle either.
to honest, question whether you'll performance out of - @ least, don't think perform forward-only reader (xmlstreamreader in java) keep lopping off <book>
nodes , passing them jms queue.
Comments
Post a Comment