Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

facing problem when we try to read data from XML

6 views
Skip to first unread message

yashpal jain

unread,
Jun 12, 2013, 3:18:57 AM6/12/13
to

Code is

1875 sub handle_char() {
1876 my ($parser, $text) = @_;
1877 debug("Value=$text");
1878 print "print value $text\n";
1879 }

case 1
XML data is
<afffectedUsers>b11user3&lt;&amp;&gt;</afffectedUsers>

it print
print Value= b11user3
print Value= <
print Value= >
print Value= &

case 2
XML data is
<afffectedUsers>b11user4,b11user5#</afffectedUsers>

it print
print Value= b11user4,b11user5#


My question is when we replacing special character in XML( in case 1 b11user3&lt;&gt;&amp;) it won't read complete sentence in one parse and it is breaking sentence when it find "&lt;" ,"&gt; &amp;" but in case 2 it read complete sentence in one pass . why it break or print value when it get "&lt;" ,"&gt;,&amp;"


Peter Flynn

unread,
Jun 22, 2013, 6:19:22 PM6/22/13
to
On 06/12/2013 08:18 AM, yashpal jain wrote:
>
> Code is
>
> 1875 sub handle_char() {
> 1876 my ($parser, $text) = @_;
> 1877 debug("Value=$text");
> 1878 print "print value $text\n";
> 1879 }
>
> case 1
> XML data is
> <afffectedUsers>b11user3&lt;&amp;&gt;</afffectedUsers>
>
> it print
> print Value= b11user3
> print Value= <
> print Value= >
> print Value= &
>
> case 2
> XML data is
> <afffectedUsers>b11user4,b11user5#</afffectedUsers>
>
> it print
> print Value= b11user4,b11user5#
>
>
> My question is when we replacing special character in XML (in case 1
> b11user3&lt;&gt;&amp;)

That is not the code you gave above. It's different.
Above: &lt;&amp;&gt;
Here: &lt;&gt;&amp;

Which one is it?

> it won't read complete sentence in one parse

Something to do with your software. Perhaps there is a setting that
makes it do this when it sees a character entity reference to a
character known to be a markup character (< and &).

> and it is breaking sentence when it find "&lt;" ,"&gt; &amp;" but in
> case 2 it read complete sentence in one pass . why it break or print
> value when it get "&lt;" ,"&gt;,&amp;"

Ask the author?
Use better software?

///Peter




0 new messages