You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Rashmi Badan <ra...@gmail.com> on 2007/04/04 06:13:33 UTC

APR XML parser

Hello,

I am using the APR XML parser to parse an XML file - i.e I'm using the
apr_xml_parser_create() and apr_xml_parse_file() APIs from my C code. Now
here's my problem .....

My XML file has a set of properties like ....
......
......
  <my_properties>
     <property name='prop1' value='some string'/>
     <property name='prop2' value='some other string'/>
 </my_properties>
......
......

This works fine and I'm able to extract the property values. Now I want add
a property which has the delimiting character (single quote here) as part of
its value - something like
     <property name='prop3' value='someone's string'/>

Using the escape character \ to escape the single quote within the value
string didn't seem to work - parser gives an error. Is there a way to go
about this? Is there a way to tell the parse to escape the quote within the
value string? Would appreciate some help/info on this.

Thanks,
Rashmi

Re: APR XML parser

Posted by Aaron Bannert <aa...@clove.org>.
On Wed, Apr 04, 2007 at 09:43:33AM +0530, Rashmi Badan wrote:
> Using the escape character \ to escape the single quote within the value
> string didn't seem to work - parser gives an error. Is there a way to go
> about this? Is there a way to tell the parse to escape the quote within the
> value string? Would appreciate some help/info on this.

You probably want to use &apos; which I believe is the XML entity
encoding for a single-quote.

-aaron