Re: Problem with Encoding XML entities
Brought to you by:
bs_php,
nigelswinson
From: Nigel S. <nig...@us...> - 2002-06-04 23:23:41
|
> I have a problem with the Predefined General Entites of XML (' < > etc...) and the evaluate function. > > > Here is my problem: > ---------------- > 1/ I have a XML file with an entity like this: > > <ProductColor nameKey="BLEU D'iles"nameKeyType="String"> bla bla > </ProductColor> > > > 2/ In my DataBase, the stored value is "BLEU D'iles". > > > 3/ When I try to use the XPath evaluate function as below, it doesn't > work of course: > $xPath->evaluate("//ProductColor[@nameKey='Bleu d'iles']"); > > I have also tried : > $xPath->evaluate("//ProductColor[@nameKey='Bleu d'iles']"); > > It doesn't work too. Try: $xPath->evaluate("//ProductColor[@nameKey='BLEU D'iles']"); Sadly XPath does not natively support case insensitivity yet and we haven't coded a fudge round this hole yet. > My Questions: > ------------ > I tried to read carefully the documentation but I didn't find anything > for this. Many thanks :o) > I also tries to use to the decodeEntities function but it's > only for HTML entities and not XML entities which are not exactly the same. > > - Is there a function to evaluate with an automatic XML entities encoding. > - Or did I miss something ? Yeah there's another thread going on relating to this kind of thing just now. It might be that we support a way to read in the XML file and have entitites parsed out. At the moment they go in as is, so hence you have to search for ' rather than '. Hopefully this is ok for your work to continue just now. Cheers, Nigel |