You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Dumindu Pallewela <du...@wso2.com> on 2006/12/04 08:27:42 UTC

[AXIS2] Should newlines be preserved in AXIOM.

It seems to me that the current implementation of axiom does not 
preserve the newlines that are after the element tags. For example, the 
following two xml documents, once parsed using axiom and serialized back 
would be the same as the second document, though the first one 
originally had newline characters. This may lead to interoperability 
problems especially with digital signature.

Please let me know if this actually is the case for AXIOM, and if it's 
not, how to get the newlines where they should be applied.


1.xml
=====

<a>
    <b>
    </b>
</a>


2.xml
=====

<a><b></b></a>

Thanks,
Dumindu.



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Re: [AXIS2] Should newlines be preserved in AXIOM.

Posted by Dinesh Premalal <xy...@gmail.com>.
Hi Dumindu,

Dumindu Pallewela <du...@wso2.com> writes:
>
> Please let me know if this actually is the case for AXIOM, 
Had a look at axiom code and got to know this is a bug in AXIOM. in
libxml_reader_wrapper.c there is some mapping like
<snip>
parser->event_map[XML_READER_TYPE_TEXT] = AXIOM_XML_READER_CHARACTER; 
parser->event_map[XML_READER_TYPE_CDATA] = AXIOM_XML_READER_CHARACTER; 
parser->event_map[XML_READER_TYPE_SIGNIFICANT_WHITESPACE] = AXIOM_XML_READER_SPACE;
parser->event_map[XML_READER_TYPE_WHITESPACE] = AXIOM_XML_READER_SPACE;
parser->event_map[XML_READER_TYPE_END_ELEMENT] =   AXIOM_XML_READER_END_ELEMENT;
parser->event_map [XML_READER_TYPE_ENTITY_REFERENCE] = AXIOM_XML_READER_ENTITY_REFERENCE;
parser->event_map [XML_READER_TYPE_END_ENTITY] = AXIOM_XML_READER_SPACE;
</snip>

please note that several libxml events map to
AXIOM_XML_READER_CHARACTER and AXIOM_XML_READER_SPACE where as
AXIOM_XML_READER_SPACE event doesn't do anything inside the stax
builder. afaik this is a bug. Could you please raise a jira. 

thanks,
Dinesh

-- 
Dinesh Premalal
dinesh@wso2.com
WSO2, Inc.; http://www.wso2.com/
GPG Key ID : A255955C
GPG Key Finger Print : C481 E5D4 C27E DC34 9257  0229 4F44 266E A255 955C

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org