Re: [reSIProcate] Problem parsing the XML document using XMLCursor
There is a set of tests for the XML parser (resiprocate/test/). I'll investigate
and possibly add a test (though I remember this test case working).
For the record, XMLParser is very naive and is useful for a small subset of XML
parsing. If you need more than simple parsing (your examples certainly qualify
as simple -- it should work for that level of use) consider writing your own
version of Pidf/XPidf with a third party XML library.
But as I said, your exmple should not be a problem and I'll see what I can do
about it.
david
Quoting somesh s <someshss@xxxxxxxxx>:
> Hi,
>
> When <foo2 uri=\"sip:172.16.25.17\" /> is parsed the
> XMLCursor parser in getAttributes thinks the character
>
> / which is at end as one of the attributes.
>
> When it is logged it displays as
>
> INFO | 20050304-143625.531 | someshs.mct.com |
> testXMLCursor | SIP | 19515 | 1077071264 |
> os/ParseBuffer.cxx:729 | Parse failed,
> os/ParseBuffer.cxx:45
> in context:
> <foo bar="baz" attribute = 'value' />
> ^
> I wanted to know wheather this has been observed by
> someone. Is this *BUG* fixed? How can I *fix* this?
>
> Please help me in this regard.
>
> With regards
> Somesh S. Shanbhag
>
>
> --- somesh s <someshss@xxxxxxxxx> wrote:
> > Hi,
> >
> > I have the problem in parsing XPIDF document.
> >
> > Data contents("<?xml version=\"1.0\"?>
> > <foo1>
> > <foo2 uri=\"sip:172.16.25.17\" />
> > </foo1>");
> >
> > XMLCursor tree (ParseBuffer (contents.data(),
> > contents.size()));
> >
> > tree.getTag(); // foo1
> > tree.firstChild(); // foo2
> >
> > cerr << Inserter(foo2.getAttributes()) << endl;
> > Here it aborts though there is attribute uri in
> > foo2.
> >
> > But if foo2 is written as
> > <foo2 uri=\"sip:172.16.25.17\" > </foo2>
> >
> > It works fine. But I am not able to getAttributes if
> > the style is previous one.
> >
> > Please correct me if am wrong.
> > How should I get Attributes if style is
> > <foo2 uri=\"sip:172.16.25.17\" /> ?
> >
> > With regards
> > Somesh S. Shanbhag
> >
> >
> > -------------------------------
> > SIMPLICITY IS THE BEAUTY.
> > BE NATURAL LIVE NATURAL.
> > -------------------------------
> > Somesh S. Shanbhag
> > Mascon Global Communication Technologies
> > Enterprise of Mascon Global Limited
> > #59/2, 100Ft Ring Road
> > Banashankari II stage
> > Bangalore-560070
> > Karnataka
> > INDIA
> > Website: www.masconit.com
> > -------------------------------
> >
> >
> >
> >
> > __________________________________
> > Celebrate Yahoo!'s 10th Birthday!
> > Yahoo! Netrospective: 100 Moments of the Web
> > http://birthday.yahoo.com/netrospective/
> > _______________________________________________
> > resiprocate-devel mailing list
> > resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> >
> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel
> >
>
> -------------------------------
> SIMPLICITY IS THE BEAUTY.
> BE NATURAL LIVE NATURAL.
> -------------------------------
> Somesh S. Shanbhag
> Mascon Global Communication Technologies
> Enterprise of Mascon Global Limited
> #59/2, 100Ft Ring Road
> Banashankari II stage
> Bangalore-560070
> Karnataka
> INDIA
> Website: www.masconit.com
> -------------------------------
>
>
>
>
> __________________________________
> Celebrate Yahoo!'s 10th Birthday!
> Yahoo! Netrospective: 100 Moments of the Web
> http://birthday.yahoo.com/netrospective/
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel
>