You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Malcolm MacLeod <ma...@tshwanedje.com> on 2006/04/04 12:35:35 UTC

Re: how to not expand attribute entity references?

I still need help with this, its quite urgent... can anyone give me any
ideas?
----- Original Message ----- 
From: "Malcolm MacLeod" <ma...@tshwanedje.com>
To: <c-...@xerces.apache.org>
Sent: Thursday, March 30, 2006 11:37 AM
Subject: how to not expand attribute entity references?


Hi, im using the sax2reader to parse an xml document.

When my startElement() function gets called and i read teh attributes in my
program entity references are being expanded.

eg /
<Foo Bar="&copy;">

is coming through as a copyright symbol, i need it to come through as is,
How can i disable this expansion?

I have seen this option in the dom parser but I can't find it for the sax
parser.

Please help, thanks.


Re: how to not expand attribute entity references?

Posted by Alberto Massari <am...@datadirect.com>.
At 10:33 AM 4/5/2006 +0200, Malcolm MacLeod wrote:
>Okay thanks, ive just disabled the expansion with a quick hack to
>IGXMLScanner2.cpp for now...
>
>If anyone does discover a better way to do this please let me know :)

This could be done with the DOMParser (attribute values can be 
populated with a mix of text nodes and entity references, but Xerces 
currently doesn't support it), but cannot be done with SAXParser, as 
the SAX specs design a callback function that only has a single 
string for the attribute value.

Alberto


>----- Original Message -----
>From: "Alberto Massari" <am...@datadirect.com>
>To: <c-...@xerces.apache.org>
>Sent: Tuesday, April 04, 2006 1:37 PM
>Subject: Re: how to not expand attribute entity references?
>
>
> > Hi Malcom,
> > unfortunately entity expansion inside attribute values cannot be
> > disabled (not even in the DOM parser).
> >
> > Alberto
> >
> > At 12:35 PM 4/4/2006 +0200, Malcolm MacLeod wrote:
> > >I still need help with this, its quite urgent... can anyone give me any
> > >ideas?
> > >----- Original Message -----
> > >From: "Malcolm MacLeod" <ma...@tshwanedje.com>
> > >To: <c-...@xerces.apache.org>
> > >Sent: Thursday, March 30, 2006 11:37 AM
> > >Subject: how to not expand attribute entity references?
> > >
> > >
> > >Hi, im using the sax2reader to parse an xml document.
> > >
> > >When my startElement() function gets called and i read teh attributes in
>my
> > >program entity references are being expanded.
> > >
> > >eg /
> > ><Foo Bar="&copy;">
> > >
> > >is coming through as a copyright symbol, i need it to come through as is,
> > >How can i disable this expansion?
> > >
> > >I have seen this option in the dom parser but I can't find it for the sax
> > >parser.
> > >
> > >Please help, thanks.
> >
> >


Re: how to not expand attribute entity references?

Posted by Malcolm MacLeod <ma...@tshwanedje.com>.
Okay thanks, ive just disabled the expansion with a quick hack to
IGXMLScanner2.cpp for now...

If anyone does discover a better way to do this please let me know :)

----- Original Message ----- 
From: "Alberto Massari" <am...@datadirect.com>
To: <c-...@xerces.apache.org>
Sent: Tuesday, April 04, 2006 1:37 PM
Subject: Re: how to not expand attribute entity references?


> Hi Malcom,
> unfortunately entity expansion inside attribute values cannot be
> disabled (not even in the DOM parser).
>
> Alberto
>
> At 12:35 PM 4/4/2006 +0200, Malcolm MacLeod wrote:
> >I still need help with this, its quite urgent... can anyone give me any
> >ideas?
> >----- Original Message -----
> >From: "Malcolm MacLeod" <ma...@tshwanedje.com>
> >To: <c-...@xerces.apache.org>
> >Sent: Thursday, March 30, 2006 11:37 AM
> >Subject: how to not expand attribute entity references?
> >
> >
> >Hi, im using the sax2reader to parse an xml document.
> >
> >When my startElement() function gets called and i read teh attributes in
my
> >program entity references are being expanded.
> >
> >eg /
> ><Foo Bar="&copy;">
> >
> >is coming through as a copyright symbol, i need it to come through as is,
> >How can i disable this expansion?
> >
> >I have seen this option in the dom parser but I can't find it for the sax
> >parser.
> >
> >Please help, thanks.
>
>


Re: how to not expand attribute entity references?

Posted by Alberto Massari <am...@datadirect.com>.
Hi Malcom,
unfortunately entity expansion inside attribute values cannot be 
disabled (not even in the DOM parser).

Alberto

At 12:35 PM 4/4/2006 +0200, Malcolm MacLeod wrote:
>I still need help with this, its quite urgent... can anyone give me any
>ideas?
>----- Original Message -----
>From: "Malcolm MacLeod" <ma...@tshwanedje.com>
>To: <c-...@xerces.apache.org>
>Sent: Thursday, March 30, 2006 11:37 AM
>Subject: how to not expand attribute entity references?
>
>
>Hi, im using the sax2reader to parse an xml document.
>
>When my startElement() function gets called and i read teh attributes in my
>program entity references are being expanded.
>
>eg /
><Foo Bar="&copy;">
>
>is coming through as a copyright symbol, i need it to come through as is,
>How can i disable this expansion?
>
>I have seen this option in the dom parser but I can't find it for the sax
>parser.
>
>Please help, thanks.