You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2007/12/27 18:43:43 UTC
[jira] Created: (SYNAPSE-216) TextFileDataSource incorrectly parses
data as XML
TextFileDataSource incorrectly parses data as XML
-------------------------------------------------
Key: SYNAPSE-216
URL: https://issues.apache.org/jira/browse/SYNAPSE-216
Project: Synapse
Issue Type: Bug
Components: Core
Affects Versions: NIGHTLY
Reporter: Andreas Veithen
Attachments: TextFileDataSourceTest.java
Usage of TextFileDataSource causes the data to be parsed as XML. Therefore, characters having a special meaning, such as ampersands, will trigger parsing errors. This has significant impact on XSLTMediator when the output of the transformation is text data:
* When the volume of data is below the BYTE_ARRAY_SIZE threshold, the output is used to construct an OMText object directly and is not parsed as XML.
* When the volume is above the threshold, TextFileDataSource is used and the output is parsed as XML.
Therefore transformations that work for small messages may suddenly fail for larger messages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org
[jira] Updated: (SYNAPSE-216) TextFileDataSource incorrectly parses
data as XML
Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-216?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andreas Veithen updated SYNAPSE-216:
------------------------------------
Attachment: synapse-216-patch.txt
TextFileDataSource constructs an InputStream that represents the concatenation <text> + text + </text>. It then uses this input stream to build an XMLStreamReader. The problem comes from the fact that "text" is plain text, not XML text. The attached patch solves this by replacing the custom InputStream implementation by a custom XMLStreamReader implementation that directly produces the expected sequence of XML events:
* START_DOCUMENT
* START_ELEMENT
* (CHARACTERS)*n
* END_ELEMENT
* END_DOCUMENT
See also here: http://mail-archives.apache.org/mod_mbox/ws-synapse-user/200712.mbox/%3c8303AD28-DFA6-48A7-ADAE-BA522DD2E535@skynet.be%3e
The patch also contains the relevant unit tests.
> TextFileDataSource incorrectly parses data as XML
> -------------------------------------------------
>
> Key: SYNAPSE-216
> URL: https://issues.apache.org/jira/browse/SYNAPSE-216
> Project: Synapse
> Issue Type: Bug
> Components: Core
> Affects Versions: NIGHTLY
> Reporter: Andreas Veithen
> Attachments: synapse-216-patch.txt, TextFileDataSourceTest.java
>
>
> Usage of TextFileDataSource causes the data to be parsed as XML. Therefore, characters having a special meaning, such as ampersands, will trigger parsing errors. This has significant impact on XSLTMediator when the output of the transformation is text data:
> * When the volume of data is below the BYTE_ARRAY_SIZE threshold, the output is used to construct an OMText object directly and is not parsed as XML.
> * When the volume is above the threshold, TextFileDataSource is used and the output is parsed as XML.
> Therefore transformations that work for small messages may suddenly fail for larger messages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org
[jira] Resolved: (SYNAPSE-216) TextFileDataSource incorrectly
parses data as XML
Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-216?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Asankha C. Perera resolved SYNAPSE-216.
---------------------------------------
Resolution: Fixed
Fix Version/s: 1.1.1
Assignee: Asankha C. Perera
applied patch and added test cases
thanks Andreas!
> TextFileDataSource incorrectly parses data as XML
> -------------------------------------------------
>
> Key: SYNAPSE-216
> URL: https://issues.apache.org/jira/browse/SYNAPSE-216
> Project: Synapse
> Issue Type: Bug
> Components: Core
> Affects Versions: NIGHTLY
> Reporter: Andreas Veithen
> Assignee: Asankha C. Perera
> Fix For: 1.1.1
>
> Attachments: synapse-216-patch.txt, TextFileDataSourceTest.java
>
>
> Usage of TextFileDataSource causes the data to be parsed as XML. Therefore, characters having a special meaning, such as ampersands, will trigger parsing errors. This has significant impact on XSLTMediator when the output of the transformation is text data:
> * When the volume of data is below the BYTE_ARRAY_SIZE threshold, the output is used to construct an OMText object directly and is not parsed as XML.
> * When the volume is above the threshold, TextFileDataSource is used and the output is parsed as XML.
> Therefore transformations that work for small messages may suddenly fail for larger messages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org
[jira] Updated: (SYNAPSE-216) TextFileDataSource incorrectly parses
data as XML
Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-216?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andreas Veithen updated SYNAPSE-216:
------------------------------------
Attachment: TextFileDataSourceTest.java
Attached a test case that provides evidence for this issue.
> TextFileDataSource incorrectly parses data as XML
> -------------------------------------------------
>
> Key: SYNAPSE-216
> URL: https://issues.apache.org/jira/browse/SYNAPSE-216
> Project: Synapse
> Issue Type: Bug
> Components: Core
> Affects Versions: NIGHTLY
> Reporter: Andreas Veithen
> Attachments: TextFileDataSourceTest.java
>
>
> Usage of TextFileDataSource causes the data to be parsed as XML. Therefore, characters having a special meaning, such as ampersands, will trigger parsing errors. This has significant impact on XSLTMediator when the output of the transformation is text data:
> * When the volume of data is below the BYTE_ARRAY_SIZE threshold, the output is used to construct an OMText object directly and is not parsed as XML.
> * When the volume is above the threshold, TextFileDataSource is used and the output is parsed as XML.
> Therefore transformations that work for small messages may suddenly fail for larger messages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org