[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [xml] Entity with elements inside it?
- From: Bo Yang <struggleyb nku gmail com>
- To: xml gnome org
- Subject: Re: [xml] Entity with elements inside it?
- Date: Thu, 9 Jul 2009 16:01:26 +0800
On Thu, Jul 9, 2009 at 2:10 PM, Daniel Veillard<veillard redhat com> wrote:
> On Thu, Jul 09, 2009 at 12:14:27PM +0800, Bo Yang wrote:
>> Hi,
>> I am now using libxml2 as my parser for XML, but I can't find a way
>> to expand the elements inside an entity declaration. For example
>>
>> <!ENTITY ent4 "<title attr1="some">some text</title>" >
>>
>> And in the document, this entity is referenced as
>>
>> <ele> &ent4; </ele>
>>
>> When libxml2 parse to above, it creates a EntityRef element and pass
>> the entity ent4 as a child of this EntityRef element. And the
>> passed-in child has a entity->content as "<title attr1="some">some
>> text</title>", but what I want is not the string , I want to parse
>> this string to a DOM tree, could you please tell me how can I archieve
>> this? Thanks a lot!
>>
>> ps: I use xmlParseChunk to parse my file part by part. I don't think I
>> can call another xmlParseChunk to parse the entity string... :)
>
> You need to create the parser context with XML_PARSE_NOENT option
Thanks for your reply, Daniel. But I did not find any param used to
pass option in xmlCreatePushParserCtxt. And I pass it in at
xmlCtxtUseOptions, I think they have the same effect.
And the option XML_PARSE_NOENT means, there will be no
entity_reference node created, right?
Regards!
Bo
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]