Mined Opinions For API: stax

This tab contains all the opinions collected from Stack Overflow about the API. The other tabs present summaries of the opinions using different algorithms.
  • Since it converts StAX events to/from JSON it can be used with an XML binding tool (JAXB is the standard) to produce JSON from objects.. details
  • Correct, I should have mentioned that one too.. details
  • The point being: JAXB does not have any concept of JSON, so any support for JSON relies on retrofitting JSON to an XML model of the world (StaX).. details
  • StAXON can convert JSON to XML using either XSLT with default templates or StAX event API URL_https://github.com/beckchr/staxon/wiki/Converting-JSON-to- XML [ URL_https://github.com/beckchr/staxon/wiki/Converting-JSON-to-XML ] Here's a simple example: INPUT FILE: CODESNIPPET_JAVA1 .. details
  • Thanks for the answer and the extra effort!.. details
  • This provides the "write to file" (or to the standard output) solution.. details
  • Thanks.. details
  • It gives you the ease of XPath with the performance of STAX parsing; honestly (I am being unbiased, seriously) -- it is awesome.. details
  • If you've done XML parsing in Java before, you'll be fine though.. details
  • It gives you the ease of XPath with the performance of STAX parsing; honestly (I am being unbiased, seriously) -- it is awesome.. details
  • It's URL_http://www.thebuzzmedia.com/software/simple-java-xml-parser- sjxp/#performance [really-fast] and it works on Android.. details
  • Then you just pass that rule to the parser when you create it, like this: CODESNIPPET_JAVA2 .. details
  • You can look at the URL_http://www.thebuzzmedia.com/software/simple-java-xml- parser-sjxp/#usage [Usage-example] , but you essentially define rules to match like "/library/book/title" will parse all your tag contents; you can parse attributes and even name-space qualified values (yes it supports namespaces too!). details
  • NOW, all that being said, working with these APIs especially if you are new isn't the most intuitive in the world.. details
  • It's URL_http://www.thebuzzmedia.com/software/simple-java-xml-parser- sjxp/#performance [really-fast] and it works on Android.. details
  • I've created a self-contained Maven project demonstrating this URL_https://github.com/zzantozz/testbed/tree/master/stackoverflow/8367671 -convert-xml-stream-to-json-stream [on-Github] .. details
  • EDIT: Getting a CODETERM14 or CODETERM15 from an OutputStream or a Writer (which would also cover the "conversion" I spoke of above), can be done in a number of ways, although for best results and "infinite" input sizes multithreading is involved.. details
  • I also think you might get better answers if you explained bit more what you are trying to achieve, beyond mechanisms you are hoping to use.. details
  • And if you truly want SAX, writing wrapper from Stax to SAX is trivial as well (but not the other way around).. details
  • The choice of SAX/DOM is really basde on what you're trying to parse, see this for how to decide on which one to use: URL_http://geekexplains.blogspot.com/2009/04/sax-vs-dom-differences-between- dom-and.html [ URL_http://geekexplains.blogspot.com/2009/04/sax-vs-dom-differences - between-dom-and.html] Even if you don't use SAX/DOM there are still simple options available to you, take a look at Simple : ) URL_http://simple.sourceforge.net/ [ URL_http://simple.sourceforge.net/ ] You may also want to consider STaX.. details
  • Thanks, I will have a look at simple.. details
  • Actually, any XML package that can use Stax API can use Jettison -- JAXB does, so there's no extra work involved (same is mostly true for XStream too, although it may have some additional support).. details
  • But if not, perhaps you should build a DOM tree from Stax, using URL_http://staxmate.codehaus.org [link-text] , like URL_http://www.cowtowncoder.com/blog/archives/2009/06/entry%5F270.html [this- article] explains?. details
  • But if not, perhaps you should build a DOM tree from Stax, using URL_http://staxmate.codehaus.org [link-text] , like URL_http://www.cowtowncoder.com/blog/archives/2009/06/entry%5F270.html [this- article] explains?. details
  • No I don't think Xalan supports Stax, for some reason.. details
  • The latest version is 2.7.1 and maybe they added support for StAXSource in that version.. details
  • I especially like being able to switch back and forth between using a "tree model" (similar to XML DOM) and object mapping.. details
  • The main reason I mention it is that the author, Tatu Saloranta, has done some really great stuff (including URL_http://woodstox.codehaus.org/ [Woodstox] , the StAX implementation that I use).. details
  • The main reason I mention it is that the author, Tatu Saloranta, has done some really great stuff (including URL_http://woodstox.codehaus.org/ [Woodstox] , the StAX implementation that I use).. details
  • For sake of completeness, I will also mention that Woodstox ( URL_http://woodstox.codehaus.org ) is another Stax impl that does work well -- alas, JDK-bundled SJSXP has some issues that XML module can not work around with (esp.. details
  • JAXB (JSR-222) is configuration by exception and only requires annotations where you need to override the default XML representation (Jettison converts XML StAX events to/from JSON).. details
  • I spent more than a year working on this while writing a really robust Feed- parsing system that started off as a SAX-based system, then moved to STAX and the more I worked on it the more I realized how easily I could abstract out the pain of STAX with simple rules.. details
  • I have benchmarked, profiled and optimized out the overhead of the library ontop of STAX to the point that it is measurably non-existent.. details
  • It is similar to STAX, but instead of calling stubbed methods every time it finds something new, it rips across the XML file and notifies the caller of its modified state as it sees new content but does nothing WITH the content until you ask it for it.. details
  • Here's a trivial example using Java's built-in StAX implementation to URL_http://docs.oracle.com/javaee/5/tutorial/doc/bnbem.html#bnbfb [parse-XML] and Jettison to URL_http://jettison.codehaus.org/User%27s+Guide#User%27sGuide- STaX [produce-JSON] from it.. details
  • Here's a trivial example using Java's built-in StAX implementation to URL_http://docs.oracle.com/javaee/5/tutorial/doc/bnbem.html#bnbfb [parse-XML] and Jettison to URL_http://jettison.codehaus.org/User%27s+Guide#User%27sGuide- STaX [produce-JSON] from it.. details
  • Tools that can be used for converting from/to XML/JSON (e.g., URL_http://beckchr.github.com/staxon/ [StaxON] , URL_http://json- lib.sourceforge.net/ [JSON-lib] , URL_http://jettison.codehaus.org [Jettison] , URL_http://xstream.codehaus.org/ [XStream] ) do not seem to do that but only conversion of a known structure.. details
  • Reading everything into memory is not possible (for lack of space) and they want to convert this into CODETERM3 directly, i.e., without having to write any code to detect and handle the StAX tags (e.g., CODETERM4 , CODETERM5 , CODETERM6 ).. details
  • It exposes JSON content via Stax API (javax.xml.stream).. details
  • For example, there are many data binding tools for both XML and JSON; and using such tools could hide lower level details much better than using abstraction meant for one to process the other.. details
  • This fails because the Saxon transformer we are using does not support a StAXSource.. details
  • But the question itself is bit vague: while you can always convert from one to the othe (it is a very trivial thing to do really), XML and JSON are not equivalent: there is no one-to-one lossless generic mapping.Hence, the question is: what are you planning to do with results, how is resulting xml to be used?. details
  • One more possibility: Jettison, URL_http://jettison.codehaus.org [ URL_http://jettison.codehaus.org ] can expose Json via XML parsing interface (stax XMLStreamReader), which allows integration with systems that only understand XML.. details
Summaries the opinions about stax using topic modeling.
  • 0. jaxb standard binding produce tool answer effort number multithreading speak: 3
    • Since it converts StAX events to/from JSON it can be used with an XML binding tool (JAXB is the standard) to produce JSON from objects.. details
    • Thanks for the answer and the extra effort!.. details
    • EDIT: Getting a Reader or InputStream from an OutputStream or a Writer (which would also cover the "conversion" I spoke of above), can be done in a number of ways, although for best results and "infinite" input sizes multithreading is involved.. details
  • 1. explain jaxb answer additional jettison xstream true involve mechanism bit: 5
    • It gives you the ease of XPath with the performance of STAX parsing; honestly (I am being unbiased, seriously) -- it is awesome.. details
    • Then you just pass that rule to the parser when you create it, like this: CODESNIPPET .. details
    • It's sjxp/#performance [really-fast] and it works on Android.. details
    • I also think you might get better answers if you explained bit more what you are trying to achieve, beyond mechanisms you are hoping to use.. details
    • Actually, any XML package that can use Stax API can use Jettison -- JAXB does, so there's no extra work involved (same is mostly true for XStream too, although it may have some additional support).. details
  • 2. usage stream sjxp rule content book title write attribute space: 4
    • This provides the "write to file" (or to the standard output) solution.. details
    • You can look at the parser-sjxp/#usage [Usage-example] , but you essentially define rules to match like "/library/book/title" will parse all your tag contents; you can parse attributes and even name-space qualified values (yes it supports namespaces too!). details
    • I've created a self-contained Maven project demonstrating this -convert-xml-stream-to-json-stream [on-Github] .. details
    • But if not, perhaps you should build a DOM tree from Stax, using link-text , like this- article] explains?. details
  • 3. sax simple html option decide choice basde write input template: 7
    • StAXON can convert JSON to XML using either XSLT with default templates or StAX event API XML [ Here's a simple example: INPUT FILE: CODESNIPPET .. details
    • Thanks.. details
    • And if you truly want SAX, writing wrapper from Stax to SAX is trivial as well (but not the other way around).. details
    • The choice of SAX/DOM is really basde on what you're trying to parse, see this for how to decide on which one to use: dom-and.html [ - between-dom-and.html] Even if you don't use SAX/DOM there are still simple options available to you, take a look at Simple : ) You may also want to consider STaX.. details
    • Thanks, I will have a look at simple.. details
    • No I don't think Xalan supports Stax, for some reason.. details
    • The latest version is 2.7.1 and maybe they added support for StAXSource in that version.. details
  • 4. model mention world reason woodstox jaxb saloranta include implementation stuff: 6
    • Correct, I should have mentioned that one too.. details
    • The point being: JAXB does not have any concept of JSON, so any support for JSON relies on retrofitting JSON to an XML model of the world (StaX).. details
    • NOW, all that being said, working with these APIs especially if you are new isn't the most intuitive in the world.. details
    • If you've done XML parsing in Java before, you'll be fine though.. details
    • I especially like being able to switch back and forth between using a "tree model" (similar to XML DOM) and object mapping.. details
    • The main reason I mention it is that the author, Tatu Saloranta, has done some really great stuff (including Woodstox , the StAX implementation that I use).. details
  • 0. tool jettison question result system expose thing equivalent othe mapping: 6
    • For sake of completeness, I will also mention that Woodstox ( ) is another Stax impl that does work well -- alas, JDK-bundled SJSXP has some issues that XML module can not work around with (esp.. details
    • JAXB (JSR-222) is configuration by exception and only requires annotations where you need to override the default XML representation (Jettison converts XML StAX events to/from JSON).. details
    • Tools that can be used for converting from/to XML/JSON (e.g., StaxON , lib.sourceforge.net/ [JSON-lib] , Jettison , XStream ) do not seem to do that but only conversion of a known structure.. details
    • For example, there are many data binding tools for both XML and JSON; and using such tools could hide lower level details much better than using abstraction meant for one to process the other.. details
    • One more possibility: Jettison, can expose Json via XML parsing interface (stax XMLStreamReader), which allows integration with systems that only understand XML.. details
    • But the question itself is bit vague: while you can always convert from one to the othe (it is a very trivial thing to do really), XML and JSON are not equivalent: there is no one-to-one lossless generic mapping.Hence, the question is: what are you planning to do with results, how is resulting xml to be used?. details
  • 1. content jettison system start write expose overhead existent point benchmarked: 7
    • It is similar to STAX, but instead of calling stubbed methods every time it finds something new, it rips across the XML file and notifies the caller of its modified state as it sees new content but does nothing WITH the content until you ask it for it.. details
    • I spent more than a year working on this while writing a really robust Feed- parsing system that started off as a SAX-based system, then moved to STAX and the more I worked on it the more I realized how easily I could abstract out the pain of STAX with simple rules.. details
    • I have benchmarked, profiled and optimized out the overhead of the library ontop of STAX to the point that it is measurably non-existent.. details
    • Here's a trivial example using Java's built-in StAX implementation to parse-XML and Jettison to STaX [produce-JSON] from it.. details
    • Reading everything into memory is not possible (for lack of space) and they want to convert this into JSON directly, i.e., without having to write any code to detect and handle the StAX tags (e.g., START_ELEMENT , CHARACTERS , END_ELEMENT ).. details
    • It exposes JSON content via Stax API (javax.xml.stream).. details
    • This fails because the Saxon transformer we are using does not support a StAXSource.. details
Summaries of the opinions about stax using three algorithms (Textrank, Lexrank and Luhn) adopted from extractive summarization. Each algorithm was used once for the positive opinions and once for the negative opinions.
  • Since it converts StAX events to from JSON it can be used with an XML binding tool (JAXB is the standard) to produce JSON from objects .
  • StAXON can convert JSON to XML using either XSLT with default templates or StAX event API XML Here's a simple example: INPUT FILE: CODESNIPPET JAVA1 .
  • But if not, perhaps you should build a DOM tree from Stax, using link text , like this article explains?.
  • I also think you might get better answers if you explained bit more what you are trying to achieve, beyond mechanisms you are hoping to use .
  • Actually, any XML package that can use Stax API can use Jettison JAXB does, so there's no extra work involved (same is mostly true for XStream too, although it may have some additional support) .
  • It gives you the ease of XPath with the performance of STAX parsing; honestly (I am being unbiased, seriously) it is awesome .
  • You can look at the parser sjxp #usage Usage example , but you essentially define rules to match like " library book title" will parse all your tag contents; you can parse attributes and even name space qualified values (yes it supports namespaces too!).
  • The point being: JAXB does not have any concept of JSON, so any support for JSON relies on retrofitting JSON to an XML model of the world (StaX) .
  • The choice of SAX DOM is really basde on what you're trying to parse, see this for how to decide on which one to use: dom and html between dom and html Even if you don't use SAX DOM there are still simple options available to you, take a look at Simple : ) You may also want to consider STaX .
  • Thanks, I will have a look at simple .
  • Since it converts StAX events to from JSON it can be used with an XML binding tool (JAXB is the standard) to produce JSON from objects .
  • And if you truly want SAX, writing wrapper from Stax to SAX is trivial as well (but not the other way around) .
  • I also think you might get better answers if you explained bit more what you are trying to achieve, beyond mechanisms you are hoping to use .
  • The main reason I mention it is that the author, Tatu Saloranta, has done some really great stuff (including Woodstox , the StAX implementation that I use) .
  • It gives you the ease of XPath with the performance of STAX parsing; honestly (I am being unbiased, seriously) it is awesome .
  • You can look at the parser sjxp #usage Usage example , but you essentially define rules to match like " library book title" will parse all your tag contents; you can parse attributes and even name space qualified values (yes it supports namespaces too!).
  • Then you just pass that rule to the parser when you create it, like this: CODESNIPPET JAVA2 .
  • The point being: JAXB does not have any concept of JSON, so any support for JSON relies on retrofitting JSON to an XML model of the world (StaX) .
  • EDIT: Getting a Reader or InputStream from an OutputStream or a Writer (which would also cover the "conversion" I spoke of above), can be done in a number of ways, although for best results and "infinite" input sizes multithreading is involved .
  • The choice of SAX DOM is really basde on what you're trying to parse, see this for how to decide on which one to use: dom and html between dom and html Even if you don't use SAX DOM there are still simple options available to you, take a look at Simple : ) You may also want to consider STaX .
  • Since it converts StAX events to from JSON it can be used with an XML binding tool (JAXB is the standard) to produce JSON from objects .
  • StAXON can convert JSON to XML using either XSLT with default templates or StAX event API XML Here's a simple example: INPUT FILE: CODESNIPPET JAVA1 .
  • But if not, perhaps you should build a DOM tree from Stax, using link text , like this article explains?.
  • Actually, any XML package that can use Stax API can use Jettison JAXB does, so there's no extra work involved (same is mostly true for XStream too, although it may have some additional support) .
  • I especially like being able to switch back and forth between using a "tree model" (similar to XML DOM) and object mapping .
  • It gives you the ease of XPath with the performance of STAX parsing; honestly (I am being unbiased, seriously) it is awesome .
  • You can look at the parser sjxp #usage Usage example , but you essentially define rules to match like " library book title" will parse all your tag contents; you can parse attributes and even name space qualified values (yes it supports namespaces too!).
  • The point being: JAXB does not have any concept of JSON, so any support for JSON relies on retrofitting JSON to an XML model of the world (StaX) .
  • EDIT: Getting a Reader or InputStream from an OutputStream or a Writer (which would also cover the "conversion" I spoke of above), can be done in a number of ways, although for best results and "infinite" input sizes multithreading is involved .
  • The choice of SAX DOM is really basde on what you're trying to parse, see this for how to decide on which one to use: dom and html between dom and html Even if you don't use SAX DOM there are still simple options available to you, take a look at Simple : ) You may also want to consider STaX .
  • JAXB (JSR 222) is configuration by exception and only requires annotations where you need to override the default XML representation (Jettison converts XML StAX events to from JSON) .
  • One more possibility: Jettison, can expose Json via XML parsing interface (stax XMLStreamReader), which allows integration with systems that only understand XML .
  • This fails because the Saxon transformer we are using does not support a StAXSource .
  • It exposes JSON content via Stax API (javax xml stream) .
  • For example, there are many data binding tools for both XML and JSON; and using such tools could hide lower level details much better than using abstraction meant for one to process the other .
  • It is similar to STAX, but instead of calling stubbed methods every time it finds something new, it rips across the XML file and notifies the caller of its modified state as it sees new content but does nothing WITH the content until you ask it for it .
  • I spent more than a year working on this while writing a really robust Feed parsing system that started off as a SAX based system, then moved to STAX and the more I worked on it the more I realized how easily I could abstract out the pain of STAX with simple rules .
  • For sake of completeness, I will also mention that Woodstox ( ) is another Stax impl that does work well alas, JDK bundled SJSXP has some issues that XML module can not work around with (esp .
  • Tools that can be used for converting from to XML JSON (e g , StaxON , lib sourceforge net JSON lib , Jettison , XStream ) do not seem to do that but only conversion of a known structure .
  • Here's a trivial example using Java's built in StAX implementation to parse XML and Jettison to STaX produce JSON from it .
  • JAXB (JSR 222) is configuration by exception and only requires annotations where you need to override the default XML representation (Jettison converts XML StAX events to from JSON) .
  • But the question itself is bit vague: while you can always convert from one to the othe (it is a very trivial thing to do really), XML and JSON are not equivalent: there is no one to one lossless generic mapping Hence, the question is: what are you planning to do with results, how is resulting xml to be used?.
  • For example, there are many data binding tools for both XML and JSON; and using such tools could hide lower level details much better than using abstraction meant for one to process the other .
  • It is similar to STAX, but instead of calling stubbed methods every time it finds something new, it rips across the XML file and notifies the caller of its modified state as it sees new content but does nothing WITH the content until you ask it for it .
  • I spent more than a year working on this while writing a really robust Feed parsing system that started off as a SAX based system, then moved to STAX and the more I worked on it the more I realized how easily I could abstract out the pain of STAX with simple rules .
  • I have benchmarked, profiled and optimized out the overhead of the library ontop of STAX to the point that it is measurably non existent .
  • For sake of completeness, I will also mention that Woodstox ( ) is another Stax impl that does work well alas, JDK bundled SJSXP has some issues that XML module can not work around with (esp .
  • Reading everything into memory is not possible (for lack of space) and they want to convert this into JSON directly, i e , without having to write any code to detect and handle the StAX tags (e g , START_ELEMENT , CHARACTERS , END_ELEMENT ) .
  • Tools that can be used for converting from to XML JSON (e g , StaxON , lib sourceforge net JSON lib , Jettison , XStream ) do not seem to do that but only conversion of a known structure .
  • Here's a trivial example using Java's built in StAX implementation to parse XML and Jettison to STaX produce JSON from it .
  • JAXB (JSR 222) is configuration by exception and only requires annotations where you need to override the default XML representation (Jettison converts XML StAX events to from JSON) .
  • One more possibility: Jettison, can expose Json via XML parsing interface (stax XMLStreamReader), which allows integration with systems that only understand XML .
  • But the question itself is bit vague: while you can always convert from one to the othe (it is a very trivial thing to do really), XML and JSON are not equivalent: there is no one to one lossless generic mapping Hence, the question is: what are you planning to do with results, how is resulting xml to be used?.
  • For example, there are many data binding tools for both XML and JSON; and using such tools could hide lower level details much better than using abstraction meant for one to process the other .
  • It is similar to STAX, but instead of calling stubbed methods every time it finds something new, it rips across the XML file and notifies the caller of its modified state as it sees new content but does nothing WITH the content until you ask it for it .
  • I spent more than a year working on this while writing a really robust Feed parsing system that started off as a SAX based system, then moved to STAX and the more I worked on it the more I realized how easily I could abstract out the pain of STAX with simple rules .
  • I have benchmarked, profiled and optimized out the overhead of the library ontop of STAX to the point that it is measurably non existent .
  • Reading everything into memory is not possible (for lack of space) and they want to convert this into JSON directly, i e , without having to write any code to detect and handle the StAX tags (e g , START_ELEMENT , CHARACTERS , END_ELEMENT ) .
  • Tools that can be used for converting from to XML JSON (e g , StaxON , lib sourceforge net JSON lib , Jettison , XStream ) do not seem to do that but only conversion of a known structure .
  • Here's a trivial example using Java's built in StAX implementation to parse XML and Jettison to STaX produce JSON from it .
Summaries of the opinions about stax using Opinosis, an abstractive summarizer of opinions..
Summaries of the opinions about stax using contrastive viewpoints. Each entry contains a pair of positive and negative sentences that are most likely discussing about similar API features.
Summaries of opinions about based on specific API aspects, such as, performance, usability, etc. The 'Overview' page provides an overview of the aspects detected in the opinions. The 'Trend' page shows the distribution of polarity over time for each aspect. The 'Positive Opinions' page groups positive opinions by the detected aspects. The 'Contrastive By Aspect' page shows paris of contrastive opinions under each aspect (where found).
Features:
  • Correct, I should have mentioned that one too.
  • N/A
Documentation:
  • But if not, perhaps you should build a DOM tree from Stax, using URL_http://staxmate.codehaus.org [link-text] , like URL_http://www.cowtowncoder.com/blog/archives/2009/06/entry%5F270.html [this- article] explains?
  • Here's a trivial example using Java's built-in StAX implementation to URL_http://docs.oracle.com/javaee/5/tutorial/doc/bnbem.html#bnbfb [parse-XML] and Jettison to URL_http://jettison.codehaus.org/User%27s+Guide#User%27sGuide- STaX [produce-JSON] from it.
Community:
  • The main reason I mention it is that the author, Tatu Saloranta, has done some really great stuff (including URL_http://woodstox.codehaus.org/ [Woodstox] , the StAX implementation that I use).
  • N/A
Onlysentiment:
  • Thanks.
  • N/A
Performance:
  • It gives you the ease of XPath with the performance of STAX parsing; honestly (I am being unbiased, seriously) -- it is awesome.
  • N/A
Usability:
  • Since it converts StAX events to/from JSON it can be used with an XML binding tool (JAXB is the standard) to produce JSON from objects.
  • For sake of completeness, I will also mention that Woodstox ( URL_http://woodstox.codehaus.org ) is another Stax impl that does work well -- alas, JDK-bundled SJSXP has some issues that XML module can not work around with (esp.
  • Features: 3
    1. general: 3
      • Correct, I should have mentioned that one too.. details
      • Thanks for the answer and the extra effort!.. details
      • I've created a self-contained Maven project demonstrating this URL_https://github.com/zzantozz/testbed/tree/master/stackoverflow/8367671 -convert-xml-stream-to-json-stream [on-Github] .. details
  • Documentation: 1
    1. general: 1
      • But if not, perhaps you should build a DOM tree from Stax, using URL_http://staxmate.codehaus.org [link-text] , like URL_http://www.cowtowncoder.com/blog/archives/2009/06/entry%5F270.html [this- article] explains?. details
  • Community: 1
    1. general: 1
      • The main reason I mention it is that the author, Tatu Saloranta, has done some really great stuff (including URL_http://woodstox.codehaus.org/ [Woodstox] , the StAX implementation that I use).. details
  • Onlysentiment: 2
    1. general: 2
  • Performance: 2
    1. general: 2
      • It gives you the ease of XPath with the performance of STAX parsing; honestly (I am being unbiased, seriously) -- it is awesome.. details
      • It's URL_http://www.thebuzzmedia.com/software/simple-java-xml-parser- sjxp/#performance [really-fast] and it works on Android.. details
  • Usability: 20
    1. general: 11
      • This provides the "write to file" (or to the standard output) solution.. details
      • It's URL_http://www.thebuzzmedia.com/software/simple-java-xml-parser- sjxp/#performance [really-fast] and it works on Android.. details
      • Then you just pass that rule to the parser when you create it, like this: CODESNIPPET_JAVA2 .. details
      • You can look at the URL_http://www.thebuzzmedia.com/software/simple-java-xml- parser-sjxp/#usage [Usage-example] , but you essentially define rules to match like "/library/book/title" will parse all your tag contents; you can parse attributes and even name-space qualified values (yes it supports namespaces too!). details
      • NOW, all that being said, working with these APIs especially if you are new isn't the most intuitive in the world.. details
      • I also think you might get better answers if you explained bit more what you are trying to achieve, beyond mechanisms you are hoping to use.. details
      • And if you truly want SAX, writing wrapper from Stax to SAX is trivial as well (but not the other way around).. details
      • The choice of SAX/DOM is really basde on what you're trying to parse, see this for how to decide on which one to use: URL_http://geekexplains.blogspot.com/2009/04/sax-vs-dom-differences-between- dom-and.html [ URL_http://geekexplains.blogspot.com/2009/04/sax-vs-dom-differences - between-dom-and.html] Even if you don't use SAX/DOM there are still simple options available to you, take a look at Simple : ) URL_http://simple.sourceforge.net/ [ URL_http://simple.sourceforge.net/ ] You may also want to consider STaX.. details
      • No I don't think Xalan supports Stax, for some reason.. details
      • The latest version is 2.7.1 and maybe they added support for StAXSource in that version.. details
      • The main reason I mention it is that the author, Tatu Saloranta, has done some really great stuff (including URL_http://woodstox.codehaus.org/ [Woodstox] , the StAX implementation that I use).. details
    2. jaxb: 1
      • Actually, any XML package that can use Stax API can use Jettison -- JAXB does, so there's no extra work involved (same is mostly true for XStream too, although it may have some additional support).. details
    3. object: 1
      • I especially like being able to switch back and forth between using a "tree model" (similar to XML DOM) and object mapping.. details
    4. tree: 1
      • But if not, perhaps you should build a DOM tree from Stax, using URL_http://staxmate.codehaus.org [link-text] , like URL_http://www.cowtowncoder.com/blog/archives/2009/06/entry%5F270.html [this- article] explains?. details
    5. parsing: 1
      • If you've done XML parsing in Java before, you'll be fine though.. details
    6. json: 3
      • Since it converts StAX events to/from JSON it can be used with an XML binding tool (JAXB is the standard) to produce JSON from objects.. details
      • The point being: JAXB does not have any concept of JSON, so any support for JSON relies on retrofitting JSON to an XML model of the world (StaX).. details
      • StAXON can convert JSON to XML using either XSLT with default templates or StAX event API URL_https://github.com/beckchr/staxon/wiki/Converting-JSON-to- XML [ URL_https://github.com/beckchr/staxon/wiki/Converting-JSON-to-XML ] Here's a simple example: INPUT FILE: CODESNIPPET_JAVA1 .. details
    7. performance: 1
      • It gives you the ease of XPath with the performance of STAX parsing; honestly (I am being unbiased, seriously) -- it is awesome.. details
    8. multithreading: 1
      • EDIT: Getting a CODETERM14 or CODETERM15 from an OutputStream or a Writer (which would also cover the "conversion" I spoke of above), can be done in a number of ways, although for best results and "infinite" input sizes multithreading is involved.. details
  • Documentation: 1
    1. general: 1
      • Here's a trivial example using Java's built-in StAX implementation to URL_http://docs.oracle.com/javaee/5/tutorial/doc/bnbem.html#bnbfb [parse-XML] and Jettison to URL_http://jettison.codehaus.org/User%27s+Guide#User%27sGuide- STaX [produce-JSON] from it.. details
  • Usability: 13
    1. transformer: 1
      • This fails because the Saxon transformer we are using does not support a StAXSource.. details
    2. jaxb: 1
      • JAXB (JSR-222) is configuration by exception and only requires annotations where you need to override the default XML representation (Jettison converts XML StAX events to/from JSON).. details
    3. binding: 1
      • For example, there are many data binding tools for both XML and JSON; and using such tools could hide lower level details much better than using abstraction meant for one to process the other.. details
    4. parsing: 1
      • I spent more than a year working on this while writing a really robust Feed- parsing system that started off as a SAX-based system, then moved to STAX and the more I worked on it the more I realized how easily I could abstract out the pain of STAX with simple rules.. details
    5. json: 3
      • It exposes JSON content via Stax API (javax.xml.stream).. details
      • But the question itself is bit vague: while you can always convert from one to the othe (it is a very trivial thing to do really), XML and JSON are not equivalent: there is no one-to-one lossless generic mapping.Hence, the question is: what are you planning to do with results, how is resulting xml to be used?. details
      • One more possibility: Jettison, URL_http://jettison.codehaus.org [ URL_http://jettison.codehaus.org ] can expose Json via XML parsing interface (stax XMLStreamReader), which allows integration with systems that only understand XML.. details
    6. file: 1
      • It is similar to STAX, but instead of calling stubbed methods every time it finds something new, it rips across the XML file and notifies the caller of its modified state as it sees new content but does nothing WITH the content until you ask it for it.. details
    7. memory: 1
      • Reading everything into memory is not possible (for lack of space) and they want to convert this into CODETERM3 directly, i.e., without having to write any code to detect and handle the StAX tags (e.g., CODETERM4 , CODETERM5 , CODETERM6 ).. details
    8. general: 3
      • For sake of completeness, I will also mention that Woodstox ( URL_http://woodstox.codehaus.org ) is another Stax impl that does work well -- alas, JDK-bundled SJSXP has some issues that XML module can not work around with (esp.. details
      • I have benchmarked, profiled and optimized out the overhead of the library ontop of STAX to the point that it is measurably non-existent.. details
      • Tools that can be used for converting from/to XML/JSON (e.g., URL_http://beckchr.github.com/staxon/ [StaxON] , URL_http://json- lib.sourceforge.net/ [JSON-lib] , URL_http://jettison.codehaus.org [Jettison] , URL_http://xstream.codehaus.org/ [XStream] ) do not seem to do that but only conversion of a known structure.. details
    9. jettison: 1
      • Here's a trivial example using Java's built-in StAX implementation to URL_http://docs.oracle.com/javaee/5/tutorial/doc/bnbem.html#bnbfb [parse-XML] and Jettison to URL_http://jettison.codehaus.org/User%27s+Guide#User%27sGuide- STaX [produce-JSON] from it.. details